libs/cbi: attach pcdata() to template scope and use it
[project/luci.git] / libs / cbi / luasrc / view / cbi / tsection.htm
index a81715b..db723f9 100644 (file)
@@ -41,17 +41,19 @@ $Id$
        <%- end %>
 
        <% if self.addremove then -%>
+               <% if self.template_addremove then include(self.template_addremove) else -%>
                <div class="cbi-section-create">
                        <% if self.anonymous then -%>
                                <input type="submit" class="cbi-button cbi-button-add" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>" value="<%:cbi_add%>" />
                        <%- else -%>
+                               <% if self.invalid_cts then -%><div class="cbi-section-error"><% end %>
                                <input type="text" class="cbi-section-create-name" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>" />
                                <input type="submit" class="cbi-button cbi-button-add" value="<%:cbi_add%>" />
-                       <%- end %>
-
-                       <% if self.err_invalid then -%>
-                               <div class="cbi-error"><%:cbi_invalid%></div>
+                               <% if self.invalid_cts then -%>
+                                       <br /><%:cbi_invalid%></div>
+                               <%- end %>
                        <%- end %>
                </div>
+               <%- end %>
        <%- end %>
 </fieldset>