* luci-0.8: merge template changes from trunk
[project/luci.git] / libs / cbi / luasrc / view / cbi / dynlist.htm
index 1368872d94fad65d99bd4f608a6238bda10b3bcc..a23a4ebcdf7cb9cc832f2159702f182243f4f0b1 100644 (file)
@@ -13,15 +13,16 @@ $Id$
 
 -%>
 <%+cbi/valueheader%>
-       local vals = self:cfgvalue(section)
+<%
+       local vals = self:cfgvalue(section) or {}
        for i=1, #vals + 1 do
                local val = vals[i]
 %>
-       <input onchange="cbi_d_update(this.id)" type="text"<%= attr("id", cbid .. "." .. i) .. attr("name", cbid) .. ifattr(val, "value") .. ifattr(self.size, "size")%> />
+       <input class="cbi-input-text" value="<%=val%>" onchange="cbi_d_update(this.id)" type="text"<%= attr("id", cbid .. "." .. i) .. attr("name", cbid) .. ifattr(self.size, "size")%> />
        <% if i <= #vals then %>
-               <input type="image" value="<%:cbi_del%>" name="cbi.rle.<%=section .. "." .. self.option .. "." i%>" alt="<%:cbi_del%>" title="<%:cbi_del%>" src="<%=resource%>/cbi/remove.gif" />
+               <input class="cbi-input-image" type="image" value="<%:cbi_del%>" name="cbi.rle.<%=section .. "." .. self.option .. "." .. i%>" alt="<%:cbi_del%>" title="<%:cbi_del%>" src="<%=resource%>/cbi/remove.gif" />
        <% else %>
-               <input type="image" value="<%:cbi_add%>" name="cbi.ale.<%=section .. "." .. self.option%>" alt="<%:cbi_add%>" title="<%:cbi_add%>" src="<%=resource%>/cbi/add.gif" />
+               <input class="cbi-input-image" type="image" value="<%:cbi_add%>" name="cbi.ale.<%=section .. "." .. self.option%>" alt="<%:cbi_add%>" title="<%:cbi_add%>" src="<%=resource%>/cbi/add.gif" />
        <% end %>
        <% if #self.keylist > 0 then -%>
                <script type="text/javascript">
@@ -29,7 +30,8 @@ $Id$
                        <%-
                                for i, k in ipairs(self.keylist) do
                        -%>
-                               <%-=string.format("%q", k) .. ":" .. string.format("%q", self.vallist[i])-%>,
+                               <%-=string.format("%q", k) .. ":" .. string.format("%q", self.vallist[i])-%>
+                               <%-if i<#self.keylist then-%>,<%-end-%>
                        <%-
                                end
                        -%>
@@ -38,7 +40,6 @@ $Id$
                        <%- end -%>', '<%:cbi_manual%>');
                </script>
        <% end -%>
-       <br />
 <% if i <= #vals then %><br />
 <% end end %>
 <%+cbi/valuefooter%>