libs/web: remove inline styles from firewall_zoneforwards and firewall_zonelist widgets
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 15 Feb 2012 17:50:25 +0000 (17:50 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 15 Feb 2012 17:50:25 +0000 (17:50 +0000)
libs/web/luasrc/view/cbi/firewall_zoneforwards.htm
libs/web/luasrc/view/cbi/firewall_zonelist.htm

index f027ab3..2a433b5 100644 (file)
 -%>
 
 <% if zone then %>
 -%>
 
 <% if zone then %>
-<div style="padding:0.5em; white-space:nowrap">
-       <label style="background-color:<%=zone:get_color()%>; padding:0.4em">
+<div style="white-space:nowrap">
+       <label class="zonebadge" style="background-color:<%=zone:get_color()%>">
                <strong><%=zone:name()%>:</strong>
                <strong><%=zone:name()%>:</strong>
-               <%
+               <%-
                        local zempty = true
                        for _, net in ipairs(zone:get_networks()) do
                                net = nwm:get_network(net)
                                if net then
                                        zempty = false
                        local zempty = true
                        for _, net in ipairs(zone:get_networks()) do
                                net = nwm:get_network(net)
                                if net then
                                        zempty = false
-               %>
+               -%>
                        <span class="ifacebadge<% if net:name() == self.network then %> ifacebadge-active<% end %>"><%=net:name()%>:
                        <%
                                local nempty = true
                        <span class="ifacebadge<% if net:name() == self.network then %> ifacebadge-active<% end %>"><%=net:name()%>:
                        <%
                                local nempty = true
                        <% end %>
                        <% if nempty then %><em><%:(empty)%></em><% end %>
                        </span>
                        <% end %>
                        <% if nempty then %><em><%:(empty)%></em><% end %>
                        </span>
-               <% end end %>
-               <% if zempty then %><em><%:(empty)%></em><% end %>
+               <%- end end -%>
+               <%- if zempty then %><em><%:(empty)%></em><% end -%>
        </label>
        &#160;&#8658;&#160;
        <% for _, fwd in ipairs(zone:get_forwardings_by("src")) do
                fz = fwd:dest_zone()
                empty = false %>
        </label>
        &#160;&#8658;&#160;
        <% for _, fwd in ipairs(zone:get_forwardings_by("src")) do
                fz = fwd:dest_zone()
                empty = false %>
-               <label style="background-color:<%=fz:get_color()%>; padding:0.4em">
+               <label class="zonebadge" style="background-color:<%=fz:get_color()%>">
                        <strong><%=fz:name()%></strong>
                </label>&#160;
        <% end %>
        <% if empty then %>
                        <strong><%=fz:name()%></strong>
                </label>&#160;
        <% end %>
        <% if empty then %>
-               <label style="border:1px dashed #AAAAAA; color:#AAAAAA; padding:0.3em">
-                       <strong><small><em><%=zone:forward():upper()%></em></small></strong>
+               <label class="zonebadge zonebadge-empty">
+                       <strong><%=zone:forward():upper()%></strong>
                </label>
        <% end %>
 </div>
                </label>
        <% end %>
 </div>
index 8aa6970..7973437 100644 (file)
@@ -28,7 +28,7 @@
        <% if self.allowlocal then %>
        <li style="padding:0.5em">
                <input class="cbi-input-radio" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)"<%=attr("type", self.widget or "radio") .. attr("id", cbid .. "_empty") .. attr("name", cbid) .. attr("value", "") .. ifattr(checked[""], "checked", "checked")%> /> &#160;
        <% if self.allowlocal then %>
        <li style="padding:0.5em">
                <input class="cbi-input-radio" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)"<%=attr("type", self.widget or "radio") .. attr("id", cbid .. "_empty") .. attr("name", cbid) .. attr("value", "") .. ifattr(checked[""], "checked", "checked")%> /> &#160;
-               <label<%=attr("for", cbid .. "_empty")%> style="background-color:<%=fwm.zone.get_color()%>; padding:0.5em">
+               <label<%=attr("for", cbid .. "_empty")%> style="background-color:<%=fwm.zone.get_color()%>" class="zonebadge">
                        <strong><%:Device%></strong>
                        <% if self.allowany and self.allowlocal then %>(<%:input%>)<% end %>
                </label>
                        <strong><%:Device%></strong>
                        <% if self.allowany and self.allowlocal then %>(<%:input%>)<% end %>
                </label>
