From 736d8fee47275c36b83949a141363c16cda04be4 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 26 Apr 2018 08:21:59 +0200 Subject: [PATCH] themes: add common class to uci change indicator Add a common CSS class name to the change indicator and modify the openwrt.org theme to hide it when no changes are present, similar to all other themes. This is needed for upcoming uci apply handling changes to be able to auto-hide the indicator without page reload after an apply. Signed-off-by: Jo-Philipp Wich --- .../luasrc/view/themes/bootstrap/header.htm | 2 +- .../luasrc/view/themes/freifunk-generic/header.htm | 2 +- .../luci-theme-material/luasrc/view/themes/material/header.htm | 2 +- .../luasrc/view/themes/openwrt.org/header.htm | 10 +--------- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/header.htm b/themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/header.htm index 0441c9583..7596236a6 100644 --- a/themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/header.htm +++ b/themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/header.htm @@ -145,7 +145,7 @@ end if ucichanges > 0 then - write('%s: %d' %{ + write('%s: %d' %{ url(category, 'uci/changes'), http.urlencode(http.formvalue('redir') or table.concat(disp.context.request, "/")), translate('Unsaved Changes'), diff --git a/themes/luci-theme-freifunk-generic/luasrc/view/themes/freifunk-generic/header.htm b/themes/luci-theme-freifunk-generic/luasrc/view/themes/freifunk-generic/header.htm index 818565528..e9e8288e0 100644 --- a/themes/luci-theme-freifunk-generic/luasrc/view/themes/freifunk-generic/header.htm +++ b/themes/luci-theme-freifunk-generic/luasrc/view/themes/freifunk-generic/header.htm @@ -205,7 +205,7 @@ if tree.nodes[category] and tree.nodes[category].ucidata then -%> <% end %> diff --git a/themes/luci-theme-material/luasrc/view/themes/material/header.htm b/themes/luci-theme-material/luasrc/view/themes/material/header.htm index be7b9ffb8..3592f3873 100644 --- a/themes/luci-theme-material/luasrc/view/themes/material/header.htm +++ b/themes/luci-theme-material/luasrc/view/themes/material/header.htm @@ -170,7 +170,7 @@ end if ucichanges > 0 then - write('%s: %d' %{ + write('%s: %d' %{ url(category, 'uci/changes'), http.urlencode(http.formvalue('redir') or table.concat(disp.context.request, "/")), translate('Unsaved Changes'), diff --git a/themes/luci-theme-openwrt/luasrc/view/themes/openwrt.org/header.htm b/themes/luci-theme-openwrt/luasrc/view/themes/openwrt.org/header.htm index d6db8e885..a560014d3 100644 --- a/themes/luci-theme-openwrt/luasrc/view/themes/openwrt.org/header.htm +++ b/themes/luci-theme-openwrt/luasrc/view/themes/openwrt.org/header.htm @@ -99,22 +99,14 @@ end end - write('
') - if ucic > 0 then - write('%s: %d' %{ + write('' %{ url(category, 'uci/changes'), http.urlencode(http.formvalue('redir') or table.concat(disp.context.request, "/")), translate('Unsaved Changes'), ucic }) - else - write('%s: 0' %{ - translate('Unsaved Changes') - }) end - - write('
') end end -%> -- 2.11.0