Netzwerkdienste von einem anderen externen Netzwerk aus erreichbar zu machen.]])
s = m:section(TypedSection, "portfw")
+s.template = "cbi/tblsection"
s.addremove = true
s.anonymous = true
-iface = s:option(ListValue, "iface", "Externes Interface")
+iface = s:option(ListValue, "iface", "Schnittstelle", "Externe Schnittstelle")
iface:value("")
for k,v in pairs(ffluci.sys.net.devices()) do
iface:value(v)
end
-- Render this node
-function Node.render(self)
- ffluci.template.render(self.template, {self=self})
+function Node.render(self, scope)
+ scope = scope or {}
+ scope.self = self
+
+ ffluci.template.render(self.template, scope)
end
-- Render the children
end
end
--- Render the children
-function TypedSection.render_children(self, section)
- for k, node in ipairs(self.children) do
- node:render(section)
- end
-end
-
-- Verifies scope of sections
function TypedSection.checkscope(self, section)
-- Check if we are not excluded
end
-- Render if this value exists or if it is mandatory
-function AbstractValue.render(self, s)
+function AbstractValue.render(self, s, scope)
if not self.optional or self:cfgvalue(s) or self:formcreated(s) then
- ffluci.template.render(self.template, {self=self, section=s})
+ scope = scope or {}
+ scope.section = s
+ Node.render(self, scope)
end
end
<% if self.addremove then %><div class="cbi-section-remove right">
<input type="submit" name="cbi.rns.<%=self.config%>.<%=section%>" value="<%:cbi_del Eintrag entfernen%>" />
</div><% end %>
+<div class="cbi-section-node" id="cbi-<%=self.config%>-<%=section%>">
<%+cbi/ucisection%>
+</div>
+<br />
</div>
<% elseif self.addremove then %>
<div class="cbi-section" id="cbi-<%=self.config%>-<%=self.section%>">
--- /dev/null
+ <div class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
+ <h2><%=self.title%></h2>
+ <div class="cbi-section-descr"><%=self.description%></div>
+ <div class="cbi-section-node">
+ <div class="cbi-section-row">
+<% for i, k in pairs(self.children) do %>
+ <div class="cbi-section-row-head"><%=k.title%></div>
+<% end %>
+ </div>
+ <div class="cbi-section-row">
+<% for i, k in pairs(self.children) do %>
+ <div class="cbi-section-row-descr"><%=k.description%></div>
+<% end %>
+ </div>
+<% for i, k in ipairs(self:cfgsections()) do%>
+ <% if not self.anonymous then %><h3 class="table-cell"><%=k%></h3><% end %>
+<%
+section = k
+scope = {valueheader = "cbi/tiny_valueheader", valuefooter = "cbi/tiny_valuefooter"}
+%>
+<div class="cbi-section-row" id="cbi-<%=self.config%>-<%=section%>">
+<%+cbi/ucisection%>
+ <% if self.addremove then %><div class="cbi-section-remove table-cell">
+ <input type="submit" name="cbi.rts.<%=self.config%>.<%=k%>" value="X" />
+ </div><% end %>
+</div>
+<% 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 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>
+ </div>
+<% end %>
+ </div>
</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 %>
<div class="cbi-section-create">
- <div class="cbi-section-node" id="cbi-<%=self.config%>-<%=section%>">
-<% self:render_children(section) %>
+<% self:render_children(section, scope or {}) %>
<% if #self.optionals[section] > 0 or self.dynamic then %>
<div class="cbi-optionals">
<% if self.dynamic then %>
<% end %>
<input type="submit" value="<%:add hinzufügen%>" />
</div>
- <% end %>
- </div>
- <br />
\ No newline at end of file
+ <% end %>
\ No newline at end of file
-<%
-if self.tiny then
- include("cbi/tiny_valuefooter")
+<% if valuefooter then
+ include(valuefooter)
else
include("cbi/full_valuefooter")
-end
-%>
\ No newline at end of file
+end %>
\ No newline at end of file
-<%
-if self.tiny then
- include("cbi/tiny_valueheader")
+<% if valueheader then
+ include(valueheader)
else
include("cbi/full_valueheader")
-end
-%>
\ No newline at end of file
+end %>
\ No newline at end of file
<head>
<link rel="stylesheet" type="text/css" href="<%=media%>/cascade.css" />
<link rel="stylesheet" type="text/css" href="<%=media%>/css/<%=req.category%>_<%=req.module%>.css" />
+ <link rel="stylesheet" type="text/css" href="<%=media%>/css/<%=req.category%>_<%=req.module%>_<%=req.action%>.css" />
<meta http-equiv="content-type" content="text/xhtml+xml; charset=utf-8" />
<meta http-equiv="content-script-type" content="text/javascript" />
<title>FFLuCI</title>
s = m:section(TypedSection, "route")
s.addremove = true
s.anonymous = true
+s.template = "cbi/tblsection"
iface = s:option(ListValue, "interface", "Schnittstelle")
for k, v in pairs(ffluci.model.uci.sections("network")) do
margin-top: 0%;
}
+.table {
+ display: table;
+}
+
+.table-row {
+ display: table-row;
+}
+
+.table-cell {
+ display: table-cell;
+}
+
.left {
float: left;
text-align: left;
display: inline;
}
-.table {
- display: table;
-}
-
-.table-cell {
- display: table-cell;
-}
-
-.table-row {
- display: table-row;
-}
-
.code {
background: #f7f7f7;
border: 1px solid #d7d7d7;
border: 1px solid #d7d7d7;
}
+.cbi-section-row {
+ display: table-row;
+}
+
+.cbi-section-row-head {
+ display: table-cell;
+ font-weight: bold;
+ padding: 0.25em;
+}
+
+.cbi-section-row-descr {
+ display: table-cell;
+ padding: 0.25em;
+ font-size: 0.8em;
+}
+
.cbi-section-node h3 {
margin-bottom: 0.5em;
}
.cbi-optionals {
margin-top: 1em;
+ display: table-cell;
}
.cbi-optionals option {