From c66cc9f47cd803fd85b503e9e6a03e55eb4ee334 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Fri, 11 Apr 2008 18:29:19 +0000 Subject: --- core/src/ffluci/view/cbi/dvalue.htm | 12 +++++ core/src/ffluci/view/cbi/footer.htm | 7 +++ core/src/ffluci/view/cbi/fvalue.htm | 3 ++ core/src/ffluci/view/cbi/header.htm | 7 +++ core/src/ffluci/view/cbi/lvalue.htm | 16 +++++++ core/src/ffluci/view/cbi/map.htm | 7 +++ core/src/ffluci/view/cbi/mvalue.htm | 19 ++++++++ core/src/ffluci/view/cbi/nsection.htm | 17 +++++++ core/src/ffluci/view/cbi/tsection.htm | 22 +++++++++ core/src/ffluci/view/cbi/ucisection.htm | 23 ++++++++++ core/src/ffluci/view/cbi/value.htm | 3 ++ core/src/ffluci/view/cbi/valuefooter.htm | 8 ++++ core/src/ffluci/view/cbi/valueheader.htm | 3 ++ core/src/ffluci/view/error404.htm | 5 ++ core/src/ffluci/view/error500.htm | 5 ++ core/src/ffluci/view/footer.htm | 7 +++ core/src/ffluci/view/header.htm | 78 ++++++++++++++++++++++++++++++++ 17 files changed, 242 insertions(+) create mode 100644 core/src/ffluci/view/cbi/dvalue.htm create mode 100644 core/src/ffluci/view/cbi/footer.htm create mode 100644 core/src/ffluci/view/cbi/fvalue.htm create mode 100644 core/src/ffluci/view/cbi/header.htm create mode 100644 core/src/ffluci/view/cbi/lvalue.htm create mode 100644 core/src/ffluci/view/cbi/map.htm create mode 100644 core/src/ffluci/view/cbi/mvalue.htm create mode 100644 core/src/ffluci/view/cbi/nsection.htm create mode 100644 core/src/ffluci/view/cbi/tsection.htm create mode 100644 core/src/ffluci/view/cbi/ucisection.htm create mode 100644 core/src/ffluci/view/cbi/value.htm create mode 100644 core/src/ffluci/view/cbi/valuefooter.htm create mode 100644 core/src/ffluci/view/cbi/valueheader.htm create mode 100644 core/src/ffluci/view/error404.htm create mode 100644 core/src/ffluci/view/error500.htm create mode 100644 core/src/ffluci/view/footer.htm create mode 100644 core/src/ffluci/view/header.htm (limited to 'core/src/ffluci') diff --git a/core/src/ffluci/view/cbi/dvalue.htm b/core/src/ffluci/view/cbi/dvalue.htm new file mode 100644 index 0000000000..178f2e16a1 --- /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 0000000000..2acf710cdd --- /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 0000000000..b609f1d4f4 --- /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 0000000000..20b4aac7ff --- /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 0000000000..f1ae5a0939 --- /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 0000000000..83c377fb86 --- /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 0000000000..97a1c4295a --- /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 0000000000..9c54a99429 --- /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 0000000000..8da0b4a1da --- /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 0000000000..ef1b6cb0e1 --- /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 0000000000..61033a0f50 --- /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 0000000000..3f92f09e26 --- /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 0000000000..86c782d711 --- /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 0000000000..adc671de00 --- /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 0000000000..8af22e8f20 --- /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 0000000000..8d48c5fac4 --- /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 0000000000..40d54f5164 --- /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 -- cgit v1.2.3