libs/cbi: attach pcdata() to template scope and use it
[project/luci.git] / libs / cbi / luasrc / view / cbi / tblsection.htm
index af62c53..99b5b97 100644 (file)
@@ -31,7 +31,11 @@ end
                <table class="cbi-section-table">
                        <tr class="cbi-section-table-titles">
                        <%- if not self.anonymous then -%>
-                               <th>&#160;</th>
+                               <%- if self.sectionhead then -%>
+                                       <th class="cbi-section-table-cell"><%=self.sectionhead%></th>
+                               <%- else -%>
+                                       <th>&#160;</th>
+                               <%- end -%>
                        <%- end -%>
                        <%- for i, k in pairs(self.children) do if not k.optional then -%>
                                <th class="cbi-section-table-cell">
@@ -45,7 +49,11 @@ end
                        </tr>
                        <tr class="cbi-section-table-descr">
                        <%- if not self.anonymous then -%>
-                               <th></th>
+                               <%- if self.sectiondesc then -%>
+                                       <th class="cbi-section-table-cell"><%=self.sectiondesc%></th>
+                               <%- else -%>
+                                       <th></th>
+                               <%- end -%>
                        <%- end -%>
                        <%- for i, k in pairs(self.children) do if not k.optional then -%>
                                <th class="cbi-section-table-cell"><%=k.description%></th>
@@ -101,14 +109,14 @@ end
                <% if self.error then %>
                        <div class="cbi-section-error">
                                <ul><% for _, c in pairs(self.error) do for _, e in ipairs(c) do -%>
-                                       <li><%=luci.util.pcdata(e):gsub("\n","<br />")%></li>
+                                       <li><%=pcdata(e):gsub("\n","<br />")%></li>
                                <%- end end %></ul>
                        </div>
                <% end %>
 
                <%- if self.addremove then -%>
                        <% if self.template_addremove then include(self.template_addremove) else -%>
-                       <div class="cbi-section-create">
+                       <div class="cbi-section-create cbi-tblsection-create">
                                <% if self.anonymous then %>
                                        <input class="cbi-button cbi-button-add" type="submit" value="<%:cbi_add%>" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>" title="<%:cbi_add%>" />
                                <% else %>