From b8124f18f88fe11158eb122a1e362cfbd512cf4f Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Tue, 27 May 2008 08:14:24 +0000 Subject: * Separated the MVC-Webframework from core * Separated i18n from core to prepare translations --- web/src/view/cbi/dvalue.htm | 12 +++++++++++ web/src/view/cbi/footer.htm | 7 +++++++ web/src/view/cbi/full_valuefooter.htm | 8 +++++++ web/src/view/cbi/full_valueheader.htm | 3 +++ web/src/view/cbi/fvalue.htm | 3 +++ web/src/view/cbi/header.htm | 7 +++++++ web/src/view/cbi/lvalue.htm | 16 ++++++++++++++ web/src/view/cbi/map.htm | 6 ++++++ web/src/view/cbi/mvalue.htm | 19 +++++++++++++++++ web/src/view/cbi/nsection.htm | 20 ++++++++++++++++++ web/src/view/cbi/tblsection.htm | 39 +++++++++++++++++++++++++++++++++++ web/src/view/cbi/tiny_valuefooter.htm | 6 ++++++ web/src/view/cbi/tiny_valueheader.htm | 1 + web/src/view/cbi/tsection.htm | 25 ++++++++++++++++++++++ web/src/view/cbi/ucisection.htm | 20 ++++++++++++++++++ web/src/view/cbi/value.htm | 3 +++ web/src/view/cbi/valuefooter.htm | 5 +++++ web/src/view/cbi/valueheader.htm | 5 +++++ 18 files changed, 205 insertions(+) create mode 100644 web/src/view/cbi/dvalue.htm create mode 100644 web/src/view/cbi/footer.htm create mode 100644 web/src/view/cbi/full_valuefooter.htm create mode 100644 web/src/view/cbi/full_valueheader.htm create mode 100644 web/src/view/cbi/fvalue.htm create mode 100644 web/src/view/cbi/header.htm create mode 100644 web/src/view/cbi/lvalue.htm create mode 100644 web/src/view/cbi/map.htm create mode 100644 web/src/view/cbi/mvalue.htm create mode 100644 web/src/view/cbi/nsection.htm create mode 100644 web/src/view/cbi/tblsection.htm create mode 100644 web/src/view/cbi/tiny_valuefooter.htm create mode 100644 web/src/view/cbi/tiny_valueheader.htm create mode 100644 web/src/view/cbi/tsection.htm create mode 100644 web/src/view/cbi/ucisection.htm create mode 100644 web/src/view/cbi/value.htm create mode 100644 web/src/view/cbi/valuefooter.htm create mode 100644 web/src/view/cbi/valueheader.htm (limited to 'web/src/view/cbi') diff --git a/web/src/view/cbi/dvalue.htm b/web/src/view/cbi/dvalue.htm new file mode 100644 index 0000000000..f54667def6 --- /dev/null +++ b/web/src/view/cbi/dvalue.htm @@ -0,0 +1,12 @@ +<%+cbi/valueheader%> +<% if self.value then + if type(self.value) == "function" then %> + <%=self:value(section)%> +<% else %> + <%=self.value%> +<% end +else %> + <%=self:cfgvalue(section)%> +<% end %> +  +<%+cbi/valuefooter%> diff --git a/web/src/view/cbi/footer.htm b/web/src/view/cbi/footer.htm new file mode 100644 index 0000000000..2acf710cdd --- /dev/null +++ b/web/src/view/cbi/footer.htm @@ -0,0 +1,7 @@ +
+ + + +
+ +<%+footer%> \ No newline at end of file diff --git a/web/src/view/cbi/full_valuefooter.htm b/web/src/view/cbi/full_valuefooter.htm new file mode 100644 index 0000000000..6151a3a66a --- /dev/null +++ b/web/src/view/cbi/full_valuefooter.htm @@ -0,0 +1,8 @@ +
<%=self.description%> 
+ + <% if self.tag_invalid[section] then %>
<%:cbi_invalid Fehler: Ungültige Eingabe%>
<% end %> + + <% if #self.deps > 0 then %><% end %> \ No newline at end of file diff --git a/web/src/view/cbi/full_valueheader.htm b/web/src/view/cbi/full_valueheader.htm new file mode 100644 index 0000000000..062efa2ddd --- /dev/null +++ b/web/src/view/cbi/full_valueheader.htm @@ -0,0 +1,3 @@ +
"> +
<%=self.title%>
+
\ No newline at end of file diff --git a/web/src/view/cbi/fvalue.htm b/web/src/view/cbi/fvalue.htm new file mode 100644 index 0000000000..b609f1d4f4 --- /dev/null +++ b/web/src/view/cbi/fvalue.htm @@ -0,0 +1,3 @@ +<%+cbi/valueheader%> + " name="cbid.<%=self.config.."."..section.."."..self.option%>"<% if self:cfgvalue(section) == self.enabled then %> checked="checked"<% end %> value="1" /> +<%+cbi/valuefooter%> \ No newline at end of file diff --git a/web/src/view/cbi/header.htm b/web/src/view/cbi/header.htm new file mode 100644 index 0000000000..4229aaf0df --- /dev/null +++ b/web/src/view/cbi/header.htm @@ -0,0 +1,7 @@ +<%+header%> +
+
+ + + +
diff --git a/web/src/view/cbi/lvalue.htm b/web/src/view/cbi/lvalue.htm new file mode 100644 index 0000000000..f1ae5a0939 --- /dev/null +++ b/web/src/view/cbi/lvalue.htm @@ -0,0 +1,16 @@ +<%+cbi/valueheader%> +<% if self.widget == "select" then %> + +<% elseif self.widget == "radio" then + local c = 0; + for i, key in pairs(self.keylist) do + c = c + 1%> + <%=self.vallist[i]%>"<% if self:cfgvalue(section) == key then %> checked="checked"<% end %> value="<%=key%>" /> +<% if c == self.size then c = 0 %>
+<% end end %> +<% end %> +<%+cbi/valuefooter%> \ No newline at end of file diff --git a/web/src/view/cbi/map.htm b/web/src/view/cbi/map.htm new file mode 100644 index 0000000000..835393c1c5 --- /dev/null +++ b/web/src/view/cbi/map.htm @@ -0,0 +1,6 @@ +
+

