diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2011-09-30 18:09:03 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2011-09-30 18:09:03 +0000 |
commit | 68bf126e8144aa89a9915d6fd940b7c4cecfc76f (patch) | |
tree | cb54c3cf98f58577af7bbd9985e1b4e10512209f /themes | |
parent | d77b8373648b7b7c5edda70da8b235730c1288c0 (diff) |
themes/openwrt: hide modemenu if there is only one entry
Diffstat (limited to 'themes')
-rw-r--r-- | themes/openwrt/htdocs/luci-static/openwrt.org/cascade.css | 3 | ||||
-rw-r--r-- | themes/openwrt/luasrc/view/themes/openwrt.org/header.htm | 10 |
2 files changed, 12 insertions, 1 deletions
diff --git a/themes/openwrt/htdocs/luci-static/openwrt.org/cascade.css b/themes/openwrt/htdocs/luci-static/openwrt.org/cascade.css index 64bc5bd9b..8fb5fcbb0 100644 --- a/themes/openwrt/htdocs/luci-static/openwrt.org/cascade.css +++ b/themes/openwrt/htdocs/luci-static/openwrt.org/cascade.css @@ -238,6 +238,8 @@ html #menubar a:visited.warning { color: #ffffff; list-style: none; margin-right: 1px; + margin-left: 2em; + float: right; } #modemenu li { @@ -247,7 +249,6 @@ html #menubar a:visited.warning { #savemenu { float: right; - margin-right: 2em; } .lang_de #submenu_admin_uci { diff --git a/themes/openwrt/luasrc/view/themes/openwrt.org/header.htm b/themes/openwrt/luasrc/view/themes/openwrt.org/header.htm index c401a12e6..ea9ce02f2 100644 --- a/themes/openwrt/luasrc/view/themes/openwrt.org/header.htm +++ b/themes/openwrt/luasrc/view/themes/openwrt.org/header.htm @@ -25,6 +25,7 @@ local node = luci.dispatcher.context.dispatched local hostname = luci.sys.hostname() local c = tree +local i, r for i,r in ipairs(request) do if c.nodes and c.nodes[r] then c = c.nodes[r] @@ -32,6 +33,13 @@ for i,r in ipairs(request) do end end +local has_categories = 0 +for i,r in pairs(tree.nodes) do + if r.title and not r.hidden then + has_categories = has_categories + 1 + end +end + require("luci.i18n").loadc("base") require("luci.http").prepare_content("application/xhtml+xml") @@ -138,6 +146,7 @@ require("luci.http").prepare_content("application/xhtml+xml") </span> </div> +<% if has_categories > 1 then %> <ul id="modemenu"><% for k,node in pairs(tree.nodes) do if node.title and not node.hidden then %> @@ -146,6 +155,7 @@ for k,node in pairs(tree.nodes) do end %> </ul> +<% end %> <% if tree.nodes[category] and tree.nodes[category].ucidata then |