943a18886a7949df13491793a9bb16572a3034e3
[project/luci.git] / src / ffluci / view / cbi / lvalue.htm
1 <div class="cbi-value" id="cbi-<%=self.config.."-"..section.."-"..self.option%>">
2 <div class="cbi-value-title left"><%=self.title%></div>
3 <div class="cbi-value-field">
4 <% if self.widget == "select" then %>
5 <select onchange="cbi_d_update(this.id)" id="cbid.<%=self.config.."."..section.."."..self.option%>" name="cbid.<%=self.config.."."..section.."."..self.option%>"<% if self.size then %> size="<%=self.size%>"<% end %>>
6 <%for i, key in pairs(self.keylist) do%>
7 <option<% if self:cfgvalue(section) == key then %> selected="selected"<% end %> value="<%=key%>"><%=self.vallist[i]%></option>
8 <% end %>
9 </select>
10 <% elseif self.widget == "radio" then
11 local c = 0;
12 for i, key in pairs(self.keylist) do
13 c = c + 1%>
14 <%=self.vallist[i]%><input type="radio" name="cbid.<%=self.config.."."..section.."."..self.option%>"<% if self:cfgvalue(section) == key then %> checked="checked"<% end %> value="<%=key%>" />
15 <% if c == self.size then c = 0 %><br />
16 <% end end %>
17 <% end %>
18 <div class="cbi-value-description inline"><%=self.description%></div>
19 </div>
20 </div>
21 <% if #self.deps > 0 then %><script type="text/javascript">
22 <% for j, d in ipairs(self.deps) do %>cbi_d_add("cbi-<%=self.config.."-"..section.."-"..self.option%>", "cbid.<%=self.config.."."..section.."."..d.field%>", "<%=d.value%>");
23 <% end %>
24 </script><% end %>