From 5f9910566de7165f4bb0ee62bc3ace53c708a94e Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Tue, 25 Mar 2008 23:34:21 +0000 Subject: * Entering Version 0.2 * Completed CBI * Minor bugfixes and enhancements --- src/ffluci/view/cbi/fvalue.htm | 10 ++++++++++ src/ffluci/view/cbi/header.htm | 1 + src/ffluci/view/cbi/lvalue.htm | 26 +++++++++++++++++++------- src/ffluci/view/cbi/mvalue.htm | 26 ++++++++++++++++++++++++++ src/ffluci/view/cbi/nsection.htm | 37 ++++++++++++++++++++++++++++++++----- src/ffluci/view/cbi/tsection.htm | 28 ++++++++++++++++++++++------ src/ffluci/view/cbi/value.htm | 11 +++++++---- 7 files changed, 117 insertions(+), 22 deletions(-) create mode 100644 src/ffluci/view/cbi/fvalue.htm create mode 100644 src/ffluci/view/cbi/mvalue.htm (limited to 'src/ffluci/view') diff --git a/src/ffluci/view/cbi/fvalue.htm b/src/ffluci/view/cbi/fvalue.htm new file mode 100644 index 0000000000..8c8a2dfba0 --- /dev/null +++ b/src/ffluci/view/cbi/fvalue.htm @@ -0,0 +1,10 @@ +
+
+
<%=self.title%>
+
<%=self.description%>
+
+
+ "<% if self:ucivalue(section) == self.enabled then %> checked="checked"<% end %> value="1" /> +
+
+
\ No newline at end of file diff --git a/src/ffluci/view/cbi/header.htm b/src/ffluci/view/cbi/header.htm index b11ed3b708..2731b6c2f5 100644 --- a/src/ffluci/view/cbi/header.htm +++ b/src/ffluci/view/cbi/header.htm @@ -1,3 +1,4 @@ <%+header%>
"> + diff --git a/src/ffluci/view/cbi/lvalue.htm b/src/ffluci/view/cbi/lvalue.htm index 739d675c43..abe5080174 100644 --- a/src/ffluci/view/cbi/lvalue.htm +++ b/src/ffluci/view/cbi/lvalue.htm @@ -1,11 +1,23 @@ -
-
<%=self.title%>
-
- "<% if self.size then %> size="<%=self.size%>"<% end %>> +<%for i, key in pairs(self.keylist) do%> + selected="selected"<% end %> value="<%=key%>"><%=self.vallist[i]%> <% end %> +<% elseif self.widget == "radio" then + local c = 0; + for i, key in pairs(self.keylist) do + c = c + 1%> + <%=self.vallist[i]%>"<% if self:ucivalue(section) == key then %> checked="checked"<% end %> value="<%=key%>" /> +<% if c == self.size then c = 0 %>
+<% end end %> +<% end %>
-
<%=self.description%>
+
\ No newline at end of file diff --git a/src/ffluci/view/cbi/mvalue.htm b/src/ffluci/view/cbi/mvalue.htm new file mode 100644 index 0000000000..de7bd0c61d --- /dev/null +++ b/src/ffluci/view/cbi/mvalue.htm @@ -0,0 +1,26 @@ +<% +local v = self:valuelist(section) +%> +
+
+
<%=self.title%>
+
<%=self.description%>
+
+
+<% if self.widget == "select" then %> + +<% elseif self.widget == "checkbox" then + local c = 0; + for i, key in pairs(self.keylist) do + c = c + 1%> + <%=self.vallist[i]%>[]"<% if ffluci.util.contains(v, key) then %> checked="checked"<% end %> value="<%=key%>" /> +<% if c == self.size then c = 0 %>
+<% end end %> +<% end %> +
+
+
\ No newline at end of file diff --git a/src/ffluci/view/cbi/nsection.htm b/src/ffluci/view/cbi/nsection.htm index 84f893d2b8..80dcefc07c 100644 --- a/src/ffluci/view/cbi/nsection.htm +++ b/src/ffluci/view/cbi/nsection.htm @@ -1,7 +1,34 @@ -
+<% if self:ucivalue(self.section) then %> +

<%=self.title%>

-
<%=self.description%>
-
-<% self:render_children() %> -
+
<%=self.description%>
+
+<% self:render_children(self.section) %> + <% if #self.optionals > 0 or self.dynamic then %> +
+ <% if self.dynamic then %> + + <% else %> + + <% end %> + +
+ <% end %> +
+ <% if self.addremove then %> + + <% end %> +
+<% elseif self.addremove then %> +
+

<%=self.title%>

+
<%=self.description%>
+ +
+<% end %> diff --git a/src/ffluci/view/cbi/tsection.htm b/src/ffluci/view/cbi/tsection.htm index 987449406e..26f8b198e8 100644 --- a/src/ffluci/view/cbi/tsection.htm +++ b/src/ffluci/view/cbi/tsection.htm @@ -1,10 +1,26 @@ -
+

<%=self.title%>

-
<%=self.description%>
+
<%=self.description%>
<% for k, v in pairs(self:ucisections()) do%> -
+
<% if not self.anonymous then %><%=k%><% end %> <% self:render_children(k) %> + <% if #self.optionals > 0 or self.dynamic then %> +
+ <% if self.dynamic then %> + + <% else %> + + <% end %> + +
+ <% end %> +
<% if self.addremove then %> <% end %> @@ -12,12 +28,12 @@
<% end %> <% if self.addremove then %> -
+
<% if self.anonymous then %> - <% else %> + <% else %> - <% end %><% if self.err_invalid then %>
<%:cbi_invalid Fehler: Ungültiger Wert%>
<% end %> + <% end %><% if self.err_invalid then %>
<%:cbi_invalid Fehler: Ungültige Eingabe%>
<% end %>
<% end %>
diff --git a/src/ffluci/view/cbi/value.htm b/src/ffluci/view/cbi/value.htm index bbb5f5f3b5..54ca720d90 100644 --- a/src/ffluci/view/cbi/value.htm +++ b/src/ffluci/view/cbi/value.htm @@ -1,8 +1,11 @@
-
<%=self.title%>
+
+
<%=self.title%>
+
<%=self.description%>
+
- size="<%=self.size%>" <% end %><% if self.maxlength then %>maxlength="<%=self.maxlength%>" <% end %>name="cbid.<%=self.config.."."..self.section.."."..self.option%>" value="<%=(self:ucivalue() or "")%>" /> + size="<%=self.size%>" <% end %><% if self.maxlength then %>maxlength="<%=self.maxlength%>" <% end %>name="cbid.<%=self.config.."."..section.."."..self.option%>" value="<%=(self:ucivalue(section) or "")%>" />
-
<%=self.description%>
- <% if self.err_invalid then %>
<%:cbi_invalid Fehler: Ungültiger Wert%>
<% end %> +
+ <% if self.tag_invalid[section] then %>
<%:cbi_invalid Fehler: Ungültige Eingabe%>
<% end %>
\ No newline at end of file -- cgit v1.2.3