+
+ write('</div>')
+ end
+ end
+
+ local function render_changes()
+ if tree.nodes[category] and tree.nodes[category].ucidata then
+ local ucic = 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
+ ucic = ucic + 1;
+ end
+ end
+ end
+
+ write('<div id="savemenu">')
+
+ if ucic > 0 then
+ write('<a class="warning" href="%s?redir=%s">%s: %d</a>' %{
+ url(category, 'uci/changes'),
+ http.urlencode(http.formvalue('redir') or REQUEST_URI),
+ translate('Unsaved Changes'),
+ ucic
+ })
+ else
+ write('<a href="#">%s: 0</a>' %{
+ translate('Unsaved Changes')
+ })
+ end
+
+ write('</div>')