summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-freifunk/luasrc/view/freifunk/adminindex.htm
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2014-12-03 15:17:05 +0100
committerJo-Philipp Wich <jow@openwrt.org>2015-01-08 16:26:20 +0100
commit1bb4822dca6113f73e3bc89e2acf15935e6f8e92 (patch)
tree35e16f100466e4e00657199b38bb3d87d52bf73f /modules/luci-mod-freifunk/luasrc/view/freifunk/adminindex.htm
parent9edd0e46c3f880727738ce8ca6ff1c8b85f99ef4 (diff)
Rework LuCI build system
* Rename subdirectories to their repective OpenWrt package names * Make each LuCI module its own standalone package * Deploy a shared luci.mk which is used by each module Makefile Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Diffstat (limited to 'modules/luci-mod-freifunk/luasrc/view/freifunk/adminindex.htm')
-rw-r--r--modules/luci-mod-freifunk/luasrc/view/freifunk/adminindex.htm51
1 files changed, 51 insertions, 0 deletions
diff --git a/modules/luci-mod-freifunk/luasrc/view/freifunk/adminindex.htm b/modules/luci-mod-freifunk/luasrc/view/freifunk/adminindex.htm
new file mode 100644
index 000000000..e0252ba89
--- /dev/null
+++ b/modules/luci-mod-freifunk/luasrc/view/freifunk/adminindex.htm
@@ -0,0 +1,51 @@
+<%+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")
+local nickname, name, mail
+if not contact then
+ nickname, name, mail = ""
+else
+ nickname = contact.nickname
+ name = contact.name
+ mail = contact.mail
+end
+
+%>
+
+<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 incomplete. Please go to%> <a href='<%=basicsurl%>'><%:Basic settings%></a> <%:and fill out all required fields.%>
+</div>
+<%end%>
+<p />
+
+<% if not (nickname and name and mail) then%>
+<div class="error">
+ <%:Contact information is incomplete. Please go to%> <a href='<%=contacturl%>'><%:Contact%></a> <%:and fill out all required fields.%>
+ <p />
+</div>
+<%end%>
+
+<% uci:foreach("wireless", "wifi-device", function(section)
+ local device = section[".name"]
+ local url = luci.dispatcher.build_url(luci.dispatcher.context.path[1], "network", "wireless")
+ if section.diversity ~= "0" and section.disabled ~= "1" and section.type ~= "mac80211" then
+ print('<div class="error">' .. translate("Diversity is enabled for device") .. ' <b>' .. section[".name"] .. '</b>. '
+ .. translate("Go to") .. ' <a href="' .. url .. '">' .. translate("wireless settings") .. '</a> ' ..
+ translate("to disable it.") .. '</div><p />')
+ end
+end) %>
+
+<%+footer%>