From c36fd44de2db30c08848bf326365a1e372b7879c Mon Sep 17 00:00:00 2001 From: Manuel Munz Date: Tue, 25 Jan 2011 21:04:57 +0000 Subject: applications/ffwizard: Massive changes to the ffwizard to make it more generic. Also introduces changes to the community profiles. ffwizard replaces ffwizard-leipzig now. It is not completely finished yet, but should work in most cases. --- .../freifunk/luasrc/view/freifunk/adminindex.htm | 33 ++++++++++++++++++++++ modules/freifunk/luasrc/view/freifunk/contact.htm | 14 +++++++-- modules/freifunk/luasrc/view/freifunk/index.htm | 25 +++++++++------- 3 files changed, 59 insertions(+), 13 deletions(-) create mode 100644 modules/freifunk/luasrc/view/freifunk/adminindex.htm (limited to 'modules/freifunk/luasrc/view') 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") +%> + +

<%:Freifunk Overview%>

+ +<%:These pages will assist you in setting up your router for Freifunk or similar wireless community networks.%> +

+ +<% if not (hostname and latitude and longitude and location) then%> +

+ <%:Basic settings are missing. Please go to this page and fill all required fields: %> + <%:Basic settings%> +
+<%end%> +

+ +<% if not (contact.nickname and contact.name and contact.mail) then%> +

+ <%:Contact information missing. Please go to this page and fill all required fields: %> + <%:Contact%> +
+<%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") +%> +

<%:Contact%>

- - + +
<%:Nickname%>:<%=contact.nickname%>
<%:Realname%>:<%=contact.name%>
<%:E-Mail%>:<%=contact.mail%>
<%:Phone%>:<%=contact.phone%>
<%:Location%>:<%=contact.location%>
<%:Coordinates%>:<%=contact.geo%>
<%:Location%>:<%=location%>
<%:Coordinates%>:<%=lat%> <%=lon%>
<%:Notice%>:<%=contact.note%>
<%+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 = '

'.. (translate("Hello and welcome in the network of")).. ' '.. - (ff.community.name or "Freifunk Deutschland").. + (community or "Freifunk Deutschland").. '!

'.. translate("We are an initiative to establish a free, independent and open wireless mesh network.").. '
'.. @@ -31,20 +40,16 @@ if (ff.community.DefaultText or "") ~= "disabled" then ' '.. luci.sys.hostname().. '. '.. - translate("It is operated by").. + translate("It is operated by ").. ' '.. - (ff.contact.nickname or "Anonymous").. + '">'.. + (ff.contact.nickname or translate("Please set your contact information")).. '.

'.. translate("You can find further information about the global Freifunk initiative at").. ' Freifunk.net.
'.. translate("If you are interested in our project then contact the local community").. - ' '.. - (ff.community.name or "Freifunk").. - '.

'.. + ' '..community..'.

'.. translate("Notice").. ': '.. translate("Internet access depends on technical and organisational conditions and may or may not work for you.").. -- cgit v1.2.3