<%=self.title%>

+
<%=self.description%>
+<% self:render_children() %> +
+
diff --git a/web/src/view/cbi/mvalue.htm b/web/src/view/cbi/mvalue.htm new file mode 100644 index 0000000000..bed66e569a --- /dev/null +++ b/web/src/view/cbi/mvalue.htm @@ -0,0 +1,19 @@ +<% +local v = self:valuelist(section) +%> +<%+cbi/valueheader%> +<% 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 luci.util.contains(v, key) then %> checked="checked"<% end %> value="<%=key%>" /> +<% if c == self.size then c = 0 %>
+<% end end %> +<% end %> +<%+cbi/valuefooter%> \ No newline at end of file diff --git a/web/src/view/cbi/nsection.htm b/web/src/view/cbi/nsection.htm new file mode 100644 index 0000000000..fff597ad06 --- /dev/null +++ b/web/src/view/cbi/nsection.htm @@ -0,0 +1,20 @@ +<% if self:cfgvalue(self.section) then +section = self.section %> +
+

<%=self.title%>

+
<%=self.description%>
+ <% if self.addremove then %>
+ +
<% end %> +
+<%+cbi/ucisection%> +
+
+
+<% elseif self.addremove then %> +
+

<%=self.title%>

+
<%=self.description%>
+ +
+<% end %> diff --git a/web/src/view/cbi/tblsection.htm b/web/src/view/cbi/tblsection.htm new file mode 100644 index 0000000000..df16efbed0 --- /dev/null +++ b/web/src/view/cbi/tblsection.htm @@ -0,0 +1,39 @@ +
+

<%=self.title%>

+
<%=self.description%>
+
+
+<% for i, k in pairs(self.children) do %> +
<%=k.title%>
+<% end %> +
+
+<% for i, k in pairs(self.children) do %> +
<%=k.description%>
+<% end %> +
+<% for i, k in ipairs(self:cfgsections()) do%> + <% if not self.anonymous then %>

<%=k%>

