mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Update to latest luci-base and luci-mod-admin-full
This commit is contained in:
parent
613042b0a0
commit
b218a47995
17 changed files with 2882 additions and 221 deletions
42
luci-base/luasrc/view/cbi/dropdown.htm
Normal file
42
luci-base/luasrc/view/cbi/dropdown.htm
Normal file
|
@ -0,0 +1,42 @@
|
|||
<%+cbi/valueheader%>
|
||||
|
||||
<%-
|
||||
local selected = { }
|
||||
|
||||
if self.multiple then
|
||||
local val
|
||||
for val in luci.util.imatch(self:cfgvalue(section)) do
|
||||
selected[val] = true
|
||||
end
|
||||
else
|
||||
selected[self:cfgvalue(section)] = true
|
||||
end
|
||||
|
||||
if not next(selected) and self.default then
|
||||
selected[self.default] = true
|
||||
end
|
||||
-%>
|
||||
|
||||
<div class="cbi-dropdown"<%=
|
||||
attr("name", cbid) ..
|
||||
attr("display-items", self.display or self.size or 3) ..
|
||||
attr("dropdown-items", self.dropdown or self.display or self.size or 5) ..
|
||||
attr("placeholder", self.placeholder or translate("-- please select --")) ..
|
||||
ifattr(self.multiple, "multiple", "multiple") ..
|
||||
ifattr(self.optional or self.rmempty, "optional", "optional")
|
||||
%>>
|
||||
<ul>
|
||||
<% local i, key; for i, key in pairs(self.keylist) do %>
|
||||
<li<%=
|
||||
attr("data-index", i) ..
|
||||
attr("data-depends", self:deplist2json(section, self.deplist[i])) ..
|
||||
attr("value", key) ..
|
||||
ifattr(selected[key], "selected", "selected")
|
||||
%>>
|
||||
<%=pcdata(self.vallist[i])%>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<%+cbi/valuefooter%>
|
Loading…
Add table
Add a link
Reference in a new issue