From dfe0287c6fbab70c359f97c4b9d72a53bc5ff0e2 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sat, 12 Jul 2008 16:46:10 +0000 Subject: * luci/themes: lots of fixes in openwrt.org theme * luci/libs/cbi: use fpr table sections --- libs/cbi/luasrc/view/cbi/cell_valuefooter.htm | 27 +++++++ libs/cbi/luasrc/view/cbi/cell_valueheader.htm | 15 ++++ libs/cbi/luasrc/view/cbi/tblsection.htm | 88 +++++++++++++-------- .../htdocs/luci-static/openwrt.org/bg.jpg | Bin 13845 -> 40537 bytes .../htdocs/luci-static/openwrt.org/cascade.css | 59 ++++++++------ .../luasrc/view/themes/openwrt.org/header.htm | 73 ++++++++--------- 6 files changed, 169 insertions(+), 93 deletions(-) create mode 100644 libs/cbi/luasrc/view/cbi/cell_valuefooter.htm create mode 100644 libs/cbi/luasrc/view/cbi/cell_valueheader.htm diff --git a/libs/cbi/luasrc/view/cbi/cell_valuefooter.htm b/libs/cbi/luasrc/view/cbi/cell_valuefooter.htm new file mode 100644 index 000000000..045866d7b --- /dev/null +++ b/libs/cbi/luasrc/view/cbi/cell_valuefooter.htm @@ -0,0 +1,27 @@ +<%# +LuCI - Lua Configuration Interface +Copyright 2008 Steven Barth +Copyright 2008 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. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +$Id$ + +-%> + + <%- if self.tag_invalid[section] then -%> +
<%:cbi_invalid%>
+ <%- end -%> + + +<%- if #self.deps > 0 then -%> + +<%- end -%> diff --git a/libs/cbi/luasrc/view/cbi/cell_valueheader.htm b/libs/cbi/luasrc/view/cbi/cell_valueheader.htm new file mode 100644 index 000000000..7b8f0a5d6 --- /dev/null +++ b/libs/cbi/luasrc/view/cbi/cell_valueheader.htm @@ -0,0 +1,15 @@ +<%# +LuCI - Lua Configuration Interface +Copyright 2008 Steven Barth +Copyright 2008 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. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +$Id$ + +-%> +
"> diff --git a/libs/cbi/luasrc/view/cbi/tblsection.htm b/libs/cbi/luasrc/view/cbi/tblsection.htm index 2688e7a1b..367af80b8 100644 --- a/libs/cbi/luasrc/view/cbi/tblsection.htm +++ b/libs/cbi/luasrc/view/cbi/tblsection.htm @@ -16,38 +16,60 @@ $Id$

<%=self.title%>

<%=self.description%>
-
-<% for i, k in pairs(self.children) do %> -
<%=k.title%>
-<% end %> -
-
-<% for i, k in pairs(self.children) do %> -
<%=k.description%>
-<% end %> -
-<% for i, k in ipairs(self:cfgsections()) do%> - <% if not self.anonymous then %>

<%=k%>

<% end %> -<% -section = k -scope = {valueheader = "cbi/tiny_valueheader", valuefooter = "cbi/tiny_valuefooter"} -%> -
-<%+cbi/ucisection%> - <% if self.addremove then %>
- -
<% end %> -
-<% end %> -<% if self.addremove then %> -
- <% if self.anonymous then %> - - <% else %> - - - <% end %><% if self.err_invalid then %>
<%:cbi_invalid%>
<% end %> -
+ <%- local count = 0 -%> + + + <%- for i, k in pairs(self.children) do -%> + + <%- count = count + 1; end; if self.addremove then -%> + + <%- count = count + 1; end -%> + + + <%- for i, k in pairs(self.children) do -%> + + <%- end; if self.addremove then -%> + + <%- end -%> + + <%- for i, k in ipairs(self:cfgsections()) do + if not self.anonymous then + -%> + + + + <%- end + section = k + scope = { valueheader = "cbi/cell_valueheader", valuefooter = "cbi/cell_valuefooter" } + -%> + + <%-+cbi/ucisection-%> + <%- if self.addremove then -%> + + <%- end -%> + + <%- end -%> + + <%- if self.addremove then -%> + + + + <%- end -%> +
<%=k.title%> 
<%=k.description%> 

<%=k%>

