From 61d0b4e734017499288e19d2339c5a29c3927910 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 3 Nov 2010 00:01:10 +0000 Subject: [PATCH] themes/openwrt: rework menu and header area --- .../htdocs/luci-static/openwrt.org/cascade.css | 246 ++++++--------------- .../htdocs/luci-static/openwrt.org/tabbg.png | Bin 0 -> 152 bytes .../luasrc/view/themes/openwrt.org/footer.htm | 2 +- .../luasrc/view/themes/openwrt.org/header.htm | 186 ++++++++-------- 4 files changed, 172 insertions(+), 262 deletions(-) create mode 100644 themes/openwrt/htdocs/luci-static/openwrt.org/tabbg.png diff --git a/themes/openwrt/htdocs/luci-static/openwrt.org/cascade.css b/themes/openwrt/htdocs/luci-static/openwrt.org/cascade.css index bada73b99..aaba385e5 100644 --- a/themes/openwrt/htdocs/luci-static/openwrt.org/cascade.css +++ b/themes/openwrt/htdocs/luci-static/openwrt.org/cascade.css @@ -24,6 +24,71 @@ body { padding: 0; } +ul.tabmenu { + margin: 0; + clear: both; + display: block; + vertical-align: bottom; + font-size: 90%; + padding: 5px 0 0 5px; +} + +div.tabmenu2 { + background-color: #AAAAAA; + background-image: url(tabbg.png); + background-repeat: repeat-x; + margin-top: -1px; + border: 1px solid #444444; + border-bottom: none; +} + +div.tabmenu3, +div.tabmenu4, +div.tabmenu5 { + background-color: #AAAAAA; + background-image: url(tabbg.png); + background-repeat: repeat-x; + border: none; +} + +ul.tabmenu li { + float: left; + display: block; + overflow: hidden; +} + +ul.tabmenu li a { + text-decoration: none; + color: #444444; + display: block; + padding: 3px 8px; + margin: 0 2px; + line-height: 1.3em; + border: 1px solid transparent; + border-bottom: none; + font-size: 85%; +} + +ul.tabmenu li.active a { + font-weight: bold; + color: #000000; + background: #f5f5f5; + border: 1px solid #AAAAAA; + border-bottom: none; +} + +ul.tabmenu li a:hover { + color: #444444; + border-color: #444444; +} + +ul.l1 li a { + background-color: #AAAAAA; + background-image: url(tabbg.png); + background-repeat: repeat-x; + border-color: #444444; +} + abbr, acronym { font-style: normal; @@ -79,106 +144,13 @@ code { background-color: white; } -#header { - min-height: 98px; - background-image: url(header.png); - background-repeat: no-repeat; - background-position: left center; - background-color: #557788; - color: #ffffff; - text-align: right; -} - -#header h1 { - padding: 1em 1em 0 1em; -} - -#header p { - padding: 0 1em 1em 1em; -} - -#header h1, -#header p { - font-size: 70%; - font-weight: normal; - line-height: 160%; - text-align: right; -} - -ul.dropdowns { +div.hostinfo { float: left; margin: 0; padding: 0; width: auto; - list-style: none; -} - -html>body ul.dropdowns { - position: relative; -} - -ul.dropdowns li, -ul.dropdowns ul { - margin: 0; - padding: 0; - list-style: none; -} - -ul.dropdowns li { - float: left; - position: relative; - white-space: nowrap; -} - -ul.dropdowns li ul { - position: absolute; - z-index: 1000; - top: auto; - min-width: 10em; -} - -ul.dropdowns li li { - float: none; - position: relative; -} - -ul.dropdowns li a { - display: block; -} - -ul.dropdowns ul li ul { - top: 0; -} - -ul.dropdowns li ul, -ul.dropdowns li.over ul ul, -ul.dropdowns li.focus ul ul, -ul.dropdowns li:hover ul ul, -ul.dropdowns li.over ul ul ul, -ul.dropdowns li.focus ul ul ul, -ul.dropdowns li:hover ul ul ul, -ul.dropdowns li.over ul ul ul ul, -ul.dropdowns li.focus ul ul ul ul, -ul.dropdowns li:hover ul ul ul ul { - left: -3000px; -} - -ul.dropdowns li.over ul, -ul.dropdowns li.focus ul, -ul.dropdowns li:hover ul { - left: 0; -} - -ul.dropdowns ul li.over ul, -ul.dropdowns ul li.focus ul, -ul.dropdowns ul li:hover ul, -ul.dropdowns ul ul li.over ul, -ul.dropdowns ul ul li.focus ul, -ul.dropdowns ul ul li:hover ul, -ul.dropdowns ul ul ul li.over ul, -ul.dropdowns ul ul ul li.focus ul, -ul.dropdowns ul ul ul li:hover ul { - left: 100%; + font-size: 80%; + padding: 0.5em; } #menubar { @@ -193,24 +165,6 @@ ul.dropdowns ul ul ul li:hover ul { background-color: #557788; } -#menubar ul.dropdowns { - min-height: 1.8em; - background: #000000; - color: #ffffff; -} - -#menubar ul.dropdowns li ul { - background: #000000; - color: #ffffff; - border-width: 0 1px 1px 1px; - border-style: solid; - border-color: #444444; -} - -#menubar ul.dropdowns ul li ul { - border-width: 1px; -} - html #menubar a:link, html #menubar a:visited { position: relative; @@ -251,63 +205,6 @@ html #menubar a:visited.warning { font-weight: bold; } -#menubar ul.dropdowns li.over>a, -#menubar ul.dropdowns li.focus>a, -#menubar ul.dropdowns li:hover>a { - font-weight: bold; -} - -.lang_de #submenu_mini_system { min-width: 13.3em; } -* html .lang_de #submenu_mini_system { width: 13.3em; } - -.lang_pt-br #submenu_mini_network { min-width: 14em; } -* html .lang_pt-br #submenu_mini_network { width: 14em; } - -.lang_pt-br #submenu_mini_system { min-width: 11.5em; } -* html .lang_pt-br #submenu_mini_system { width: 11.5em; } - -.lang_ru #submenu_mini_system { min-width: 18em; } -* html .lang_ru #submenu_mini_system { width: 18em; } - -.lang_pt-br #submenu_admin_index { min-width: 11em; } -* html .lang_pt-br #submenu_admin_index { width: 11em; } - -.lang_ru #submenu_admin_index { min-width: 15.5em; } -* html .lang_ru #submenu_admin_index { width: 15.5em; } - -.lang_ru #submenu_admin_status { min-width: 10.5em; } -* html .lang_ru #submenu_admin_status { width: 10.5em; } - -.lang_de #submenu_admin_system { min-width: 13.3em; } -* html .lang_de #submenu_admin_system { width: 13.3em; } - -.lang_fr #submenu_admin_system { min-width: 14.5em; } -* html .lang_fr #submenu_admin_system { width: 14.5em; } - -.lang_pt-br #submenu_admin_system { min-width: 11.5em; } -* html .lang_pt-br #submenu_admin_system { width: 11.5em; } - -.lang_ru #submenu_admin_system { min-width: 18em; } -* html .lang_ru #submenu_admin_system { width: 18em; } - -#submenu_admin_services_chillispot { min-width: 15.5em; } -* html #submenu_admin_services_chillispot { width: 15.5em; } - -#submenu_admin_services_coovachilli { min-width: 15em; } -* html #submenu_admin_services_coovachilli { width: 15em; } - -.lang_ru #submenu_admin_network_routes { min-width: 15.3em; } -* html .lang_ru #submenu_admin_network_routes { width: 15.3em; } - -#submenu_admin_network_firewall { min-width: 14em; } -* html #submenu_admin_network_firewall { width: 14em; } - -.lang_de #submenu_admin_network_firewall { min-width: 16.5em; } -* html .lang_de #submenu_admin_network_firewall { width: 16.5em; } - -.lang_pt-br #submenu_admin_network_firewall { min-width: 15em; } -* html .lang_pt-br #submenu_admin_network_firewall { width: 15em; } - #modemenu { width: auto; background: #000000; @@ -342,17 +239,20 @@ textarea#syslog { font-family: monospace; } -#maincontent { +#maincontainer { clear: both; width: 80%; margin: 0 auto; +} + +#maincontent { padding: 0.5em; background: #f5f5f5; color: #000000; + font-size: 80%; border-width: 0 1px 1px 1px; border-style: solid; border-color: #444444; - font-size: 80%; } #maincontent h2 { diff --git a/themes/openwrt/htdocs/luci-static/openwrt.org/tabbg.png b/themes/openwrt/htdocs/luci-static/openwrt.org/tabbg.png new file mode 100644 index 0000000000000000000000000000000000000000..c84c437cda41c321b58c331d91291d5ee78b4660 GIT binary patch literal 152 zcmeAS@N?(olHy`uVBq!ia0vp^j6f{O0VEi%{+3=05-1LGcVbv~PUa<$!<6Lh?!xdj zJxX;UkjGiz5n0T@z%2~Ij105pNB{-dOFVsD*>7<(i3%vGKaYzA3dwl7IEHXsPyTW0 si#YqA!(aG2|4x6Yf7yQ7exG`VTp5YG2iPA^1gc~3boFyt=akR{04u90xBvhE literal 0 HcmV?d00001 diff --git a/themes/openwrt/luasrc/view/themes/openwrt.org/footer.htm b/themes/openwrt/luasrc/view/themes/openwrt.org/footer.htm index 8df68b14c..736644fba 100644 --- a/themes/openwrt/luasrc/view/themes/openwrt.org/footer.htm +++ b/themes/openwrt/luasrc/view/themes/openwrt.org/footer.htm @@ -14,8 +14,8 @@ $Id$ -%>
+

Powered by <%= luci.__appname__ .. " (v" .. luci.__version__ .. ")" %>

- diff --git a/themes/openwrt/luasrc/view/themes/openwrt.org/header.htm b/themes/openwrt/luasrc/view/themes/openwrt.org/header.htm index 0a32055f8..11f6793b7 100644 --- a/themes/openwrt/luasrc/view/themes/openwrt.org/header.htm +++ b/themes/openwrt/luasrc/view/themes/openwrt.org/header.htm @@ -1,7 +1,7 @@ <%# LuCI - Lua Configuration Interface Copyright 2008 Steven Barth -Copyright 2008 Jo-Philipp Wich +Copyright 2008-2010 Jo-Philipp Wich Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -17,6 +17,8 @@ require("luci.sys") local load1, load5, load15 = luci.sys.loadavg() local request = require("luci.dispatcher").context.path local category = request[1] +local request2 = require("luci.dispatcher").context.request +local leaf = request2[#request2] local tree = luci.dispatcher.node() local cattree = category and luci.dispatcher.node(category) local node = luci.dispatcher.context.dispatched @@ -33,6 +35,72 @@ end require("luci.i18n").loadc("base") require("luci.http").prepare_content("application/xhtml+xml") + + local function nodeurl(prefix, name, query) + local url = controller .. prefix .. name .. "/" + if query then + url = url .. luci.http.build_querystring(query) + end + return pcdata(url) + end + + local function subtree(prefix, node, level) + if not node.nodes or node.hidden then + return false + end + + if not level then + level = 1 + end + + local index = {} + local count = 0 + for k, n in pairs(node.nodes) do + if n.title and n.target then + table.insert(index, {name=k, order=n.order or 100}) + count = count + 1 + end + end + + table.sort(index, function(a, b) return a.order < b.order end) + + if count > 0 then +%> +
+
    + <% + local selected_node + local selected_name + + for j, v in pairs(index) do + if #v.name > 0 then + local nnode = node.nodes[v.name] + + if nnode._menu_selected then + selected_node = nnode + selected_name = v.name + end + %> + class="active"<% end %>> + <%=striptags(nnode.title)%> + + <% + end + end + %> +
+
+<% + if selected_node then + subtree(prefix .. selected_name .. "/", selected_node, level + 1) + end +%> +
+<% + end + end + + -%> @@ -59,77 +127,13 @@ require("luci.http").prepare_content("application/xhtml+xml") <%:Skip to content%>

- - -
- - <%- if 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.%> +
+
+ <% if category then subtree("/" .. category .. "/", cattree) end %>
- <%- end -%> + +
+ + + <%- if 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.%> +
+ <%- end -%> -- 2.11.0