@@ -37,7 +37,7 @@
        <% if self.allowany then %>
        <li style="padding:0.5em">
                <input class="cbi-input-radio" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)"<%=attr("type", self.widget or "radio") .. attr("id", cbid .. "_any") .. attr("name", cbid) .. attr("value", "*") .. ifattr(checked["*"], "checked", "checked")%> /> &#160;
        <% if self.allowany then %>
        <li style="padding:0.5em">
                <input class="cbi-input-radio" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)"<%=attr("type", self.widget or "radio") .. attr("id", cbid .. "_any") .. attr("name", cbid) .. attr("value", "*") .. ifattr(checked["*"], "checked", "checked")%> /> &#160;
-               <label<%=attr("for", cbid .. "_any")%> style="background-color:<%=fwm.zone.get_color()%>; padding:0.5em">
+               <label<%=attr("for", cbid .. "_any")%> style="background-color:<%=fwm.zone.get_color()%>" class="zonebadge">
                        <strong><%:Any zone%></strong>
                        <% if self.allowany and self.allowlocal then %>(<%:forward%>)<% end %>
                </label>
                        <strong><%:Any zone%></strong>
                        <% if self.allowany and self.allowlocal then %>(<%:forward%>)<% end %>
                </label>
@@ -50,7 +50,7 @@
        %>
        <li style="padding:0.5em">
                <input class="cbi-input-radio" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)"<%=attr("type", self.widget or "radio") .. attr("id", cbid .. "." .. zone:name()) .. attr("name", cbid) .. attr("value", zone:name()) .. ifattr(checked[zone:name()], "checked", "checked")%> /> &#160;
        %>
        <li style="padding:0.5em">
                <input class="cbi-input-radio" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)"<%=attr("type", self.widget or "radio") .. attr("id", cbid .. "." .. zone:name()) .. attr("name", cbid) .. attr("value", zone:name()) .. ifattr(checked[zone:name()], "checked", "checked")%> /> &#160;
-               <label<%=attr("for", cbid .. "." .. zone:name())%> style="background-color:<%=zone:get_color()%>; padding:0.5em">
+               <label<%=attr("for", cbid .. "." .. zone:name())%> style="background-color:<%=zone:get_color()%>" class="zonebadge">
                        <strong><%=zone:name()%>:</strong>
                        <%
                                local zempty = true
                        <strong><%=zone:name()%>:</strong>
                        <%
                                local zempty = true
@@ -78,9 +78,9 @@
        <% if self.widget ~= "checkbox" and not self.nocreate then %>
        <li style="padding:0.5em">
                <input class="cbi-input-radio" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)" type="radio"<%=attr("id", cbid .. "_new") .. attr("name", cbid) .. attr("value", "-") .. ifattr(not selected, "checked", "checked")%> /> &#160;
        <% if self.widget ~= "checkbox" and not self.nocreate then %>
        <li style="padding:0.5em">
                <input class="cbi-input-radio" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)" type="radio"<%=attr("id", cbid .. "_new") .. attr("name", cbid) .. attr("value", "-") .. ifattr(not selected, "checked", "checked")%> /> &#160;
-               <div style="background-color:<%=fwm.zone.get_color()%>; padding:0.5em; display:inline">
-                       <label<%=attr("for", cbid .. "_new")%>><em><%:unspecified -or- create:%>&#160;</em></label>
-                       <input style="width:6em" type="text"<%=attr("name", cbid .. ".newzone") .. ifattr(not selected, "value", luci.http.formvalue(cbid .. ".newzone") or self.default)%> onfocus="document.getElementById('<%=cbid%>_new').checked=true" />
+               <div onclick="document.getElementById('<%=cbid%>_new').checked=true" class="zonebadge" style="background-color:<%=fwm.zone.get_color()%>">
+                       <em><%:unspecified -or- create:%>&#160;</em>
+                       <input type="text"<%=attr("name", cbid .. ".newzone") .. ifattr(not selected, "value", luci.http.formvalue(cbid .. ".newzone") or self.default)%> onfocus="document.getElementById('<%=cbid%>_new').checked=true" />
                </div>
        </li>
        <% end %>
                </div>
        </li>
        <% end %>