<%
local function submenu(prefix, node)
if not node.nodes then
return false
end
- local index = {}
+ 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
%>
-
-
--
- <% 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 +120,17 @@ local function submenu(prefix, node)
<% submenu(prefix .. v.name .. "/", nnode) %>
<% end %>
-
class="preactive"<%end%>><%=node.title%>
+
class="preactive"<%end%>><%=node.title%>
<%submenu("/" .. category .. "/" .. k.name .. "/", node)%>
<% end
end
end
-%>
+%>
- <%
@@ -131,9 +155,7 @@ end
end%>
-
+
<%
if "admin" == request[1] then
local ucic = 0
@@ -145,17 +167,21 @@ end
end
end
%>
-
-
-
- <% if ucic > 0 then %>
-
- <%:changes%>: <%=ucic%> -
- <%:apply%> -
- <%:revert%> - <% else %> -
- <%:changes%>: 0 - <% end %> -
+
<% end %>
+
+
+ <% if ucic > 0 then %>
+ <%:changes%>: <%=ucic%>
+
-
+
- <%:apply%> +
- <%:revert%> +