dynlist.htm 799 B

123456789101112131415161718192021222324252627
  1. <%+cbi/valueheader%>
  2. <div<%=
  3. attr("data-prefix", cbid) ..
  4. attr("data-browser-path", self.default_path) ..
  5. attr("data-dynlist", luci.util.serialize_json({
  6. self.keylist, self.vallist,
  7. self.datatype, self.optional or self.rmempty
  8. })) ..
  9. ifattr(self.size, "data-size", self.size) ..
  10. ifattr(self.placeholder, "data-placeholder", self.placeholder)
  11. %>>
  12. <%
  13. local vals = self:cfgvalue(section) or {}
  14. for i=1, #vals + 1 do
  15. local val = vals[i]
  16. if (val and #val > 0) or (i == 1) then
  17. %>
  18. <input class="cbi-input-text" value="<%=pcdata(val)%>" data-update="change" type="text"<%=
  19. attr("id", cbid .. "." .. i) ..
  20. attr("name", cbid) ..
  21. ifattr(self.size, "size") ..
  22. ifattr(i == 1 and self.placeholder, "placeholder", self.placeholder)
  23. %> /><br />
  24. <% end end %>
  25. </div>
  26. <%+cbi/valuefooter%>