summaryrefslogtreecommitdiffhomepage
path: root/modules/freifunk/luasrc/view
diff options
context:
space:
mode:
Diffstat (limited to 'modules/freifunk/luasrc/view')
-rw-r--r--modules/freifunk/luasrc/view/freifunk/adminindex.htm33
-rw-r--r--modules/freifunk/luasrc/view/freifunk/contact.htm14
-rw-r--r--modules/freifunk/luasrc/view/freifunk/index.htm25
3 files changed, 59 insertions, 13 deletions
diff --git a/modules/freifunk/luasrc/view/freifunk/adminindex.htm b/modules/freifunk/luasrc/view/freifunk/adminindex.htm
new file mode 100644
index 0000000000..d2bf0b7eaa
--- /dev/null
+++ b/modules/freifunk/luasrc/view/freifunk/adminindex.htm
@@ -0,0 +1,33 @@
+<%+header%>
+<%
+local uci = require "luci.model.uci".cursor()
+local contact = uci:get_all("freifunk", "contact")
+local contacturl = luci.dispatcher.build_url(luci.dispatcher.context.path[1], "freifunk", "contact")
+local hostname = uci:get_first ("system", "system", "hostname")
+local latitude = uci:get_first ("system", "system", "latitude")
+local longitude = uci:get_first ("system", "system", "longitude")
+local location = uci:get_first ("system", "system", "location")
+local basicsurl = luci.dispatcher.build_url(luci.dispatcher.context.path[1], "freifunk", "basics")
+%>
+
+<h2><%:Freifunk Overview%></h2>
+
+<%:These pages will assist you in setting up your router for Freifunk or similar wireless community networks.%>
+<p />
+
+<% if not (hostname and latitude and longitude and location) then%>
+<div class="error">
+ <%:Basic settings are missing. Please go to this page and fill all required fields: %>
+ <a href='<%=basicsurl%>'><%:Basic settings%></a>
+</div>
+<%end%>
+<p />
+
+<% if not (contact.nickname and contact.name and contact.mail) then%>
+<div class="error">
+ <%:Contact information missing. Please go to this page and fill all required fields: %>
+ <a href='<%=contacturl%>'><%:Contact%></a>
+</div>
+<%end%>
+
+<%+footer%>
diff --git a/modules/freifunk/luasrc/view/freifunk/contact.htm b/modules/freifunk/luasrc/view/freifunk/contact.htm
index 0b4a068108..0d917ad5b6 100644
--- a/modules/freifunk/luasrc/view/freifunk/contact.htm
+++ b/modules/freifunk/luasrc/view/freifunk/contact.htm
@@ -13,15 +13,23 @@ $Id$
-%>
<%+header%>
-<% local contact = luci.model.uci.cursor():get_all("freifunk", "contact") %>
+
+<%
+local uci = require "luci.model.uci".cursor()
+local contact = uci:get_all("freifunk", "contact")
+local location = uci:get_first("system", "system", "location")
+local lon = uci:get_first("system", "system", "longitude")
+local lat = uci:get_first("system", "system", "latitude")
+%>
+
<h2><a id="content" name="content"><%:Contact%></a></h2>
<table cellspacing="0" cellpadding="6">
<tr><th><%:Nickname%>:</th><td><%=contact.nickname%></td></tr>
<tr><th><%:Realname%>:</th><td><%=contact.name%></td></tr>
<tr><th><%:E-Mail%>:</th><td><%=contact.mail%></td></tr>
<tr><th><%:Phone%>:</th><td><%=contact.phone%></td></tr>
- <tr><th><%:Location%>:</th><td><%=contact.location%></td></tr>
- <tr><th><%:Coordinates%>:</th><td><%=contact.geo%></td></tr>
+ <tr><th><%:Location%>:</th><td><%=location%></td></tr>
+ <tr><th><%:Coordinates%>:</th><td><%=lat%> <%=lon%></td></tr>
<tr><th><%:Notice%>:</th><td><%=contact.note%></td></tr>
</table>
<%+footer%>
diff --git a/modules/freifunk/luasrc/view/freifunk/index.htm b/modules/freifunk/luasrc/view/freifunk/index.htm
index d93dcd8f45..4a9ab2efe1 100644
--- a/modules/freifunk/luasrc/view/freifunk/index.htm
+++ b/modules/freifunk/luasrc/view/freifunk/index.htm
@@ -14,7 +14,16 @@ $Id$
-%>
<%+header%>
<%
-local ff = luci.model.uci.cursor():get_all("freifunk")
+local uci = require "luci.model.uci".cursor()
+local ff = uci:get_all("freifunk")
+if not ff.community.name then
+ ff.community.name = ""
+end
+local co = "profile_" .. ff.community.name
+local community = uci:get_first(co, "community", "name") or "Freifunk"
+local url = uci:get_first(co, "community", "homepage") or "http://www.freifunk.net"
+
+
require("luci.fs")
local usertext = luci.fs.readfile("/www/luci-static/index_user.html")
@@ -23,7 +32,7 @@ if (ff.community.DefaultText or "") ~= "disabled" then
defaulttext = '<h2><a id="content" name="content">'..
(translate("Hello and welcome in the network of"))..
' '..
- (ff.community.name or "Freifunk Deutschland")..
+ (community or "Freifunk Deutschland")..
'!</a></h2><p>'..
translate("We are an initiative to establish a free, independent and open wireless mesh network.")..
'<br />'..
@@ -31,20 +40,16 @@ if (ff.community.DefaultText or "") ~= "disabled" then
' '..
luci.sys.hostname()..
'. '..
- translate("It is operated by")..
+ translate("It is operated by ")..
'<a href="'..
luci.dispatcher.build_url("freifunk", "index", "contact")..
- '"> '..
- (ff.contact.nickname or "Anonymous")..
+ '">'..
+ (ff.contact.nickname or translate("Please set your contact information"))..
'</a>.</p><p>'..
translate("You can find further information about the global Freifunk initiative at")..
' <a href="http://freifunk.net">Freifunk.net</a>.<br />'..
translate("If you are interested in our project then contact the local community")..
- ' <a href="'..
- (ff.community.homepage or "http//freifunk.net")..
- '">'..
- (ff.community.name or "Freifunk")..
- '</a>.</p><p><strong>'..
+ ' <a href="'..url..'">'..community..'</a>.</p><p><strong>'..
translate("Notice")..
'</strong>: '..
translate("Internet access depends on technical and organisational conditions and may or may not work for you.")..