<%
local function submenu(prefix, node)
if not node.nodes then
return false
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
%>
- <%
- if "admin" == request[1] then
- local ucic = 0
- for i, j in pairs(require("luci.model.uci").changes()) do
- for k, l in pairs(j) do
- for m, n in pairs(l) do
- ucic = ucic + 1;
- end
+ <%
+ if "admin" == request[1] then
+ local ucic = 0
+ for i, j in pairs(require("luci.model.uci").changes()) do
+ for k, l in pairs(j) do
+ for m, n in pairs(l) do
+ ucic = ucic + 1;
end
end
- %>
- -
<% for j, v in pairs(index) do
@@ -99,6 +122,7 @@ local function submenu(prefix, node)
<% end %>
-
- <% if ucic > 0 then %>
- <%:changes%>: <%=ucic%>
-
+ end
+ %>
+ -
-
- <%:apply%> -
- <%:revert%> -
+
+ <% end %>
+
+ <% if ucic > 0 then %>
+ <%:changes%>: <%=ucic%>
+
- <% end %>
-
+
- <%:apply%> +
- <%:revert%> +