* CBI: Generalized templates
[project/luci.git] / src / ffluci / view / cbi / tsection.htm
index 8c7f0c1151853f86113b537aeb0d322206ed5b58..012ae063a8052479f4b6a565aba0149e5c27ee56 100644 (file)
@@ -1,21 +1,21 @@
-<%
-local allsections = self.map:read()
-local sections = {}
-for k, v in pairs(allsections) do
-       if v[".type"] == sectiontype then
-               sections[k] = v
-       end
-end 
-%>
-<div class="cbi-tsection" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
-<h2><%=self.title%></h2>
-<div class="cbi-tsection-descr"><%=self.description%></div>
-<% for k, v in pairs(sections) do %>
-<div class="cbi-tsection-node" id="cbi-<%=self.config%>-<%=k%>">
-<% for k, node in ipairs(self.children) do
-       node.section = k
-       node:render(k)
-end %>
-</div>
+                               <div class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
+                                       <h2><%=self.title%></h2>
+                                       <div class="cbi-section-descr"><%=self.description%></div>
+<% for k, v in pairs(self:cfgsections()) do%>
+                                               <% if self.addremove then %><div class="cbi-section-remove right">
+                                                       <input type="submit" name="cbi.rts.<%=self.config%>.<%=k%>" value="<%:cbi_del Eintrag entfernen%>" />
+                                               </div><% end %>
+                                               <% if not self.anonymous then %><h3><%=k%></h3><% end %>
+<% section = k %>
+<%+cbi/ucisection%>
 <% end %>
-</div>
+<% if self.addremove then %>
+                                       <div class="cbi-section-create">
+                                               <% if self.anonymous then %>
+                                               <input type="submit" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>" value="<%:cbi_add Eintrag hinzufügen%>" />
+                                               <% else %><input type="text" class="cbi-section-create-name" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>" />
+                                               <input type="submit" value="<%:cbi_add Eintrag hinzufügen%>" />
+                                               <% end %><% if self.err_invalid then %><div class="cbi-error"><%:cbi_invalid Fehler: Ungültige Eingabe%></div><% end %>
+                                       </div>
+<% end %>
+                               </div>