From fda61912fca5847ff847b2ff395febbfd878717e Mon Sep 17 00:00:00 2001 From: Andrew Reynolds Date: Fri, 20 Jun 2014 09:43:40 -0400 Subject: [PATCH 01/18] Theme: Restructured header.htm to separate luci from html --- luasrc/view/themes/commotion/header.htm | 276 ++++++++++++------------ 1 file changed, 144 insertions(+), 132 deletions(-) diff --git a/luasrc/view/themes/commotion/header.htm b/luasrc/view/themes/commotion/header.htm index 5326b63..3292c46 100644 --- a/luasrc/view/themes/commotion/header.htm +++ b/luasrc/view/themes/commotion/header.htm @@ -1,140 +1,152 @@ <%# -LuCI - Lua Configuration Interface -Copyright 2008 Steven Barth -Copyright 2008 Jo-Philipp Wich -Copyright 2012 David Menting -Copyright 2013 Griffin Boyce -Copyright 2013 Seamus Tuohy + Header.htm is a LuCI theme template that builds the top portion + of each web UI page. It refers to the LuCI header, not the HTML + header, although the HTML header is included in this file. -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 + HTML begins after LuCI/Lua function definitions. - http://www.apache.org/licenses/LICENSE-2.0 + LuCI - Lua Configuration Interface + Copyright 2008 Steven Barth + Copyright 2008 Jo-Philipp Wich + Copyright 2012 David Menting + Copyright 2013 Griffin Boyce + Copyright 2013 Seamus Tuohy + Copyright 2014 Andrew Reynolds + 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 +-%> + +<%# Moving these functions to another template puts them out of scope + with no obvious way to pass variables to includes. + Keeping functions in header template for now. + + Use this syntax: + include("themes/commotion/functions/header-prep", + {var=var, var=var}) -%> + <% - local crypto = require "luci.commotion.crypto" - local http = require "luci.http" - local sys = require "luci.sys" - local disp = require "luci.dispatcher" - local cdisp = require "luci.commotion.dispatch" - - -- ensure that client is running https - crypto.check_https("/admin/", luci.http.getenv()) - - -- send as HTML5 - http.prepare_content("text/html") - - hostname = sys.hostname() - - --The request path (eg. http://ipaddress/cgi-bin/luci/;id-string/THIS/THIS/THIS/) - request = disp.context.path - local request2 = disp.context.request - - --ROOT NODE OF PATH (eg. admin on admin pages) - category = request[1] - section = request[2] - - --SAME AGAIN - cattree = category and disp.node(category) - - --leaf is length of request2 - local leaf = request2[#request2] - - --Create a node of the local thread (the current context) - tree = disp.node() - - --Show the local node (current menu) on the tree - node = disp.context.dispatched - - --An Ordered table of node names of this tree's child nodes - local categories = disp.node_childs(tree) - - local c = tree - local i, r - - -- tag all nodes leading to this page - for i, r in ipairs(request) do - if c.nodes and c.nodes[r] then - c = c.nodes[r] - c._menu_selected = true - end - end - - --nodeurl was here - --subtree was here - -%> + local crypto = require "luci.commotion.crypto" + local http = require "luci.http" + local sys = require "luci.sys" + local disp = require "luci.dispatcher" + local cdisp = require "luci.commotion.dispatch" + + -- ensure that client is running https + crypto.check_https("/admin/", luci.http.getenv()) + + -- send as HTML5 + http.prepare_content("text/html") + + + -- Prepare variables for use in templates + hostname = sys.hostname() + + -- BEGIN menu preparation + --The request path (eg. http://ipaddress/cgi-bin/luci/;id-string/THIS/THIS/THIS/) + request = disp.context.path + local request2 = disp.context.request + + -- Node is our position on the menu tree + -- ROOT NODE OF PATH (e.g. admin on admin pages) + category = request[1] + section = request[2] + + -- SAME AGAIN // cattree indicates submenu item + cattree = category and disp.node(category) + + -- leaf is length of request2 + local leaf = request2[#request2] + + -- Create a node of the local thread (the current context) + tree = disp.node() + + -- Show the local node (current menu) on the tree + node = disp.context.dispatched + + -- An Ordered table of node names of this tree s child nodes + local categories = disp.node_childs(tree) + + local c = tree + local i, r + + -- tag all nodes leading to this page + for i, r in ipairs(request) do + if c.nodes and c.nodes[r] then + c = c.nodes[r] + c._menu_selected = true + end + end + -- END menu preparation + + -- BEGIN mesh ip generation (mesh_ip) + uci = require "luci.model.uci".cursor() + ubus = require "ubus" + conn = ubus.connect() + + if not conn then + error("Failed to connect to ubusd") + end + + mesh_ip = "None" + uci:foreach("wireless", "wifi-iface", function(s) + if s and s.mode and s.mode == "adhoc" and s.network then + local iface = conn:call("network.interface."..s.network, "status", {}) + if iface ~= nil and iface["ipv4-address"] then + if iface["ipv4-address"][1] and iface["ipv4-address"][1].address then + mesh_ip = iface["ipv4-address"][1].address + else + mesh_ip = "Unknown" + end + elseif mesh_ip == "None" then + mesh_ip = "Unknown" + end + end + end + ) + conn:close() + -- END mesh ip generation + + -- BEGIN check for unsaved changes (ucichanges) + -- ucichanges local. Will cause problems + if tree.nodes[category] and tree.nodes[category].ucidata then + local ucichanges = 0 + + for i, j in pairs(require("luci.model.uci").cursor():changes()) do + for k, l in pairs(j) do + for m, n in pairs(l) do + ucichanges = ucichanges + 1; + end + end + end + end + -- END check for unsaved changes +-%> - - - - <%=striptags( hostname .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %> - LuCI - - - - - - - - - <% if node and node.css then %> - - <% end -%> - - - - -
-
- Commotion - toggle header - <%uci = require "luci.model.uci".cursor() - ubus = require "ubus" - conn = ubus.connect() - if not conn then - error("Failed to connect to ubusd") - end - mesh_ip = "None" - uci:foreach("wireless", "wifi-iface", - function(s) - if s and s.mode and s.mode == "adhoc" and s.network then - local iface = conn:call("network.interface."..s.network, "status", {}) - if iface ~= nil and iface["ipv4-address"] then - if iface["ipv4-address"][1] and iface["ipv4-address"][1].address then - mesh_ip = iface["ipv4-address"][1].address - else - mesh_ip = "Unknown" - end - elseif mesh_ip == "None" then - mesh_ip = "Unknown" - end - end - end - ) - conn:close() - -%> - -
- - - - - - -
Node name:<%=hostname%>Mesh IP-Address:<%=mesh_ip%>
-
- - <%include("themes/commotion/unsaved_changes", {tree=tree, controller=controller, category=category})%> - - -
- -
- <%if request[2] == "commotion" then%> <%# TODO Clean and combine these two menu templates after R1 push %> - <%include("themes/commotion/basic_menu", {controller=controller, cattree=cattree, category=category, node=node, section=section})%> -
- <%elseif request[1] ~= "commotion" then%> - <%include("themes/commotion/adv_menu", {controller=controller, cattree=cattree, category=category, node=node, section=section})%> - <%include("themes/commotion/subtree", {controller=controller, category=category, cattree=cattree})%> - <%end%> + + + + <%include("themes/commotion/functions/gen-title")%> + <%include("themes/commotion/stylesheets")%> + <%include("themes/commotion/javascript")%> + + + + "<%= striptags( node.title ) %>"<%- end %>> + +
+ <%include("themes/commotion/top-branding"), + {ucichanges=ucichanges, tree=tree, controller=controller, category=category}%> +
+ +
+
+ <%include("themes/commotion/sidenav"), + {controller=controller, cattree=cattree, category=category, node=node, section=section}%> + + From 8e13e58af4cfcc7d7973a98c4b1d0cffce53f374 Mon Sep 17 00:00:00 2001 From: Andrew Reynolds Date: Fri, 20 Jun 2014 09:50:15 -0400 Subject: [PATCH 02/18] Theme: - Restructured footer to separate HTML from LuCI - Added ID to simplify version check by automated tools --- luasrc/view/themes/commotion/footer.htm | 78 ++++++++++++------------- 1 file changed, 37 insertions(+), 41 deletions(-) diff --git a/luasrc/view/themes/commotion/footer.htm b/luasrc/view/themes/commotion/footer.htm index 3499b39..333d49c 100644 --- a/luasrc/view/themes/commotion/footer.htm +++ b/luasrc/view/themes/commotion/footer.htm @@ -1,47 +1,43 @@ <%# -LuCI - Lua Configuration Interface -Copyright 2008 Steven Barth -Copyright 2008 Jo-Philipp Wich -Copyright 2012 David Menting + LuCI - Lua Configuration Interface + Copyright 2008 Steven Barth + Copyright 2008 Jo-Philipp Wich + Copyright 2012 David Menting + Copyright 2014 Andrew Reynolds -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 + 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 + http://www.apache.org/licenses/LICENSE-2.0 + + footer.htm is a LuCI theme template that builds the bottom portion + of each web UI page. It refers to the LuCI footer, not the HTML + footer, although the HTML footer is included in this file. -%> -
-<% - local disp = require "luci.dispatcher" - - local request = disp.context.path - - local category = request[1] - - local tree = disp.node() - - local categories = disp.node_childs(tree) -%> -
- - - - - - + <%# Footer contained duplicate module imports -%> + + +
+ + + + From d430685d242c7eb415bb698b2ffd85a91cc79c5b Mon Sep 17 00:00:00 2001 From: Andrew Reynolds Date: Fri, 20 Jun 2014 09:53:38 -0400 Subject: [PATCH 03/18] Theme: Moved template javascript to separate include --- luasrc/view/themes/commotion/javascript.htm | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 luasrc/view/themes/commotion/javascript.htm diff --git a/luasrc/view/themes/commotion/javascript.htm b/luasrc/view/themes/commotion/javascript.htm new file mode 100644 index 0000000..3825b26 --- /dev/null +++ b/luasrc/view/themes/commotion/javascript.htm @@ -0,0 +1,9 @@ +<%# + This include is called from header.htm +-%> + + + + + + \ No newline at end of file From f9bca4fe0540dee5f7c4159127e7e3fe4fe0e343 Mon Sep 17 00:00:00 2001 From: Andrew Reynolds Date: Fri, 20 Jun 2014 10:01:26 -0400 Subject: [PATCH 04/18] Theme: Reformatted setup_wiz_sidebar --- .../themes/commotion/setup_wiz_sidebar.htm | 45 +++++++++++-------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/luasrc/view/themes/commotion/setup_wiz_sidebar.htm b/luasrc/view/themes/commotion/setup_wiz_sidebar.htm index 6bdfb11..381aa20 100644 --- a/luasrc/view/themes/commotion/setup_wiz_sidebar.htm +++ b/luasrc/view/themes/commotion/setup_wiz_sidebar.htm @@ -1,22 +1,31 @@ +
-
- <% local sidebar = {"Start Over"} - for _,x in ipairs(sidebar) do - local title = translate(x) - -%> -
-

