summaryrefslogtreecommitdiffhomepage
path: root/src/ffluci/view
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-03-26 20:55:14 +0000
committerSteven Barth <steven@midlink.org>2008-03-26 20:55:14 +0000
commit68d142e79287e9b5e9f980f37b546070a38fc478 (patch)
tree8d165ffd6e50795b7f140efb0e7ed7f103d2e47d /src/ffluci/view
parent5f9910566de7165f4bb0ee62bc3ace53c708a94e (diff)
* CBI update
* Added some configuration pages * Introduced contact site * Introduced luci UCI config file
Diffstat (limited to 'src/ffluci/view')
-rw-r--r--src/ffluci/view/admin_uci/apply.htm6
-rw-r--r--src/ffluci/view/admin_uci/changes.htm11
-rw-r--r--src/ffluci/view/admin_uci/revert.htm5
-rw-r--r--src/ffluci/view/cbi/footer.htm5
-rw-r--r--src/ffluci/view/cbi/fvalue.htm2
-rw-r--r--src/ffluci/view/cbi/lvalue.htm10
-rw-r--r--src/ffluci/view/cbi/nsection.htm8
-rw-r--r--src/ffluci/view/cbi/tsection.htm10
-rw-r--r--src/ffluci/view/cbi/value.htm8
-rw-r--r--src/ffluci/view/footer.htm2
-rw-r--r--src/ffluci/view/header.htm26
-rw-r--r--src/ffluci/view/public_index/contact.htm12
12 files changed, 75 insertions, 30 deletions
diff --git a/src/ffluci/view/admin_uci/apply.htm b/src/ffluci/view/admin_uci/apply.htm
new file mode 100644
index 0000000000..43777c6c6d
--- /dev/null
+++ b/src/ffluci/view/admin_uci/apply.htm
@@ -0,0 +1,6 @@
+<%+header%>
+<h1><%:config Konfiguration%></h1>
+<p><%:uci_applied Die folgenden Änderungen wurden übernommen:%></p>
+<code><%=(changes or "-")%>
+<%=output%></code>
+<%+footer%> \ No newline at end of file
diff --git a/src/ffluci/view/admin_uci/changes.htm b/src/ffluci/view/admin_uci/changes.htm
new file mode 100644
index 0000000000..3bbcd0e5fb
--- /dev/null
+++ b/src/ffluci/view/admin_uci/changes.htm
@@ -0,0 +1,11 @@
+<%+header%>
+<h1><%:config Konfiguration%></h1>
+<h2><%:changes Änderungen%></h2>
+<code><%=(ffluci.model.uci.changes() or "-")%></code>
+<form class="inline" method="get" action="<%=controller%>/admin/uci/apply">
+ <input type="submit" value="<%:apply Anwenden%>" />
+</form>
+<form class="inline" method="get" action="<%=controller%>/admin/uci/revert">
+ <input type="submit" value="<%:revert Verwerfen%>" />
+</form>
+<%+footer%> \ No newline at end of file
diff --git a/src/ffluci/view/admin_uci/revert.htm b/src/ffluci/view/admin_uci/revert.htm
new file mode 100644
index 0000000000..f5eabc71b7
--- /dev/null
+++ b/src/ffluci/view/admin_uci/revert.htm
@@ -0,0 +1,5 @@
+<%+header%>
+<h1><%:config Konfiguration%></h1>
+<p><%:uci_reverted Die folgenden Änderungen wurden verworfen:%></p>
+<code><%=(changes or "-")%></code>
+<%+footer%> \ No newline at end of file
diff --git a/src/ffluci/view/cbi/footer.htm b/src/ffluci/view/cbi/footer.htm
index 230a17da86..d6e49678eb 100644
--- a/src/ffluci/view/cbi/footer.htm
+++ b/src/ffluci/view/cbi/footer.htm
@@ -1,5 +1,4 @@
- <hr class="cbi-form-separator" />
- <input type="submit" value="<%:cbi_save Speichern%>" />
- <input type="reset" value="<%:cbi_reset Zurücksetzen%>" />
+ <input type="submit" value="<%:save Speichern%>" />
+ <input type="reset" value="<%:reset Zurücksetzen%>" />
</form>
<%+footer%> \ No newline at end of file
diff --git a/src/ffluci/view/cbi/fvalue.htm b/src/ffluci/view/cbi/fvalue.htm
index 8c8a2dfba0..6cf9a8d87c 100644
--- a/src/ffluci/view/cbi/fvalue.htm
+++ b/src/ffluci/view/cbi/fvalue.htm
@@ -4,7 +4,7 @@
<div class="cbi-value-description"><%=self.description%></div>
</div>
<div class="cbi-value-field">
- <input type="checkbox" name="cbid.<%=self.config.."."..section.."."..self.option%>"<% if self:ucivalue(section) == self.enabled then %> checked="checked"<% end %> value="1" />
+ <input type="checkbox" name="cbid.<%=self.config.."."..section.."."..self.option%>"<% if self:cfgvalue(section) == self.enabled then %> checked="checked"<% end %> value="1" />
</div>
<div class="clear"></div>
</div> \ No newline at end of file
diff --git a/src/ffluci/view/cbi/lvalue.htm b/src/ffluci/view/cbi/lvalue.htm
index abe5080174..f2a5ff9750 100644
--- a/src/ffluci/view/cbi/lvalue.htm
+++ b/src/ffluci/view/cbi/lvalue.htm
@@ -1,20 +1,18 @@
<div class="cbi-value">
- <div class="left">
- <div class="cbi-value-title"><%=self.title%></div>
- <div class="cbi-value-description"><%=self.description%></div>
- </div>
+ <div class="cbi-value-title left"><%=self.title%></div>
+ <div class="cbi-value-description right"><%=self.description%></div>
<div class="cbi-value-field">
<% if self.widget == "select" then %>
<select name="cbid.<%=self.config.."."..section.."."..self.option%>"<% if self.size then %> size="<%=self.size%>"<% end %>>
<%for i, key in pairs(self.keylist) do%>
- <option<% if self:ucivalue(section) == key then %> selected="selected"<% end %> value="<%=key%>"><%=self.vallist[i]%></option>
+ <option<% if self:cfgvalue(section) == key then %> selected="selected"<% end %> value="<%=key%>"><%=self.vallist[i]%></option>
<% end %>
</select>
<% elseif self.widget == "radio" then
local c = 0;
for i, key in pairs(self.keylist) do
c = c + 1%>
- <%=self.vallist[i]%><input type="radio" name="cbid.<%=self.config.."."..section.."."..self.option%>"<% if self:ucivalue(section) == key then %> checked="checked"<% end %> value="<%=key%>" />
+ <%=self.vallist[i]%><input type="radio" name="cbid.<%=self.config.."."..section.."."..self.option%>"<% if self:cfgvalue(section) == key then %> checked="checked"<% end %> value="<%=key%>" />
<% if c == self.size then c = 0 %><br />
<% end end %>
<% end %>
diff --git a/src/ffluci/view/cbi/nsection.htm b/src/ffluci/view/cbi/nsection.htm
index 80dcefc07c..7615104ad7 100644
--- a/src/ffluci/view/cbi/nsection.htm
+++ b/src/ffluci/view/cbi/nsection.htm
@@ -1,17 +1,17 @@
-<% if self:ucivalue(self.section) then %>
+<% if self:cfgvalue(self.section) then %>
<div class="cbi-section" id="cbi-<%=self.config%>-<%=self.section%>">
<h2><%=self.title%></h2>
<div class="cbi-section-descr"><%=self.description%></div>
<fieldset class="cbi-section-node">
<% self:render_children(self.section) %>
- <% if #self.optionals > 0 or self.dynamic then %>
+ <% if #self.optionals[self.section] > 0 or self.dynamic then %>
<div class="cbi-optionals">
<% if self.dynamic then %>
<input type="text" name="cbi.opt.<%=self.config%>.<%=self.section%>" />
<% else %>
<select name="cbi.opt.<%=self.config%>.<%=self.section%>">
- <option><%:cbi_selopt *** Zusätzliche Felder ***%></option>
- <% for key, val in pairs(self.optionals) do %>
+ <option><%:cbi_selopt *** Zusätzliche Parameter ***%></option>
+ <% for key, val in pairs(self.optionals[self.section]) do %>
<option value="<%=val.option%>"><%=val.title%></option>
<% end %>
</select>
diff --git a/src/ffluci/view/cbi/tsection.htm b/src/ffluci/view/cbi/tsection.htm
index 26f8b198e8..9205095313 100644
--- a/src/ffluci/view/cbi/tsection.htm
+++ b/src/ffluci/view/cbi/tsection.htm
@@ -1,18 +1,18 @@
<div class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
<h2><%=self.title%></h2>
<div class="cbi-section-descr"><%=self.description%></div>
-<% for k, v in pairs(self:ucisections()) do%>
+<% for k, v in pairs(self:cfgsections()) do%>
<fieldset class="cbi-section-node" id="cbi-<%=self.config%>-<%=k%>">
- <% if not self.anonymous then %><legend><%=k%></legend><% end %>
+ <% if not self.anonymous then %><h3><%=k%></h3><% end %>
<% self:render_children(k) %>
- <% if #self.optionals > 0 or self.dynamic then %>
+ <% if #self.optionals[k] > 0 or self.dynamic then %>
<div class="cbi-optionals">
<% if self.dynamic then %>
<input type="text" name="cbi.opt.<%=self.config%>.<%=k%>" />
<% else %>
<select name="cbi.opt.<%=self.config%>.<%=k%>">
- <option><%:cbi_selopt *** Zusätzliche Felder ***%></option>
- <% for key, val in pairs(self.optionals) do %>
+ <option><%:cbi_selopt *** Zusätzliche Parameter ***%></option>
+ <% for key, val in pairs(self.optionals[k]) do %>
<option value="<%=val.option%>"><%=val.title%></option>
<% end %>
</select>
diff --git a/src/ffluci/view/cbi/value.htm b/src/ffluci/view/cbi/value.htm
index 54ca720d90..ae4cd0eb59 100644
--- a/src/ffluci/view/cbi/value.htm
+++ b/src/ffluci/view/cbi/value.htm
@@ -1,10 +1,8 @@
<div class="cbi-value">
- <div class="left">
- <div class="cbi-value-title"><%=self.title%></div>
- <div class="cbi-value-description"><%=self.description%></div>
- </div>
+ <div class="cbi-value-title left"><%=self.title%></div>
+ <div class="cbi-value-description right"><%=self.description%></div>
<div class="cbi-value-field">
- <input type="text" <% if self.size then %>size="<%=self.size%>" <% end %><% if self.maxlength then %>maxlength="<%=self.maxlength%>" <% end %>name="cbid.<%=self.config.."."..section.."."..self.option%>" value="<%=(self:ucivalue(section) or "")%>" />
+ <input type="text" <% if self.size then %>size="<%=self.size%>" <% end %><% if self.maxlength then %>maxlength="<%=self.maxlength%>" <% end %>name="cbid.<%=self.config.."."..section.."."..self.option%>" value="<%=(self:cfgvalue(section) or "")%>" />
</div>
<div class="clear"></div>
<% if self.tag_invalid[section] then %><div class="cbi-error"><%:cbi_invalid Fehler: Ungültige Eingabe%></div><% end %>
diff --git a/src/ffluci/view/footer.htm b/src/ffluci/view/footer.htm
index c43cbb7e42..8d48c5fac4 100644
--- a/src/ffluci/view/footer.htm
+++ b/src/ffluci/view/footer.htm
@@ -2,6 +2,6 @@
<div class="clear"></div>
</div></div>
-<div class="separator magenta bold">FFLuCI 0.1 - Freifunk Lua Configuration Interface</div>
+<div class="separator magenta bold">FFLuCI 0.2 - Freifunk Lua Configuration Interface</div>
</body>
</html> \ No newline at end of file
diff --git a/src/ffluci/view/header.htm b/src/ffluci/view/header.htm
index cd2a64b55c..db5570515b 100644
--- a/src/ffluci/view/header.htm
+++ b/src/ffluci/view/header.htm
@@ -11,7 +11,6 @@ require("ffluci.http").htmlheader()
<head>
<link rel="stylesheet" type="text/css" href="<%=media%>/cascade.css" />
<link rel="stylesheet" type="text/css" href="<%=media%>/css/<%=req.category%>_<%=req.module%>.css" />
- <link rel="stylesheet" type="text/css" href="<%=media%>/css/<%=req.category%>_<%=req.module%>/<%=req.action%>.css" />
<title>FFLuCI</title>
</head>
<body>
@@ -49,12 +48,29 @@ require("ffluci.http").htmlheader()
<div class="sidebar right">
<div><%:webif Weboberfläche%>
<ul>
- <li<% if "public" == req.category then %> class="yellowtext"<% end %>><a href="<%=controller%>/public"><%:public Public%></a></li>
- <li<% if "admin" == req.category then %> class="yellowtext"<% end %>><a href="<%=controller%>/admin"><%:admin Admin%></a></li>
+ <li<% if "public" == req.category then %> class="yellowtext"<% end %>><a href="<%=controller%>/public"><%:public Öffentlich%></a></li>
+ <li<% if "admin" == req.category then %> class="yellowtext"<% end %>><a href="<%=controller%>/admin"><%:admin Verwaltung%></a></li>
+ </ul>
+ </div>
+ <%
+ if "admin" == req.category then
+ require("ffluci.model.uci")
+ local ucic = ffluci.model.uci.changes()
+ if ucic then
+ ucic = #ffluci.util.split(ucic)
+ end
+ %>
+ <div><%:config Konfiguration%>
+ <ul>
+ <% if ucic then %>
+ <li><a href="<%=controller%>/admin/uci/changes"><%:changes Änderungen:%> <%=ucic%></a></li>
+ <li><a href="<%=controller%>/admin/uci/apply"><%:apply Anwenden%></a></li>
+ <li><a href="<%=controller%>/admin/uci/revert"><%:revert Verwerfen%></a></li>
+ <% else %>
+ <li><%:changes Änderungen: %> 0</li>
+ <% end %>
</ul>
</div>
- <% if "admin" == req.category then %>
- <div>Konfiguration<ul><li>x Änderungen</li><li>Anwenden</li><li>Zurücksetzen</li></ul></div>
<% end %>
</div>
<div id="content"> \ No newline at end of file
diff --git a/src/ffluci/view/public_index/contact.htm b/src/ffluci/view/public_index/contact.htm
new file mode 100644
index 0000000000..ded0a94af0
--- /dev/null
+++ b/src/ffluci/view/public_index/contact.htm
@@ -0,0 +1,12 @@
+<%+header%>
+<h1><%:contact Kontakt%></h1>
+<table class="contact">
+ <tr><th><%:nickname Pseudonym%>:</th><td><%~luci.contact.nickname%></td></tr>
+ <tr><th><%:name Name%>:</th><td><%~luci.contact.name%></td></tr>
+ <tr><th><%:mail E-Mail%>:</th><td><%~luci.contact.mail%></td></tr>
+ <tr><th><%:phone Telefon%>:</th><td><%~luci.contact.phone%></td></tr>
+ <tr><th><%:location Standort%>:</th><td><%~luci.contact.location%></td></tr>
+ <tr><th><%:geocoord Geokoordinaten%>:</th><td><%~luci.contact.geo%></td></tr>
+ <tr><th><%:note Notiz%>:</th><td><%~luci.contact.note%></td></tr>
+</table>
+<%+footer%> \ No newline at end of file