<% end %> +<% +section = k +scope = {valueheader = "cbi/tiny_valueheader", valuefooter = "cbi/tiny_valuefooter"} +%> +
+<%+cbi/ucisection%> + <% if self.addremove then %>
+ +
<% end %> +
+<% end %> +<% if self.addremove then %> +
+ <% if self.anonymous then %> + + <% else %> + + + <% end %><% if self.err_invalid then %>
<%:cbi_invalid Fehler: Ungültige Eingabe%>
<% end %> +
+
+<% end %> +
diff --git a/web/src/view/cbi/tiny_valuefooter.htm b/web/src/view/cbi/tiny_valuefooter.htm new file mode 100644 index 0000000000..e65ebb6c03 --- /dev/null +++ b/web/src/view/cbi/tiny_valuefooter.htm @@ -0,0 +1,6 @@ + <% if self.tag_invalid[section] then %>
<%:cbi_invalid Fehler: Ungültige Eingabe%>
<% end %> +
+ <% if #self.deps > 0 then %><% end %> \ No newline at end of file diff --git a/web/src/view/cbi/tiny_valueheader.htm b/web/src/view/cbi/tiny_valueheader.htm new file mode 100644 index 0000000000..b9b26bd6a2 --- /dev/null +++ b/web/src/view/cbi/tiny_valueheader.htm @@ -0,0 +1 @@ +
"> diff --git a/web/src/view/cbi/tsection.htm b/web/src/view/cbi/tsection.htm new file mode 100644 index 0000000000..37b18b5d42 --- /dev/null +++ b/web/src/view/cbi/tsection.htm @@ -0,0 +1,25 @@ +
+

<%=self.title%>

+
<%=self.description%>
+<% for i, k in ipairs(self:cfgsections()) do%> + <% if self.addremove then %>
+ +
<% end %> + <% if not self.anonymous then %>

<%=k%>

<% end %> +<% section = k %> +
+<%+cbi/ucisection%> +
+
+<% end %> +<% if self.addremove then %> +
+ <% if self.anonymous then %> + + <% else %> + + + <% end %><% if self.err_invalid then %>
<%:cbi_invalid Fehler: Ungültige Eingabe%>
<% end %> +
+<% end %> +
diff --git a/web/src/view/cbi/ucisection.htm b/web/src/view/cbi/ucisection.htm new file mode 100644 index 0000000000..0abc37e7c6 --- /dev/null +++ b/web/src/view/cbi/ucisection.htm @@ -0,0 +1,20 @@ +<% self:render_children(section, scope or {}) %> + <% if #self.optionals[section] > 0 or self.dynamic then %> +
+ <% if self.dynamic then %> + + <% else %> + + + <% end %> + +
+ <% end %> \ No newline at end of file diff --git a/web/src/view/cbi/value.htm b/web/src/view/cbi/value.htm new file mode 100644 index 0000000000..31bf38f77c --- /dev/null +++ b/web/src/view/cbi/value.htm @@ -0,0 +1,3 @@ +<%+cbi/valueheader%> + size="<%=self.size%>" <% end %><% if self.maxlength then %>maxlength="<%=self.maxlength%>" <% end %>name="cbid.<%=self.config.."."..section.."."..self.option%>" id="cbid.<%=self.config.."."..section.."."..self.option%>" value="<%=self:cfgvalue(section)%>" /> +<%+cbi/valuefooter%> diff --git a/web/src/view/cbi/valuefooter.htm b/web/src/view/cbi/valuefooter.htm new file mode 100644 index 0000000000..bc9d1b127a --- /dev/null +++ b/web/src/view/cbi/valuefooter.htm @@ -0,0 +1,5 @@ +<% if valuefooter then + include(valuefooter) +else + include("cbi/full_valuefooter") +end %> \ No newline at end of file diff --git a/web/src/view/cbi/valueheader.htm b/web/src/view/cbi/valueheader.htm new file mode 100644 index 0000000000..8d9802f57f --- /dev/null +++ b/web/src/view/cbi/valueheader.htm @@ -0,0 +1,5 @@ +<% if valueheader then + include(valueheader) +else + include("cbi/full_valueheader") +end %> \ No newline at end of file -- cgit v1.2.3