From 3b2180b50032956f5eddc6c81aede0669b785041 Mon Sep 17 00:00:00 2001 From: Stan Grishin Date: Mon, 8 Mar 2021 10:46:43 +0000 Subject: [PATCH] luci-app-simple-adblock: bugfix: template layout on theme-openwrt-2020 Signed-off-by: Stan Grishin --- .../luasrc/model/cbi/simple-adblock.lua | 6 +++--- .../luasrc/view/simple-adblock/buttons.htm | 4 ++-- .../luasrc/view/simple-adblock/status.htm | 4 +++- .../po/templates/simple-adblock.pot | 16 ++++++++++++---- 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua b/applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua index dfe3b8a365..b60123e5d5 100644 --- a/applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua +++ b/applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua @@ -195,7 +195,7 @@ else ss = h:option(DummyValue, "_dummy", translate("Service Status")) ss.template = "simple-adblock/status" if tmpfsStatus == "statusSuccess" then - ss.value = translatef("%s is blocking %s domains (with %s).", packageVersion, getFileLines(outputFile), targetDNS) + ss.value = translatef("Blocking %s domains (with %s).", getFileLines(outputFile), targetDNS) else ss.value = statusTable[tmpfsStatus] end @@ -206,7 +206,7 @@ else end if tmpfsError then es = h:option(DummyValue, "_dummy", translate("Collected Errors")) - es.template = "simple-adblock/error" + es.template = "simple-adblock/status" es.value = "" local err, e, url for err in tmpfsError:gmatch("[%p%w]+") do @@ -220,7 +220,7 @@ else end end if packageVersion ~= "" then - buttons = h:option(DummyValue, "_dummy") + buttons = h:option(DummyValue, "_dummy", translate("Service Control")) buttons.template = packageName .. "/buttons" end end diff --git a/applications/luci-app-simple-adblock/luasrc/view/simple-adblock/buttons.htm b/applications/luci-app-simple-adblock/luasrc/view/simple-adblock/buttons.htm index 74eb5e8394..131112c8a7 100644 --- a/applications/luci-app-simple-adblock/luasrc/view/simple-adblock/buttons.htm +++ b/applications/luci-app-simple-adblock/luasrc/view/simple-adblock/buttons.htm @@ -47,7 +47,7 @@ end -%> -
+<%+cbi/valueheader%>
@@ -69,7 +69,7 @@ onclick="button_action(this)" />
-
+<%+cbi/valuefooter%> <%-if not btn_start_status then%> diff --git a/applications/luci-app-simple-adblock/luasrc/view/simple-adblock/status.htm b/applications/luci-app-simple-adblock/luasrc/view/simple-adblock/status.htm index c453428405..b02c7faa82 100644 --- a/applications/luci-app-simple-adblock/luasrc/view/simple-adblock/status.htm +++ b/applications/luci-app-simple-adblock/luasrc/view/simple-adblock/status.htm @@ -5,6 +5,8 @@ This is free software, licensed under the Apache License, Version 2.0 <%+cbi/valueheader%> - +
+ <%=self:cfgvalue(section):gsub('\n', '
' )%> +
<%+cbi/valuefooter%> diff --git a/applications/luci-app-simple-adblock/po/templates/simple-adblock.pot b/applications/luci-app-simple-adblock/po/templates/simple-adblock.pot index 4a2b29b1c7..93193918d8 100644 --- a/applications/luci-app-simple-adblock/po/templates/simple-adblock.pot +++ b/applications/luci-app-simple-adblock/po/templates/simple-adblock.pot @@ -9,10 +9,6 @@ msgstr "" msgid "%s Error: %s %s" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:198 -msgid "%s is blocking %s domains (with %s)." -msgstr "" - #: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:129 msgid "%s is not installed or not found" msgstr "" @@ -66,6 +62,10 @@ msgstr "" msgid "Blocked Hosts URLs" msgstr "" +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:198 +msgid "Blocking %s domains (with %s)." +msgstr "" + #: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:188 msgid "Cache file containing %s domains found." msgstr "" @@ -185,6 +185,10 @@ msgstr "" msgid "Forces Router DNS use on local devices, also known as DNS Hijacking." msgstr "" +#: applications/luci-app-simple-adblock/root/usr/share/rpcd/acl.d/luci-app-simple-adblock.json:3 +msgid "Grant UCI and file access for luci-app-simple-adblock" +msgstr "" + #: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:293 msgid "IPv6 Support" msgstr "" @@ -265,6 +269,10 @@ msgstr "" msgid "Run service after set delay on boot." msgstr "" +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:223 +msgid "Service Control" +msgstr "" + #: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:172 #: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:182 #: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:195 -- 2.30.2