<% -- 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 %>