"<%=title%>" -

-
- <% end %> -
-
+
+ <% + local sidebar = {"Start Over"} + for _,x in ipairs(sidebar) do + local title = translate(x) + -%> + +
+

"<%=title%>"

+
+ <% end %> +
+ +
+ \ No newline at end of file From 683b708dace3c458c4021703c10a017629659d68 Mon Sep 17 00:00:00 2001 From: Andrew Reynolds Date: Fri, 20 Jun 2014 10:04:35 -0400 Subject: [PATCH 05/18] Theme: Moved sidenav to separate include file (sidenav.htm) --- luasrc/view/themes/commotion/sidenav.htm | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 luasrc/view/themes/commotion/sidenav.htm diff --git a/luasrc/view/themes/commotion/sidenav.htm b/luasrc/view/themes/commotion/sidenav.htm new file mode 100644 index 0000000..e7009e2 --- /dev/null +++ b/luasrc/view/themes/commotion/sidenav.htm @@ -0,0 +1,12 @@ +<%# + Commotion Sidenav. Include is called from header.htm + + Copyright 2014 Seamus Tuohy +-%> + <%if request[2] == "commotion" then%> <%# TODO Clean and combine these two menu templates after R1 push %> + <%include("themes/commotion/basic_menu", {controller=controller, cattree=cattree, category=category, node=node, section=section})%> + + <%elseif request[1] ~= "commotion" then%> + <%include("themes/commotion/adv_menu", {controller=controller, cattree=cattree, category=category, node=node, section=section})%> + <%include("themes/commotion/subtree", {controller=controller, category=category, cattree=cattree})%> + <%end%> \ No newline at end of file From e710f19b0a2578f2b445c847a120bbf19e4d6ea5 Mon Sep 17 00:00:00 2001 From: Andrew Reynolds Date: Fri, 20 Jun 2014 10:07:21 -0400 Subject: [PATCH 06/18] Theme: Moved stylesheet calls to separate include file (stylesheets.htm) --- luasrc/view/themes/commotion/stylesheets.htm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 luasrc/view/themes/commotion/stylesheets.htm diff --git a/luasrc/view/themes/commotion/stylesheets.htm b/luasrc/view/themes/commotion/stylesheets.htm new file mode 100644 index 0000000..ae0e4d0 --- /dev/null +++ b/luasrc/view/themes/commotion/stylesheets.htm @@ -0,0 +1,16 @@ +<%# + Import theme stylesheets. Include called by header.htm + + Copyright 2014 Seamus Tuohy +-%> + + + + + + + + + <% if node and node.css then %> + + <% end -%> From a5b7a9a41cd40270bcc7bf436341d470ab1b0ebe Mon Sep 17 00:00:00 2001 From: Andrew Reynolds Date: Fri, 20 Jun 2014 10:16:08 -0400 Subject: [PATCH 07/18] Theme: Reformatted subtree.htm --- luasrc/view/themes/commotion/subtree.htm | 75 ++++++++++++------------ 1 file changed, 39 insertions(+), 36 deletions(-) diff --git a/luasrc/view/themes/commotion/subtree.htm b/luasrc/view/themes/commotion/subtree.htm index de54adf..1e4ef8f 100644 --- a/luasrc/view/themes/commotion/subtree.htm +++ b/luasrc/view/themes/commotion/subtree.htm @@ -3,46 +3,49 @@ local cdisp = require "luci.commotion.dispatch" local function subtree(prefix, node, level) - if not level then - level = 1 - end + if not level then + level = 1 + end - local childs = disp.node_childs(node) - if #childs > 0 then - - if level > 2 then +local childs = disp.node_childs(node) + if #childs > 0 then + if level > 2 then %> -
    - <% +
      + + <% + end + + local selected_node + local selected_name + local i, v + + for i, v in ipairs(childs) do + local nnode = node.nodes[v] + if nnode._menu_selected then + selected_node = nnode + selected_name = v end - local selected_node - local selected_name - local i, v - - for i, v in ipairs(childs) do - local nnode = node.nodes[v] - if nnode._menu_selected then - selected_node = nnode - selected_name = v - end - if level > 2 then - %> -
    • - <%=striptags(translate(nnode.title))%> -
    • - <% end - end - if level > 2 then - %> -
    -<% end - - if selected_node then - subtree(prefix .. selected_name .. "/", selected_node, level + 1) - end - end - end + %> +
  • + <%=striptags(translate(nnode.title))%> +
  • + <% + end + end + + if level > 2 then + %> +
