From e097d3f734d25b31fe511a0d344d913a6d411c87 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 19 Jun 2018 16:58:39 +0200 Subject: [PATCH] luci-app-firewall: cleanup template markup Rework the cbi section add template markup to properly render with the latest responsive design changes. Signed-off-by: Jo-Philipp Wich --- .../luasrc/view/firewall/cbi_addforward.htm | 162 ++++++++-------- .../luasrc/view/firewall/cbi_addrule.htm | 181 +++++++++--------- .../luasrc/view/firewall/cbi_addsnat.htm | 87 ++++----- 3 files changed, 207 insertions(+), 223 deletions(-) diff --git a/applications/luci-app-firewall/luasrc/view/firewall/cbi_addforward.htm b/applications/luci-app-firewall/luasrc/view/firewall/cbi_addforward.htm index 279b6e06d..f48599b50 100644 --- a/applications/luci-app-firewall/luasrc/view/firewall/cbi_addforward.htm +++ b/applications/luci-app-firewall/luasrc/view/firewall/cbi_addforward.htm @@ -18,95 +18,91 @@ vals[#vals+1] = '%s (%s)' %{ ip, name } end) -%> -
-
-
-
-
<%:New port forward%>:
+ +

<%:New port forward%>

+
+
+
<%:Name%>
+
<%:Protocol%>
+
<%:External zone%>
+
<%:External port%>
+
<%:Internal zone%>
+
<%:Internal IP address%>
+
<%:Internal port%>
+
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ 0, "data-choices", {keys, vals}) + %>/>
-
-
<%:Name%>
-
<%:Protocol%>
-
<%:External zone%>
-
<%:External port%>
-
<%:Internal zone%>
-
<%:Internal IP address%>
-
<%:Internal port%>
-
+
+
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- 0, "data-choices", {keys, vals}) - %>/> -
-
- -
-
- -
+
+
+
- -
+ else if (!n.value) + { + n.value = 'Forward' + this.value; + } + } + }); +//]]> diff --git a/applications/luci-app-firewall/luasrc/view/firewall/cbi_addrule.htm b/applications/luci-app-firewall/luasrc/view/firewall/cbi_addrule.htm index c99ecaca3..273675cd3 100644 --- a/applications/luci-app-firewall/luasrc/view/firewall/cbi_addrule.htm +++ b/applications/luci-app-firewall/luasrc/view/firewall/cbi_addrule.htm @@ -5,112 +5,105 @@ local zones = fw:get_zones() %> -
- <% if wz then %> -
-
-
-
<%:Open ports on router%>:
+<% if wz then %> +

<%:Open ports on router%>

+
+
+
<%:Name%>
+
<%:Protocol%>
+
<%:External port%>
+
+
+
+
+ +
+
+
-
-
<%:Name%>
-
<%:Protocol%>
-
<%:External port%>
-
+
+
-
-
- -
-
- -
-
- -
-
- -
+
+
- <% end %> - <% if #zones > 1 then %> -
-
-

<%:New forward rule%>:
+
+<% end %> +<% if #zones > 1 then %> +

<%:New forward rule%>

+
+
+
<%:Name%>
+
<%:Source zone%>
+
<%:Destination zone%>
+
+
+
+
+
-
-
<%:Name%>
-
<%:Source zone%>
-
<%:Destination zone%>
-
+
+
-
-
- -
-
- -
-
- -
-
- -
+
+ +
+
+
- <% else %> - - <% end %> +
+<% else %> + +<% end %> - <% if wz then %> - - <% end %> -
+ cbi_validate_field('cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>', true, 'uciname'); + //]]> +<% end %> diff --git a/applications/luci-app-firewall/luasrc/view/firewall/cbi_addsnat.htm b/applications/luci-app-firewall/luasrc/view/firewall/cbi_addsnat.htm index b2775cf69..0b4774ccc 100644 --- a/applications/luci-app-firewall/luasrc/view/firewall/cbi_addsnat.htm +++ b/applications/luci-app-firewall/luasrc/view/firewall/cbi_addsnat.htm @@ -12,53 +12,48 @@ end %> -
- <% if #zones > 1 then %> -
-
-
-
<%:New source NAT%>:
+<% if #zones > 1 then %> +

<%:New source NAT%>

+
+
+
<%:Name%>
+
<%:Source zone%>
+
<%:Destination zone%>
+
<%:To source IP%>
+
<%:To source port%>
+
+
+
+
+ +
+
+ +
+
+ +
+
+ 0, "data-choices", { keys, vals }) + %> />
-
-
<%:Name%>
-
<%:Source zone%>
-
<%:Destination zone%>
-
<%:To source IP%>
-
<%:To source port%>
-
+
+
-
-
- -
-
- -
-
- -
-
- 0, "data-choices", { keys, vals }) - %> /> -
-
- -
-
- -
+
+
- <% else %> - - <% end %> -
+
+<% else %> + +<% end %> -- 2.25.1