diff options
author | Steven Barth <steven@midlink.org> | 2008-03-20 20:33:43 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-03-20 20:33:43 +0000 |
commit | e9461f898cdd8f740accdf8c0c99dd1cfe48d1ea (patch) | |
tree | 93ad322e9d329303377c4924e9a1c222714e7525 /src/ffluci/view | |
parent | e8b87fffb9ec6654eeb82c49e49ca9491ff4299c (diff) |
* CBI updates
Diffstat (limited to 'src/ffluci/view')
-rw-r--r-- | src/ffluci/view/cbi/lvalue.htm | 11 | ||||
-rw-r--r-- | src/ffluci/view/cbi/map.htm | 8 | ||||
-rw-r--r-- | src/ffluci/view/cbi/nsection.htm | 8 | ||||
-rw-r--r-- | src/ffluci/view/cbi/tsection.htm | 13 | ||||
-rw-r--r-- | src/ffluci/view/cbi/value.htm | 7 |
5 files changed, 32 insertions, 15 deletions
diff --git a/src/ffluci/view/cbi/lvalue.htm b/src/ffluci/view/cbi/lvalue.htm new file mode 100644 index 0000000000..b7db0def96 --- /dev/null +++ b/src/ffluci/view/cbi/lvalue.htm @@ -0,0 +1,11 @@ +<div class="cbi-lvalue"> +<div class="cbi-lvalue-title"><%=self.title%></div> +<div class="cbi-lvalue-field"> +<select name="<%=self.map.config.."."..self.section.."."..self.option%>"> +<%for k, v in self.list do%> +<option value="<%=k%>"><%=v%></option> +<% end %> +</select> +</div> +<div class="cbi-value-description"><%=self.description%></div> +</div>
\ No newline at end of file diff --git a/src/ffluci/view/cbi/map.htm b/src/ffluci/view/cbi/map.htm index 918e455d75..e4f493bd09 100644 --- a/src/ffluci/view/cbi/map.htm +++ b/src/ffluci/view/cbi/map.htm @@ -1,7 +1,7 @@ -<div class="cbi-map" id="cbi-<%=config%>"> +<div class="cbi-map" id="cbi-<%=self.config%>"> <form method="post" action="<%=os.getenv("REQUEST_URI")%>"> -<h1><%=title%></h1> -<div class="cbi-map-descr"><%=description%></div> -<% for k, node in ipairs(children) do node:render() end %> +<h1><%=self.title%></h1> +<div class="cbi-map-descr"><%=self.description%></div> +<% for k, node in ipairs(self.children) do node:render() end %> </form> </div> diff --git a/src/ffluci/view/cbi/nsection.htm b/src/ffluci/view/cbi/nsection.htm index 4a47c7dad4..4607a872cc 100644 --- a/src/ffluci/view/cbi/nsection.htm +++ b/src/ffluci/view/cbi/nsection.htm @@ -1,5 +1,5 @@ -<div class="cbi-nsection" id="cbi-<%=map.config%>-<%=sectiontype%>-<%=section%>"> -<h2><%=title%></h2> -<div class="cbi-nsection-descr"><%=description%></div> -<% for k, node in ipairs(children) do node:render() end %> +<div class="cbi-nsection" id="cbi-<%=self.map.config%>-<%=self.sectiontype%>-<%=self.section%>"> +<h2><%=self.title%></h2> +<div class="cbi-nsection-descr"><%=self.description%></div> +<% for k, node in ipairs(self.children) do node:render() end %> </div> diff --git a/src/ffluci/view/cbi/tsection.htm b/src/ffluci/view/cbi/tsection.htm index 2c25500f8a..420bfd14a8 100644 --- a/src/ffluci/view/cbi/tsection.htm +++ b/src/ffluci/view/cbi/tsection.htm @@ -1,6 +1,5 @@ <% -require("ffluci.model.uci") -local allsections = ffluci.model.uci.show(map) +local allsections = self.map:read() local sections = {} for k, v in pairs(allsections) do if v[".type"] == sectiontype then @@ -8,12 +7,12 @@ for k, v in pairs(allsections) do end end %> -<div class="cbi-tsection" id="cbi-<%=map%>-<%=sectiontype%>"> -<h2><%=title%></h2> -<div class="cbi-tsection-descr"><%=description%></div> +<div class="cbi-tsection" id="cbi-<%=self.map.config%>-<%=self.sectiontype%>"> +<h2><%=self.title%></h2> +<div class="cbi-tsection-descr"><%=self.description%></div> <% for k, v in pairs(sections) do %> -<div class="cbi-tsection-node" id="cbi-<%=map%>-<%=k%>"> -<% for k, node in ipairs(children) do +<div class="cbi-tsection-node" id="cbi-<%=self.map.config%>-<%=k%>"> +<% for k, node in ipairs(self.children) do node.section = k node:render(k) end %> diff --git a/src/ffluci/view/cbi/value.htm b/src/ffluci/view/cbi/value.htm new file mode 100644 index 0000000000..a39010ac8d --- /dev/null +++ b/src/ffluci/view/cbi/value.htm @@ -0,0 +1,7 @@ +<div class="cbi-value"> +<div class="cbi-value-title"><%=self.title%></div> +<div class="cbi-value-field"> +<input type="text" name="<%=self.map.config.."."..self.section.."."..self.option%>" value="<%=self:ucivalue()%>" /> +</div> +<div class="cbi-value-description"><%=self.description%></div> +</div>
\ No newline at end of file |