themes: add data-page attribute to body elements
authorJo-Philipp Wich <jo@mein.io>
Sat, 29 Sep 2018 12:16:46 +0000 (14:16 +0200)
committerJo-Philipp Wich <jo@mein.io>
Sat, 29 Sep 2018 12:21:28 +0000 (14:21 +0200)
This is useful to write page specific CSS rules.

Also fix a missing space in the body CSS class name in the bootstrap theme
while we're at it.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/header.htm
themes/luci-theme-freifunk-generic/luasrc/view/themes/freifunk-generic/header.htm
themes/luci-theme-material/luasrc/view/themes/material/header.htm
themes/luci-theme-openwrt/luasrc/view/themes/openwrt.org/header.htm

index 3fc5359493cc375e01d65ac42effbec2f4426b67..9ea1ff2281aedee4bcfda957ef789e81826dfc08 100644 (file)
                <script src="<%=resource%>/xhr.js"></script>
        </head>
 
-       <body class="lang_<%=luci.i18n.context.lang%> <%- if node then %><%= striptags( node.title ) %><%- end %>">
+       <body class="lang_<%=luci.i18n.context.lang%> <% if node then %><%= striptags( node.title ) %><%- end %>" data-page="<%= table.concat(disp.context.requestpath, "-") %>">
                <header>
                        <div class="fill">
                                <div class="container">
index 4a1c7b64401501ebec5f7ab5222c7036dac36056..5b6491a952422bfe008ef5b1dc05f35eac28352c 100644 (file)
@@ -87,7 +87,7 @@
 <title><%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(tostring(node.title)) or '')) %> - LuCI</title>
 </head>
 
-<body class="lang_<%=luci.i18n.context.lang%>">
+<body class="lang_<%=luci.i18n.context.lang%>" data-page="<%= table.concat(disp.context.requestpath, "-") %>">
 
 <div class="wrapper">
 
index 6d1e6efb45540a3cf5016dad9e3c3d861fccae97..737b6dbc659f5dbaada118c98539c65778c3c80b 100644 (file)
        <script src="<%=resource%>/cbi.js"></script>
        <script src="<%=resource%>/xhr.js"></script>
 </head>
-<body class="lang_<%=luci.i18n.context.lang%> <%- if node then %><%= striptags( node.title ) %><%- end %> <% if luci.dispatcher.context.authsession then %>logged-in<% end %>">
+<body class="lang_<%=luci.i18n.context.lang%> <% if node then %><%= striptags( node.title ) %><% end %> <% if luci.dispatcher.context.authsession then %>logged-in<% end %>" data-page="<%= table.concat(disp.context.requestpath, "-") %>">
 <header>
        <div class="fill">
                <div class="container">
index 1d2161168b4019f2f7ea69fd20f8d51901b0297d..873d4d948ebf1307b6dfd7f2d1082346292d54e4 100644 (file)
 //]]></script>
 <title><%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %> - LuCI</title>
 </head>
-<body class="lang_<%=luci.i18n.context.lang%>">
+<body class="lang_<%=luci.i18n.context.lang%>" data-page="<%= table.concat(disp.context.requestpath, "-") %>">
 
 <p class="skiplink">
 <span id="skiplink1"><a href="#navigation"><%:Skip to navigation%></a></span>