547a793329489614e2bb62c3b91f7c08befc34d2
[librecmc/librecmc.git] / package / luci / modules / luci-base / luasrc / view / cbi / tsection.htm
1 <div class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
2         <% if self.title and #self.title > 0 then -%>
3                 <legend><%=self.title%></legend>
4         <%- end %>
5         <% if self.description and #self.description > 0 then -%>
6                 <div class="cbi-section-descr"><%=self.description%></div>
7         <%- end %>
8         <% local isempty = true for i, k in ipairs(self:cfgsections()) do -%>
9                 <% if self.addremove then -%>
10                         <div class="cbi-section-remove right">
11                                 <input type="submit" name="cbi.rts.<%=self.config%>.<%=k%>" onclick="this.form.cbi_state='del-section'; return true" value="<%:Delete%>" class="cbi-button" />
12                         </div>
13                 <%- end %>
14
15                 <%- section = k; isempty = false -%>
16
17                 <% if not self.anonymous then -%>
18                         <h3><%=section:upper()%></h3>
19                 <%- end %>
20
21                 <div class="cbi-section-node<% if self.tabs then %> cbi-section-node-tabbed<% end %>" id="cbi-<%=self.config%>-<%=section%>">
22                         <%+cbi/ucisection%>
23                 </div>
24         <%- end %>
25
26         <% if isempty then -%>
27                 <em><%:This section contains no values yet%><br /><br /></em>
28         <%- end %>
29
30         <% if self.addremove then -%>
31                 <% if self.template_addremove then include(self.template_addremove) else -%>
32                 <div class="cbi-section-create">
33                         <% if self.anonymous then -%>
34                                 <input type="submit" class="cbi-button cbi-button-add" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" value="<%:Add%>" />
35                         <%- else -%>
36                                 <% if self.invalid_cts then -%>
37                                         <div class="cbi-section-error"><%:Invalid%></div>
38                                 <%- end %>
39                                 <div>
40                                         <input type="text" class="cbi-section-create-name" id="cbi.cts.<%=self.config%>.<%=self.sectiontype%>." name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>." data-type="uciname" data-optional="true" />
41                                 </div>
42                                 <input class="cbi-button cbi-button-add" type="submit" onclick="this.form.cbi_state='add-section'; return true" value="<%:Add%>" title="<%:Add%>" />
43                         <%- end %>
44                 </div>
45                 <%- end %>
46         <%- end %>
47 </div>