+ +
+
+ <% if self.anonymous then %> + + <% else %> + + + <% end %> + + <% if self.err_invalid then %> +
<%:cbi_invalid%>
+ <% end %> +
+
-<% end %> diff --git a/themes/openwrt.org/htdocs/luci-static/openwrt.org/bg.jpg b/themes/openwrt.org/htdocs/luci-static/openwrt.org/bg.jpg index 91c1b12fb..dece957df 100644 Binary files a/themes/openwrt.org/htdocs/luci-static/openwrt.org/bg.jpg and b/themes/openwrt.org/htdocs/luci-static/openwrt.org/bg.jpg differ diff --git a/themes/openwrt.org/htdocs/luci-static/openwrt.org/cascade.css b/themes/openwrt.org/htdocs/luci-static/openwrt.org/cascade.css index 2fb89a46b..42b4d0972 100644 --- a/themes/openwrt.org/htdocs/luci-static/openwrt.org/cascade.css +++ b/themes/openwrt.org/htdocs/luci-static/openwrt.org/cascade.css @@ -15,6 +15,11 @@ body { line-height: 100%; } +code { + font-family: monospace; + white-space: pre; +} + div#content ul { margin-left: 2em; } @@ -78,6 +83,10 @@ div#content ul { float: left; } +.mainmenu li { + white-space: nowrap; +} + .mainmenu div ul { display: none; position: absolute; @@ -144,28 +153,6 @@ div#content ul { float: right; } -.sidebar { - position: absolute; - top: -50px; - right: 0; - width: 18%; - color: #888888; - text-align: center; - font-size: 100%; - font-weight: bold; - z-index: -1; -} - -.sidebar ul { - width: 100%; - margin-top: 16em; - list-style-type: none; - color: #ffffff; - text-align: left; - font-size: 80%; - font-size: normal; -} - #content { clear: both; width: 60%; @@ -241,6 +228,12 @@ input[type=password] { width: 20em; } +td select, +td input[type=text], +td input[type=password] { + width: 99%; +} + textarea { margin-left: -1px; margin-bottom: 0.5em; @@ -328,6 +321,26 @@ div.cbi-section-node { padding-bottom: 0; } +table.cbi-section-table { + width: 100%; + font-size: 95%; +} + +table.cbi-section-table th, +table.cbi-section-table td { + text-align: center; +} + +tr.cbi-section-table-descr th { + font-weight: normal; + font-size: 90%; +} + +td.cbi-section-table-optionals { + text-align: left !important; + padding-top: 1em; +} + .right { text-align: right; } @@ -344,5 +357,3 @@ div.cbi-section-node { text-decoration: none; font-size: 70%; } - - diff --git a/themes/openwrt.org/luasrc/view/themes/openwrt.org/header.htm b/themes/openwrt.org/luasrc/view/themes/openwrt.org/header.htm index ea30cbbd4..df31c010f 100644 --- a/themes/openwrt.org/luasrc/view/themes/openwrt.org/header.htm +++ b/themes/openwrt.org/luasrc/view/themes/openwrt.org/header.htm @@ -19,11 +19,11 @@ local request = require("luci.dispatcher").context.path local category = request[1] local tree = luci.dispatcher.node() local cattree = category and luci.dispatcher.node(category) -local node = luci.dispatcher.context.dispatched +local node = luci.dispatcher.context.dispatched local c = tree for i,r in ipairs(request) do - if c.nodes and c.nodes[r] then + if c.nodes and c.nodes[r] then c = c.nodes[r] c._menu_selected = true end @@ -48,7 +48,7 @@ require("luci.http").prepare_content("text/html") <%=luci.config.brand.firmware%>
<%=luci.config.brand.distro%>
<%:load%>: <%=load1%> <%=load5%> <%=load15%>
- <%:hostname%>: <%=luci.sys.hostname()%> + <%:hostname%>: <%=luci.sys.hostname()%>
<%=luci.config.brand.title%>
@@ -57,7 +57,7 @@ require("luci.http").prepare_content("text/html")
-<%:path%>: <% +<%:path%>: <% local c = tree local url = controller for k,v in pairs(request) do @@ -77,17 +77,17 @@ local function submenu(prefix, node) if not node.nodes then return false end - local index = {} + local index = {} 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}) end end - + table.sort(index, function(a, b) return a.order < b.order end) %>
    - <% for j, v in pairs(index) do + <% for j, v in pairs(index) do local nnode = node.nodes[v.name] local href = controller .. prefix .. v.name href = (nnode.query) and href .. luci.http.build_querystring(nnode.query) or href @@ -97,16 +97,16 @@ local function submenu(prefix, node) <% submenu(prefix .. v.name .. "/", nnode) %> <% end %> -
-<% + +<% end if cattree and cattree.nodes then - local index = {} + local index = {} for k, node in pairs(cattree.nodes) do table.insert(index, {name=k, order=node.order or 100}) end - + table.sort(index, function(a, b) return a.order < b.order end) for i, k in ipairs(index) do @@ -114,13 +114,13 @@ if cattree and cattree.nodes then if node.title and node.target then local href = controller.."/"..category.."/"..k.name href = (k.query) and href .. luci.http.build_querystring(k.query) or href %> - class="preactive"<%end%>><%=node.title%> + class="preactive"<%end%>><%=node.title%> <%submenu("/" .. category .. "/" .. k.name .. "/", node)%>
<% end end end -%> +%>
    <% @@ -130,32 +130,33 @@ end <% end end%>
-
-
- -
-- cgit v1.2.3