* luci/themes: several small tweaks in openwrt.org theme
* luci/libs/cbi: some template improvements
This commit is contained in:
parent
94a968e62f
commit
4e587d53a8
7 changed files with 81 additions and 54 deletions
|
@ -14,8 +14,10 @@ $Id$
|
||||||
-%>
|
-%>
|
||||||
|
|
||||||
<% if self:cfgvalue(self.section) then section = self.section %>
|
<% if self:cfgvalue(self.section) then section = self.section %>
|
||||||
<div class="cbi-section" id="cbi-<%=self.config%>-<%=section%>">
|
<fieldset class="cbi-section" id="cbi-<%=self.config%>-<%=section%>">
|
||||||
<h2><%=self.title%></h2>
|
<% if self.title and #self.title > 0 then -%>
|
||||||
|
<legend><%=self.title%></legend>
|
||||||
|
<%- end %>
|
||||||
<div class="cbi-section-descr"><%=self.description%></div>
|
<div class="cbi-section-descr"><%=self.description%></div>
|
||||||
<% if self.addremove then -%>
|
<% if self.addremove then -%>
|
||||||
<div class="cbi-section-remove right">
|
<div class="cbi-section-remove right">
|
||||||
|
@ -26,11 +28,14 @@ $Id$
|
||||||
<%+cbi/ucisection%>
|
<%+cbi/ucisection%>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
</div>
|
</fieldset>
|
||||||
<% elseif self.addremove then %>
|
<% elseif self.addremove then %>
|
||||||
<div class="cbi-section" id="cbi-<%=self.config%>-<%=self.section%>">
|
<fieldset class="cbi-section" id="cbi-<%=self.config%>-<%=self.section%>">
|
||||||
<h2><%=self.title%></h2>
|
<% if self.title and #self.title > 0 then -%>
|
||||||
|
<legend><%=self.title%></legend>
|
||||||
|
<%- end %>
|
||||||
<div class="cbi-section-descr"><%=self.description%></div>
|
<div class="cbi-section-descr"><%=self.description%></div>
|
||||||
<input type="submit" name="cbi.cns.<%=self.config%>.<%=self.section%>" value="<%:cbi_add%>" />
|
<input type="submit" name="cbi.cns.<%=self.config%>.<%=self.section%>" value="<%:cbi_add%>" />
|
||||||
</div>
|
</fieldset>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<!-- /nsection -->
|
||||||
|
|
|
@ -13,6 +13,7 @@ $Id$
|
||||||
|
|
||||||
-%>
|
-%>
|
||||||
|
|
||||||
|
<!-- tblsection -->
|
||||||
<div class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
|
<div class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
|
||||||
<h2><%=self.title%></h2>
|
<h2><%=self.title%></h2>
|
||||||
<div class="cbi-section-descr"><%=self.description%></div>
|
<div class="cbi-section-descr"><%=self.description%></div>
|
||||||
|
@ -35,8 +36,6 @@ $Id$
|
||||||
</tr>
|
</tr>
|
||||||
<%- local isempty = true
|
<%- local isempty = true
|
||||||
for i, k in ipairs(self:cfgsections()) do
|
for i, k in ipairs(self:cfgsections()) do
|
||||||
isempty = false
|
|
||||||
|
|
||||||
if not self.anonymous then
|
if not self.anonymous then
|
||||||
-%>
|
-%>
|
||||||
<tr class="cbi-section-table-title">
|
<tr class="cbi-section-table-title">
|
||||||
|
@ -44,6 +43,7 @@ $Id$
|
||||||
</tr>
|
</tr>
|
||||||
<%- end
|
<%- end
|
||||||
section = k
|
section = k
|
||||||
|
isempty = false
|
||||||
scope = { valueheader = "cbi/cell_valueheader", valuefooter = "cbi/cell_valuefooter" }
|
scope = { valueheader = "cbi/cell_valueheader", valuefooter = "cbi/cell_valuefooter" }
|
||||||
-%>
|
-%>
|
||||||
<tr class="cbi-section-table-row" id="cbi-<%=self.config%>-<%=section%>">
|
<tr class="cbi-section-table-row" id="cbi-<%=self.config%>-<%=section%>">
|
||||||
|
@ -58,7 +58,7 @@ $Id$
|
||||||
|
|
||||||
<%- if isempty then -%>
|
<%- if isempty then -%>
|
||||||
<tr class="cbi-section-table-row">
|
<tr class="cbi-section-table-row">
|
||||||
<td colspan="<%=count%>"><em><%:cbi_sectempty%></em></td>
|
<td colspan="<%=count%>"><em><br /><%:cbi_sectempty%></em></td>
|
||||||
</tr>
|
</tr>
|
||||||
<%- end -%>
|
<%- end -%>
|
||||||
|
|
||||||
|
@ -83,3 +83,4 @@ $Id$
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- /tblsection -->
|
||||||
|
|
|
@ -13,35 +13,45 @@ $Id$
|
||||||
|
|
||||||
-%>
|
-%>
|
||||||
|
|
||||||
<div class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
|
<fieldset class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
|
||||||
<h2><%=self.title%></h2>
|
<% if self.title and #self.title > 0 then -%>
|
||||||
|
<legend><%=self.title%></legend>
|
||||||
|
<%- end %>
|
||||||
<div class="cbi-section-descr"><%=self.description%></div>
|
<div class="cbi-section-descr"><%=self.description%></div>
|
||||||
<% for i, k in ipairs(self:cfgsections()) do -%>
|
<% local isempty = true for i, k in ipairs(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%>" />
|
|
||||||
</div>
|
|
||||||
<%- end %>
|
|
||||||
<% if not self.anonymous then %><h3><%=k%></h3><% end %>
|
|
||||||
<% section = k %>
|
|
||||||
<div class="cbi-section-node" id="cbi-<%=self.config%>-<%=section%>">
|
|
||||||
<%+cbi/ucisection%>
|
|
||||||
</div>
|
|
||||||
<br />
|
|
||||||
<%- end %>
|
|
||||||
|
|
||||||
<% if self.addremove then -%>
|
<% if self.addremove then -%>
|
||||||
<div class="cbi-section-create">
|
<div class="cbi-section-remove right">
|
||||||
<% if self.anonymous then -%>
|
<input type="submit" name="cbi.rts.<%=self.config%>.<%=k%>" value="<%:cbi_del%>" />
|
||||||
<input type="submit" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>" value="<%:cbi_add%>" />
|
|
||||||
<%- else -%>
|
|
||||||
<input type="text" class="cbi-section-create-name" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>" />
|
|
||||||
<input type="submit" value="<%:cbi_add%>" />
|
|
||||||
<%- end %>
|
|
||||||
|
|
||||||
<% if self.err_invalid then -%>
|
|
||||||
<div class="cbi-error"><%:cbi_invalid%></div>
|
|
||||||
<%- end %>
|
|
||||||
</div>
|
</div>
|
||||||
<%- end %>
|
<%- end %>
|
||||||
</div>
|
<% section = k; isempty = false %>
|
||||||
|
|
||||||
|
<% if not self.anonymous then -%>
|
||||||
|
<h3><%=k:upper()%></h3>
|
||||||
|
<%- end %>
|
||||||
|
|
||||||
|
<fieldset class="cbi-section-node" id="cbi-<%=self.config%>-<%=section%>">
|
||||||
|
<%+cbi/ucisection%>
|
||||||
|
</fieldset>
|
||||||
|
<br />
|
||||||
|
<%- end %>
|
||||||
|
|
||||||
|
<% if isempty then -%>
|
||||||
|
<em><%:cbi_sectempty%><br /><br /></em>
|
||||||
|
<%- end %>
|
||||||
|
|
||||||
|
<% 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%>" />
|
||||||
|
<%- else -%>
|
||||||
|
<input type="text" class="cbi-section-create-name" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>" />
|
||||||
|
<input type="submit" value="<%:cbi_add%>" />
|
||||||
|
<%- end %>
|
||||||
|
|
||||||
|
<% if self.err_invalid then -%>
|
||||||
|
<div class="cbi-error"><%:cbi_invalid%></div>
|
||||||
|
<%- end %>
|
||||||
|
</div>
|
||||||
|
<%- end %>
|
||||||
|
</fieldset>
|
||||||
|
|
|
@ -22,9 +22,9 @@ $Id$
|
||||||
<% else %>
|
<% else %>
|
||||||
<select name="cbi.opt.<%=self.config%>.<%=section%>">
|
<select name="cbi.opt.<%=self.config%>.<%=section%>">
|
||||||
<option><%:cbi_addopt%></option>
|
<option><%:cbi_addopt%></option>
|
||||||
<% for key, val in pairs(self.optionals[section]) do %>
|
<% for key, val in pairs(self.optionals[section]) do -%>
|
||||||
<option id="cbi-<%=self.config.."-"..section.."-"..val.option%>" value="<%=val.option%>"><%=val.title%></option>
|
<option id="cbi-<%=self.config.."-"..section.."-"..val.option%>" value="<%=val.option%>"><%=val.title%></option>
|
||||||
<% end %>
|
<%- end %>
|
||||||
</select>
|
</select>
|
||||||
<script type="text/javascript"><% for key, val in pairs(self.optionals[section]) do %>
|
<script type="text/javascript"><% for key, val in pairs(self.optionals[section]) do %>
|
||||||
<% if #val.deps > 0 then %><% for j, d in ipairs(val.deps) do %>cbi_d_add("cbi-<%=self.config.."-"..section.."-"..val.option%>", "cbid.<%=self.config.."."..section.."."..d.field%>", "<%=d.value%>");
|
<% if #val.deps > 0 then %><% for j, d in ipairs(val.deps) do %>cbi_d_add("cbi-<%=self.config.."-"..section.."-"..val.option%>", "cbid.<%=self.config.."."..section.."."..d.field%>", "<%=d.value%>");
|
||||||
|
|
|
@ -12,8 +12,5 @@ You may obtain a copy of the License at
|
||||||
$Id$
|
$Id$
|
||||||
|
|
||||||
-%>
|
-%>
|
||||||
<% if valuefooter then
|
|
||||||
include(valuefooter)
|
<% include( valuefooter or "cbi/full_valuefooter" ) %>
|
||||||
else
|
|
||||||
include("cbi/full_valuefooter")
|
|
||||||
end %>
|
|
||||||
|
|
|
@ -12,8 +12,5 @@ You may obtain a copy of the License at
|
||||||
$Id$
|
$Id$
|
||||||
|
|
||||||
-%>
|
-%>
|
||||||
<% if valueheader then
|
|
||||||
include(valueheader)
|
<% include( valueheader or "cbi/full_valueheader" ) %>
|
||||||
else
|
|
||||||
include("cbi/full_valueheader")
|
|
||||||
end %>
|
|
||||||
|
|
|
@ -191,17 +191,27 @@ div#content ul {
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.cbi-section legend {
|
||||||
|
font-size: 110%;
|
||||||
|
font-weight: bold;
|
||||||
|
height: 1em;
|
||||||
|
padding: 0 0.25em;
|
||||||
|
color: #555555;
|
||||||
|
}
|
||||||
|
|
||||||
.cbi-section h2 {
|
.cbi-section h2 {
|
||||||
margin: 0em 0 0.5em -0.5em !important;
|
margin: 0em 0 0.5em -0.5em !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cbi-section h3 {
|
.cbi-section h3 {
|
||||||
height: 1em;
|
height: 1.5em;
|
||||||
font-size: 120%;
|
font-size: 90%;
|
||||||
|
color: #555555;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cbi-section-descr {
|
.cbi-section-descr {
|
||||||
margin-bottom: 0.5em;
|
margin-bottom: 0.5em;
|
||||||
|
font-size: 95%;
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type=submit],
|
input[type=submit],
|
||||||
|
@ -302,6 +312,14 @@ div.cbi-value-description {
|
||||||
font-size: 90%;
|
font-size: 90%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div.cbi-value-field > div.cbi-value-description {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.cbi-value:hover div.cbi-value-field > div.cbi-value-description {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
div.cbi-section-create {
|
div.cbi-section-create {
|
||||||
clear: left;
|
clear: left;
|
||||||
}
|
}
|
||||||
|
@ -324,7 +342,7 @@ div.cbi-section-remove input {
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.cbi-section-node {
|
.cbi-section-node {
|
||||||
clear: both;
|
clear: both;
|
||||||
border: 1px dotted #bbbbbb;
|
border: 1px dotted #bbbbbb;
|
||||||
padding-bottom: 0;
|
padding-bottom: 0;
|
||||||
|
@ -448,4 +466,3 @@ td.cbi-section-table-optionals {
|
||||||
* html div.cbi-value-description {
|
* html div.cbi-value-description {
|
||||||
margin-left: 40%;
|
margin-left: 40%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue