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=0441c9583e35558bd3b20de0202c227e7245f09c;hp=3b40ad4380e5eb27b0cb77218bc5ac973c538c83;hb=731ed77c0bbee7004a6b5645d9a8592a76748a1c;hpb=e8349fbfdf5de82ba3f3e9d147c0ddfa31c2293c 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 3b40ad438..0441c9583 100644 --- a/themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/header.htm +++ b/themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/header.htm @@ -1,6 +1,6 @@ <%# Copyright 2008 Steven Barth - Copyright 2008 Jo-Philipp Wich + Copyright 2008-2016 Jo-Philipp Wich Copyright 2012 David Menting Licensed to the public under the Apache License 2.0. -%> @@ -36,31 +36,28 @@ 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 @@ -72,99 +69,70 @@ 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 @@ -175,30 +143,70 @@ 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 table.concat(disp.context.request, "/")), + 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 %>