+ <% end + + if selected_node then + subtree(prefix .. selected_name .. "/", selected_node, level + 1) + end + end +end -%> + <% if category then subtree("/" .. category .. "/", cattree) end %> From 409e417cfe07431138d5ad29a3589ca1725270a1 Mon Sep 17 00:00:00 2001 From: Andrew Reynolds Date: Fri, 20 Jun 2014 10:21:17 -0400 Subject: [PATCH 08/18] Theme: Moved page branding to separate include file (top-branding.htm) --- luasrc/view/themes/commotion/top-branding.htm | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 luasrc/view/themes/commotion/top-branding.htm diff --git a/luasrc/view/themes/commotion/top-branding.htm b/luasrc/view/themes/commotion/top-branding.htm new file mode 100644 index 0000000..65f0959 --- /dev/null +++ b/luasrc/view/themes/commotion/top-branding.htm @@ -0,0 +1,33 @@ +<%# + Generates top-of-page template branding. Called by header.htm + Copyright 2014 Seamus Tuohy +-%> +
+ Commotion - toggle header + + +
+ + + + + + +
Node name:<%=hostname%>Mesh IP-Address:<%=mesh_ip%>
+
+ + + <%include("themes/commotion/unsaved_changes", {ucichanges=ucichanges, tree=tree, controller=controller, category=category})%> + + + From 3b28298172adbb6e5012962eb6528efa0f85e4b3 Mon Sep 17 00:00:00 2001 From: Andrew Reynolds Date: Fri, 20 Jun 2014 10:24:11 -0400 Subject: [PATCH 09/18] Theme: Moved unsaved changes to separate file. Commented out extra 'end' --- .../view/themes/commotion/unsaved_changes.htm | 41 +++++++------------ 1 file changed, 14 insertions(+), 27 deletions(-) diff --git a/luasrc/view/themes/commotion/unsaved_changes.htm b/luasrc/view/themes/commotion/unsaved_changes.htm index fa198f2..3da52bf 100644 --- a/luasrc/view/themes/commotion/unsaved_changes.htm +++ b/luasrc/view/themes/commotion/unsaved_changes.htm @@ -1,28 +1,15 @@ +<%# + Notify user of unsaved changes. Called by top-branding.htm +-%> +
- <% - -- calculate the number of unsaved changes - if tree.nodes[category] and tree.nodes[category].ucidata then - local ucichanges = 0 - - for i, j in pairs(require("luci.model.uci").cursor():changes()) do - for k, l in pairs(j) do - for m, n in pairs(l) do - ucichanges = ucichanges + 1; - end - end - end - - if ucichanges > 0 then - %> - <%:Unsaved Changes%>: <%=ucichanges%> - <% - end - %> - <% - end - %> - -
+ <% if ucichanges > 0 then %> + <%:Unsaved Changes%>: <%=ucichanges%> + <% end %> + + <%# end -%> + +
\ No newline at end of file From 58905f0d4ed9b18a76ab11a0772bb6956f3fb65c Mon Sep 17 00:00:00 2001 From: Andrew Reynolds Date: Fri, 20 Jun 2014 13:02:13 -0400 Subject: [PATCH 10/18] Theme: incorrect media paths in includes --- luasrc/view/themes/commotion/javascript.htm | 8 ++++---- luasrc/view/themes/commotion/stylesheets.htm | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/luasrc/view/themes/commotion/javascript.htm b/luasrc/view/themes/commotion/javascript.htm index 3825b26..4ff601a 100644 --- a/luasrc/view/themes/commotion/javascript.htm +++ b/luasrc/view/themes/commotion/javascript.htm @@ -3,7 +3,7 @@ -%> - - - - \ No newline at end of file + + + + \ No newline at end of file diff --git a/luasrc/view/themes/commotion/stylesheets.htm b/luasrc/view/themes/commotion/stylesheets.htm index ae0e4d0..e0bc9b3 100644 --- a/luasrc/view/themes/commotion/stylesheets.htm +++ b/luasrc/view/themes/commotion/stylesheets.htm @@ -5,11 +5,11 @@ -%> - + - - + + <% if node and node.css then %> From 3e38c7e1027cb29fbc1b1233604767fcde60d965 Mon Sep 17 00:00:00 2001 From: Andrew Reynolds Date: Fri, 20 Jun 2014 13:05:58 -0400 Subject: [PATCH 11/18] Theme: Added missing title generator --- luasrc/view/themes/commotion/functions/gen-title.htm | 1 + 1 file changed, 1 insertion(+) create mode 100644 luasrc/view/themes/commotion/functions/gen-title.htm diff --git a/luasrc/view/themes/commotion/functions/gen-title.htm b/luasrc/view/themes/commotion/functions/gen-title.htm new file mode 100644 index 0000000..8c27c3a --- /dev/null +++ b/luasrc/view/themes/commotion/functions/gen-title.htm @@ -0,0 +1 @@ +<%=striptags( hostname .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %> - LuCI From b3dc687a087909a88734d23065b5aa76f56cfe5e Mon Sep 17 00:00:00 2001 From: Andrew Reynolds Date: Fri, 20 Jun 2014 14:00:05 -0400 Subject: [PATCH 12/18] Theme: Added missing title function --- luasrc/view/themes/commotion/header.htm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luasrc/view/themes/commotion/header.htm b/luasrc/view/themes/commotion/header.htm index 3292c46..9deff5a 100644 --- a/luasrc/view/themes/commotion/header.htm +++ b/luasrc/view/themes/commotion/header.htm @@ -131,7 +131,7 @@ - <%include("themes/commotion/functions/gen-title")%> + <%include("themes/commotion-rewrite/functions/gen-title")%> <%include("themes/commotion/stylesheets")%> <%include("themes/commotion/javascript")%> From 8efc884e3558f0c87252eaa37614cf2cdd5f939d Mon Sep 17 00:00:00 2001 From: Andrew Reynolds Date: Fri, 20 Jun 2014 14:49:18 -0400 Subject: [PATCH 13/18] Theme: Incorrect include syntax in header.htm --- luasrc/view/themes/commotion/header.htm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/luasrc/view/themes/commotion/header.htm b/luasrc/view/themes/commotion/header.htm index 9deff5a..1724072 100644 --- a/luasrc/view/themes/commotion/header.htm +++ b/luasrc/view/themes/commotion/header.htm @@ -140,13 +140,13 @@ "<%= striptags( node.title ) %>"<%- end %>>
- <%include("themes/commotion/top-branding"), - {ucichanges=ucichanges, tree=tree, controller=controller, category=category}%> + <%include("themes/commotion/top-branding", + {ucichanges=ucichanges, tree=tree, controller=controller, category=category})%>
- <%include("themes/commotion/sidenav"), - {controller=controller, cattree=cattree, category=category, node=node, section=section}%> + <%include("themes/commotion/sidenav", + {controller=controller, cattree=cattree, category=category, node=node, section=section})%> From c282bb8e2c721c2c21cd97deb7f1ef7f27e9ca52 Mon Sep 17 00:00:00 2001 From: Andrew Reynolds Date: Fri, 20 Jun 2014 15:01:53 -0400 Subject: [PATCH 14/18] Theme: Need to check that ucichanges is not nil before using it --- luasrc/view/themes/commotion/unsaved_changes.htm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luasrc/view/themes/commotion/unsaved_changes.htm b/luasrc/view/themes/commotion/unsaved_changes.htm index 3da52bf..835b984 100644 --- a/luasrc/view/themes/commotion/unsaved_changes.htm +++ b/luasrc/view/themes/commotion/unsaved_changes.htm @@ -3,7 +3,7 @@ -%>
- <% if ucichanges > 0 then %> + <% if ucichanges and ucichanges > 0 then %> <%:Unsaved Changes%>: <%=ucichanges%> <% end %> From c70b6876389bc16a641d09f3ce5c5bd02c67d719 Mon Sep 17 00:00:00 2001 From: Andrew Reynolds Date: Fri, 20 Jun 2014 15:21:30 -0400 Subject: [PATCH 15/18] Theme: Fixed bad path --- luasrc/view/themes/commotion/header.htm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luasrc/view/themes/commotion/header.htm b/luasrc/view/themes/commotion/header.htm index 1724072..247011e 100644 --- a/luasrc/view/themes/commotion/header.htm +++ b/luasrc/view/themes/commotion/header.htm @@ -131,7 +131,7 @@ - <%include("themes/commotion-rewrite/functions/gen-title")%> + <%include("themes/commotion/functions/gen-title")%> <%include("themes/commotion/stylesheets")%> <%include("themes/commotion/javascript")%> From e11804f522e3025570ec3d823ce258a5c44859c5 Mon Sep 17 00:00:00 2001 From: Andrew Reynolds Date: Fri, 20 Jun 2014 15:34:47 -0400 Subject: [PATCH 16/18] Theme: - node.title in body class needs to be urlencoded. - Minor reformatting. --- luasrc/view/themes/commotion/header.htm | 9 +++++--- .../view/themes/commotion/unsaved_changes.htm | 22 +++++++++---------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/luasrc/view/themes/commotion/header.htm b/luasrc/view/themes/commotion/header.htm index 247011e..b419f94 100644 --- a/luasrc/view/themes/commotion/header.htm +++ b/luasrc/view/themes/commotion/header.htm @@ -32,6 +32,7 @@ <% local crypto = require "luci.commotion.crypto" local http = require "luci.http" + local urlencode = require "luci.http.protocol".urlencode local sys = require "luci.sys" local disp = require "luci.dispatcher" local cdisp = require "luci.commotion.dispatch" @@ -131,13 +132,15 @@ - <%include("themes/commotion/functions/gen-title")%> + + <%include("themes/commotion/functions/gen-title")%> + <%include("themes/commotion/stylesheets")%> <%include("themes/commotion/javascript")%> - - "<%= striptags( node.title ) %>"<%- end %>> + + >
<%include("themes/commotion/top-branding", diff --git a/luasrc/view/themes/commotion/unsaved_changes.htm b/luasrc/view/themes/commotion/unsaved_changes.htm index 835b984..5b8ecb3 100644 --- a/luasrc/view/themes/commotion/unsaved_changes.htm +++ b/luasrc/view/themes/commotion/unsaved_changes.htm @@ -2,14 +2,14 @@ Notify user of unsaved changes. Called by top-branding.htm -%> -
- <% if ucichanges and ucichanges > 0 then %> - <%:Unsaved Changes%>: <%=ucichanges%> - <% end %> - - <%# end -%> - -
\ No newline at end of file +
+ <% if ucichanges and ucichanges > 0 then %> + <%:Unsaved Changes%>: <%=ucichanges%> + <% end %> + + <%# end -%> + +
\ No newline at end of file From 1214c72746b8c43eee381eac216cff1ce9c86018 Mon Sep 17 00:00:00 2001 From: Andrew Reynolds Date: Fri, 20 Jun 2014 16:14:44 -0400 Subject: [PATCH 17/18] Theme: Moved context-dependent div to sidenav.htm --- luasrc/view/themes/commotion/header.htm | 6 ++---- luasrc/view/themes/commotion/sidenav.htm | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/luasrc/view/themes/commotion/header.htm b/luasrc/view/themes/commotion/header.htm index b419f94..717be5e 100644 --- a/luasrc/view/themes/commotion/header.htm +++ b/luasrc/view/themes/commotion/header.htm @@ -148,8 +148,6 @@
-
- <%include("themes/commotion/sidenav", - {controller=controller, cattree=cattree, category=category, node=node, section=section})%> - + <%include("themes/commotion/sidenav", + {controller=controller, cattree=cattree, category=category, node=node, section=section})%> diff --git a/luasrc/view/themes/commotion/sidenav.htm b/luasrc/view/themes/commotion/sidenav.htm index e7009e2..42bcc98 100644 --- a/luasrc/view/themes/commotion/sidenav.htm +++ b/luasrc/view/themes/commotion/sidenav.htm @@ -5,7 +5,8 @@ -%> <%if request[2] == "commotion" then%> <%# TODO Clean and combine these two menu templates after R1 push %> <%include("themes/commotion/basic_menu", {controller=controller, cattree=cattree, category=category, node=node, section=section})%> - +
+ <%elseif request[1] ~= "commotion" then%> <%include("themes/commotion/adv_menu", {controller=controller, cattree=cattree, category=category, node=node, section=section})%> <%include("themes/commotion/subtree", {controller=controller, category=category, cattree=cattree})%> From ebd00869779b675309c6f0203fcfb0009b251895 Mon Sep 17 00:00:00 2001 From: Andrew Reynolds Date: Mon, 23 Jun 2014 13:17:43 -0400 Subject: [PATCH 18/18] Theme: body tag class quotes closed too early --- luasrc/view/themes/commotion/header.htm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luasrc/view/themes/commotion/header.htm b/luasrc/view/themes/commotion/header.htm index 717be5e..5b5c1e1 100644 --- a/luasrc/view/themes/commotion/header.htm +++ b/luasrc/view/themes/commotion/header.htm @@ -140,7 +140,7 @@ - > +
<%include("themes/commotion/top-branding",