X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=themes%2Fluci-theme-bootstrap%2Fluasrc%2Fview%2Fthemes%2Fbootstrap%2Fheader.htm;h=6f09bfcdfa1042a8ae1dce2954fc7443b9ab4da9;hp=2df3386b5248e0331fef2012c3d9d5e0f9f74bc4;hb=1575d659a14c393a46cef8a2e917945b1c676726;hpb=bfbc7f4bdf6b60edf9d52d995c14d156d8349757 diff --git a/themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/header.htm b/themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/header.htm index 2df3386b5..6f09bfcdf 100644 --- a/themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/header.htm +++ b/themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/header.htm @@ -1,16 +1,10 @@ <%# -LuCI - Lua Configuration Interface -Copyright 2008 Steven Barth -Copyright 2008 Jo-Philipp Wich -Copyright 2012 David Menting - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - + Copyright 2008 Steven Barth + Copyright 2008-2016 Jo-Philipp Wich + Copyright 2012 David Menting + Licensed to the public under the Apache License 2.0. -%> + <% local sys = require "luci.sys" local util = require "luci.util" @@ -42,31 +36,28 @@ You may obtain a copy of the License at c._menu_selected = true end end - - -- send as HTML5 + + -- send as HTML5 http.prepare_content("text/html") local function nodeurl(prefix, name, query) - local url = controller .. prefix .. name .. "/" + local u = url(prefix, name) if query then - url = url .. http.build_querystring(query) + u = u .. http.build_querystring(query) end - return pcdata(url) + return pcdata(u) end - local function subtree(prefix, node, level) + local function render_tabmenu(prefix, node, level) if not level then level = 1 end local childs = disp.node_childs(node) if #childs > 0 then - - if level > 2 then -%> -
    - <% - end + if level > 2 then + write('
      ') + end local selected_node local selected_name @@ -78,99 +69,70 @@ You may obtain a copy of the License at selected_node = nnode selected_name = v end - if level > 2 then - %> -
    • - <%=striptags(translate(nnode.title))%> -
    • - <% end + + if level > 2 then + write('
    • %s
    • ' %{ + v, (nnode._menu_selected or (node.leaf and v == leaf)) and 'active' or '', + nodeurl(prefix, v, nnode.query), + striptags(translate(nnode.title)) + }) + end + end + + if level > 2 then + write('
    ') end - - if level > 2 then - %> -
-<% end if selected_node then - subtree(prefix .. selected_name .. "/", selected_node, level + 1) + render_tabmenu(prefix .. "/" .. selected_name, selected_node, level + 1) end end end --%> - - - - - <%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %> - LuCI - - - - - - <% if node and node.css then %> - <% end -%> - <% if css then %> - <% end -%> - - - - -
-
-
- <%=boardinfo.hostname or "?"%> - + end - <% - -- calculate the number of unsaved changes + local function render_changes() + -- calculate the number of unsaved changes if tree.nodes[category] and tree.nodes[category].ucidata then local ucichanges = 0 @@ -181,30 +143,63 @@ You may obtain a copy of the License at end end end - %> -
- <% if ucichanges > 0 then %> - <%:Unsaved Changes%>: <%=ucichanges%> - <% end %> - -
- <% end %> -
-
-
- -<%- if luci.sys.process.info("uid") == 0 and luci.sys.user.getuser("root") and not luci.sys.user.getpasswd("root") then -%> -
-
-

<%:No password set!%>

- <%:There is no password set on this router. Please configure a root password to protect the web interface and enable SSH.%>
- "><%:Go to password configuration...%> -
-
-<%- end -%> - -
-<% if category then subtree("/" .. category .. "/", cattree) end %> + + if ucichanges > 0 then + write('%s: %d' %{ + url(category, 'uci/changes'), + http.urlencode(http.formvalue('redir') or REQUEST_URI), + translate('Unsaved Changes'), + ucichanges + }) + end + end + end +-%> + + + + + <%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %> - LuCI + + + + + + <% if node and node.css then %> + + <% end -%> + <% if css then %> + + <% end -%> + + + + +
+
+
+ <%=boardinfo.hostname or "?"%> + <% render_topmenu() %> +
+ <% render_changes() %> + +
+
+
+
+ + <%- if luci.sys.process.info("uid") == 0 and luci.sys.user.getuser("root") and not luci.sys.user.getpasswd("root") then -%> +
+
+

<%:No password set!%>

+ <%:There is no password set on this router. Please configure a root password to protect the web interface and enable SSH.%>
+ "><%:Go to password configuration...%> +
+
+ <%- end -%> + +
+ <% if category then render_tabmenu(category, cattree) end %>