libs/cbi: fix formatting issue in zone picker widget

This commit is contained in:
Jo-Philipp Wich 2009-11-01 19:49:07 +00:00
parent 76597985ed
commit a60f781bdf

View file

@ -48,10 +48,12 @@ $Id$
<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()%>; padding:0.5em">
<strong><%=zone:name()%>:</strong> <strong><%=zone:name()%>:</strong>
<% <%
local empty = true local zempty = true
for _, net in ipairs(zone:get_networks()) do for _, net in ipairs(zone:get_networks()) do
net = nwm:get_network(net) net = nwm:get_network(net)
zempty = false
if net then if net then
local nempty = true
%> %>
&nbsp; &nbsp;
<%- if net:name() == self.network then -%> <%- if net:name() == self.network then -%>
@ -62,13 +64,14 @@ $Id$
<% <%
for _, iface in ipairs(net and net:get_interfaces() or {}) do for _, iface in ipairs(net and net:get_interfaces() or {}) do
if not iface:is_bridgeport() then if not iface:is_bridgeport() then
empty = false nempty = false
%> %>
<img<%=attr("title", iface:get_i18n())%> style="width:16px; height:16px; vertical-align:middle" src="<%=resource%>/icons/<%=iface:type()%><%=iface:is_up() and "" or "_disabled"%>.png" /> <img<%=attr("title", iface:get_i18n())%> style="width:16px; height:16px; vertical-align:middle" src="<%=resource%>/icons/<%=iface:type()%><%=iface:is_up() and "" or "_disabled"%>.png" />
<% end end %> <% end end %>
<% if nempty then %><em><%:(no interfaces attached)%></em><% end %>
</span> </span>
<% end end %> <% end end %>
<% if empty then %><em><%:(no interfaces attached)%></em><% end %> <% if zempty then %><em><%:(no interfaces attached)%></em><% end %>
</label> </label>
</li> </li>
<% end end %> <% end end %>