57f6bddbaa73bc6fc4e882bc4a8b2ae38b418c62
[project/luci.git] / modules / freifunk / luasrc / view / freifunk / adminindex.htm
1 <%+header%>
2 <%
3 local uci = require "luci.model.uci".cursor()
4 local contact = uci:get_all("freifunk", "contact")
5 local contacturl = luci.dispatcher.build_url(luci.dispatcher.context.path[1], "freifunk", "contact")
6 local hostname = uci:get_first ("system", "system", "hostname")
7 local latitude = uci:get_first ("system", "system", "latitude")
8 local longitude = uci:get_first ("system", "system", "longitude")
9 local location = uci:get_first ("system", "system", "location")
10 local basicsurl = luci.dispatcher.build_url(luci.dispatcher.context.path[1], "freifunk", "basics")
11 %>
12
13 <h2><%:Freifunk Overview%></h2>
14
15 <%:These pages will assist you in setting up your router for Freifunk or similar wireless community networks.%>
16 <p />
17
18 <% if not (hostname and latitude and longitude and location) then%>
19 <div class="error">
20         <%:Basic settings are missing. Please go to this page and fill all required fields: %>
21         <a href='<%=basicsurl%>'><%:Basic settings%></a>
22 </div>
23 <%end%>
24 <p />
25
26 <% if not (contact.nickname and contact.name and contact.mail) then%>
27 <div class="error">
28         <%:Contact information missing. Please go to this page and fill all required fields: %>
29         <a href='<%=contacturl%>'><%:Contact%></a><p />
30 </div>
31 <%end%>
32
33 <% uci:foreach("wireless", "wifi-device", function(section)
34         local device = section[".name"]
35         local url = luci.dispatcher.build_url(luci.dispatcher.context.path[1], "network", "wireless")
36         if section.diversity ~= "0" and section.disabled ~= "1" then
37                 print('<div class="error">Diversity is enabled for device <b>' .. device .. '</b>. Go to <a href="' .. url .. '">wireless settings</a> to change that.</div><p />')
38         end
39 end) %>
40
41
42 <%+footer%>