modules/freifunk: Make the public index page editable
[project/luci.git] / modules / freifunk / luasrc / view / freifunk / index.htm
index 49e8cd0..d93dcd8 100644 (file)
@@ -13,12 +13,46 @@ $Id$
 
 -%>
 <%+header%>
-<% local ff = luci.model.uci.cursor():get_all("freifunk") %>
-<h2><a id="content" name="content"><%:ff_hellonet%> <%=ff.community.name or 'Freifunk Deutschland'%>!</a></h2>
-<p><%:ff_public1%><br />
-<%:ff_public2%> <%=luci.sys.hostname()%>. <%:ff_public3%>
-<a href="<%=controller%>/public/index/contact"> <%=ff.contact.nickname%></a>.</p>
-<p><%:ff_public4%> <a href="http://freifunk.net">Freifunk.net</a>.<br />
-<%:ff_public5%> <a href="<%=ff.community.homepage or 'http//freifunk.net'%>"><%=ff.community.name or 'Freifunk'%></a>.</p>
-<p><strong><%:ff_note%></strong>: <%:ff_public6%></p>
+<% 
+local ff = luci.model.uci.cursor():get_all("freifunk")
+require("luci.fs")
+local usertext = luci.fs.readfile("/www/luci-static/index_user.html")
+
+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")..
+       '!</a></h2><p>'..
+       translate("We are an initiative to establish a free, independent and open wireless mesh network.")..
+       '<br />'..
+       translate("This is the access point")..
+       ' '..
+       luci.sys.hostname()..
+       '. '..
+       translate("It is operated by")..
+       '<a href="'..
+       luci.dispatcher.build_url("freifunk", "index", "contact")..
+       '"> '..
+       (ff.contact.nickname or "Anonymous")..
+       '</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>'..
+       translate("Notice")..
+       '</strong>: '..
+       translate("Internet access depends on technical and organisational conditions and may or may not work for you.")..
+       '</p>'
+end
+%>
+
+<%=defaulttext%>
+<%=usertext%>
+
 <%+footer%>