libs/web: prevent break between action buttons in tblsection template
[project/luci.git] / libs / web / luasrc / view / cbi / tblsection.htm
index c79d5a8..5f6381f 100644 (file)
@@ -1,17 +1,3 @@
-<%#
-LuCI - Lua Configuration Interface
-Copyright 2008 Steven Barth <steven@midlink.org>
-Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-
--%>
 <%-
 local rowcnt = 1
 function rowstyle()
@@ -56,7 +42,9 @@ end
                                        <%-=k.title-%>
                                <%- if k.titleref then -%></a><%- end -%>
                                </th>
-                       <%- count = count + 1; end; end; if self.extedit or self.addremove then -%>
+                       <%- count = count + 1; end; end; if self.sortable then -%>
+                               <th class="cbi-section-table-cell"><%:Sort%></th>
+                       <%- end; if self.extedit or self.addremove then -%>
                                <th class="cbi-section-table-cell">&#160;</th>
                        <%- count = count + 1; end -%>
                        </tr>
@@ -70,7 +58,9 @@ end
                        <%- end -%>
                        <%- for i, k in pairs(self.children) do if not k.optional then -%>
                                <th class="cbi-section-table-cell"<%=width(k)%>><%=k.description%></th>
-                       <%- end; end; if self.extedit or self.addremove then -%>
+                       <%- end; end; if self.sortable then -%>
+                               <th class="cbi-section-table-cell"></th>
+                       <%- end; if self.extedit or self.addremove then -%>
                                <th class="cbi-section-table-cell"></th>
                        <%- end -%>
                        </tr>
@@ -95,14 +85,14 @@ end
                                -%>
 
                                <%- if self.sortable then -%>
-                                       <td class="cbi-section-table-cell" style="width:50px">
+                                       <td class="cbi-section-table-cell" style="padding:3px; white-space:nowrap">
                                                <a href="#" onclick="return cbi_row_swap(this, true,  'cbi.sts.<%=self.config%>.<%=self.sectiontype%>')" title="<%:Move up%>"><img src="<%=resource%>/cbi/up.gif" alt="<%:Move up%>" /></a>
                                                <a href="#" onclick="return cbi_row_swap(this, false, 'cbi.sts.<%=self.config%>.<%=self.sectiontype%>')" title="<%:Move down%>"><img src="<%=resource%>/cbi/down.gif" alt="<%:Move down%>" /></a>
                                        </td>
                                <%- end -%>
 
                                <%- if self.extedit or self.addremove then -%>
-                                       <td class="cbi-section-table-cell" style="width:50px">
+                                       <td class="cbi-section-table-cell" style="padding:3px; white-space:nowrap">
                                                <%- if self.extedit then -%>
                                                        <a href="
                                                        <%- if type(self.extedit) == "string" then -%>
@@ -138,11 +128,11 @@ end
                        <% if self.template_addremove then include(self.template_addremove) else -%>
                        <div class="cbi-section-create cbi-tblsection-create">
                                <% if self.anonymous then %>
-                                       <input class="cbi-button cbi-button-add" type="submit" value="<%:Add%>" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>" title="<%:Add%>" />
+                                       <input class="cbi-button cbi-button-add" type="submit" value="<%:Add%>" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" title="<%:Add%>" />
                                <% else %>
                                        <% if self.invalid_cts then -%><div class="cbi-section-error"><% end %>
-                                       <input type="text" class="cbi-section-create-name" id="cbi.cts.<%=self.config%>.<%=self.sectiontype%>" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>" />
-                                       <script type="text/javascript">cbi_validate_field('cbi.cts.<%=self.config%>.<%=self.sectiontype%>', true, 'uciname');</script>
+                                       <input type="text" class="cbi-section-create-name" id="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" />
+                                       <script type="text/javascript">cbi_validate_field('cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>', true, 'uciname');</script>
                                        <input class="cbi-button cbi-button-add" type="submit" onclick="this.form.cbi_state='add-section'; return true" value="<%:Add%>" title="<%:Add%>" />
                                        <% if self.invalid_cts then -%>
                                                <br /><%:Invalid%></div>