From: Steven Barth Date: Fri, 11 Apr 2008 18:29:19 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 0.8.0~1143 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c66cc9f47cd803fd85b503e9e6a03e55eb4ee334;p=oweals%2Fluci.git --- diff --git a/core/src/ffluci/view/cbi/dvalue.htm b/core/src/ffluci/view/cbi/dvalue.htm new file mode 100644 index 000000000..178f2e16a --- /dev/null +++ b/core/src/ffluci/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) or "")%> +<% end %> +  +<%+cbi/valuefooter%> diff --git a/core/src/ffluci/view/cbi/footer.htm b/core/src/ffluci/view/cbi/footer.htm new file mode 100644 index 000000000..2acf710cd --- /dev/null +++ b/core/src/ffluci/view/cbi/footer.htm @@ -0,0 +1,7 @@ +
+ + + +
+ +<%+footer%> \ No newline at end of file diff --git a/core/src/ffluci/view/cbi/fvalue.htm b/core/src/ffluci/view/cbi/fvalue.htm new file mode 100644 index 000000000..b609f1d4f --- /dev/null +++ b/core/src/ffluci/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/core/src/ffluci/view/cbi/header.htm b/core/src/ffluci/view/cbi/header.htm new file mode 100644 index 000000000..20b4aac7f --- /dev/null +++ b/core/src/ffluci/view/cbi/header.htm @@ -0,0 +1,7 @@ +<%+header%> +
"> +
+ + + +
diff --git a/core/src/ffluci/view/cbi/lvalue.htm b/core/src/ffluci/view/cbi/lvalue.htm new file mode 100644 index 000000000..f1ae5a093 --- /dev/null +++ b/core/src/ffluci/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/core/src/ffluci/view/cbi/map.htm b/core/src/ffluci/view/cbi/map.htm new file mode 100644 index 000000000..83c377fb8 --- /dev/null +++ b/core/src/ffluci/view/cbi/map.htm @@ -0,0 +1,7 @@ +
+

<%=self.title%>

+
<%=self.description%>
+
+<% self:render_children() %> +
+
diff --git a/core/src/ffluci/view/cbi/mvalue.htm b/core/src/ffluci/view/cbi/mvalue.htm new file mode 100644 index 000000000..97a1c4295 --- /dev/null +++ b/core/src/ffluci/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 ffluci.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/core/src/ffluci/view/cbi/nsection.htm b/core/src/ffluci/view/cbi/nsection.htm new file mode 100644 index 000000000..9c54a9942 --- /dev/null +++ b/core/src/ffluci/view/cbi/nsection.htm @@ -0,0 +1,17 @@ +<% 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/core/src/ffluci/view/cbi/tsection.htm b/core/src/ffluci/view/cbi/tsection.htm new file mode 100644 index 000000000..8da0b4a1d --- /dev/null +++ b/core/src/ffluci/view/cbi/tsection.htm @@ -0,0 +1,22 @@ +
+

<%=self.title%>

+
<%=self.description%>
+<% for k, v in pairs(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/core/src/ffluci/view/cbi/ucisection.htm b/core/src/ffluci/view/cbi/ucisection.htm new file mode 100644 index 000000000..ef1b6cb0e --- /dev/null +++ b/core/src/ffluci/view/cbi/ucisection.htm @@ -0,0 +1,23 @@ +
+<% self:render_children(section) %> + <% 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/core/src/ffluci/view/cbi/value.htm b/core/src/ffluci/view/cbi/value.htm new file mode 100644 index 000000000..61033a0f5 --- /dev/null +++ b/core/src/ffluci/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) or "")%>" /> +<%+cbi/valuefooter%> diff --git a/core/src/ffluci/view/cbi/valuefooter.htm b/core/src/ffluci/view/cbi/valuefooter.htm new file mode 100644 index 000000000..3f92f09e2 --- /dev/null +++ b/core/src/ffluci/view/cbi/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/core/src/ffluci/view/cbi/valueheader.htm b/core/src/ffluci/view/cbi/valueheader.htm new file mode 100644 index 000000000..86c782d71 --- /dev/null +++ b/core/src/ffluci/view/cbi/valueheader.htm @@ -0,0 +1,3 @@ +
"> +
<%=self.title%>
+
\ No newline at end of file diff --git a/core/src/ffluci/view/error404.htm b/core/src/ffluci/view/error404.htm new file mode 100644 index 000000000..adc671de0 --- /dev/null +++ b/core/src/ffluci/view/error404.htm @@ -0,0 +1,5 @@ +<%+header%> +

404 Not Found

+

Sorry, the object you requested was not found.

+Unable to dispatch: <%=os.getenv("PATH_INFO")%> +<%+footer%> \ No newline at end of file diff --git a/core/src/ffluci/view/error500.htm b/core/src/ffluci/view/error500.htm new file mode 100644 index 000000000..8af22e8f2 --- /dev/null +++ b/core/src/ffluci/view/error500.htm @@ -0,0 +1,5 @@ +<%+header%> +

500 Internal Server Error

+

Sorry, the server encountered an unexpected error.

+<%=message%> +<%+footer%> \ No newline at end of file diff --git a/core/src/ffluci/view/footer.htm b/core/src/ffluci/view/footer.htm new file mode 100644 index 000000000..8d48c5fac --- /dev/null +++ b/core/src/ffluci/view/footer.htm @@ -0,0 +1,7 @@ +
+
+
+ +
FFLuCI 0.2 - Freifunk Lua Configuration Interface
+ + \ No newline at end of file diff --git a/core/src/ffluci/view/header.htm b/core/src/ffluci/view/header.htm new file mode 100644 index 000000000..40d54f516 --- /dev/null +++ b/core/src/ffluci/view/header.htm @@ -0,0 +1,78 @@ +<% +require("ffluci.sys") +local load1, load5, load15 = ffluci.sys.loadavg() +local req = require("ffluci.dispatcher").request +local menu = require("ffluci.menu").get()[req.category] +require("ffluci.i18n").loadc("default") +require("ffluci.http").htmlheader() +%> + + + + + + + + FFLuCI + + + + + + +
+ + <% end %> +
+ +
\ No newline at end of file