root/luci/branches/luci-0.10/modules/freifunk/luasrc/view/freifunk/adminindex.htm @ 7867

Revision 7867, 1.9 KB (checked in by soma, 19 months ago)

luci-0.10: Merge r7866

Line 
1<%+header%>
2<%
3local uci = require "luci.model.uci".cursor()
4local contact = uci:get_all("freifunk", "contact")
5local contacturl = luci.dispatcher.build_url(luci.dispatcher.context.path[1], "freifunk", "contact")
6local hostname = uci:get_first ("system", "system", "hostname")
7local latitude = uci:get_first ("system", "system", "latitude")
8local longitude = uci:get_first ("system", "system", "longitude")
9local location = uci:get_first ("system", "system", "location")
10local basicsurl = luci.dispatcher.build_url(luci.dispatcher.context.path[1], "freifunk", "basics")
11local nickname, name, mail
12if not contact then
13    nickname, name, mail = ""
14else
15    nickname = contact.nickname
16    name = contact.name
17    mail = contact.mail
18end
19
20luci.i18n.loadc("freifunk")
21%>
22
23<h2><%:Freifunk Overview%></h2>
24
25<%:These pages will assist you in setting up your router for Freifunk or similar wireless community networks.%>
26<p />
27
28<% if not (hostname and latitude and longitude and location) then%>
29<div class="error">
30    <%:Basic settings are incomplete. Please go to%> <a href='<%=basicsurl%>'><%:Basic settings%></a> <%:and fill out all required fields.%>
31</div>
32<%end%>
33<p />
34
35<% if not (nickname and name and mail) then%>
36<div class="error">
37    <%:Contact information is incomplete. Please go to%> <a href='<%=contacturl%>'><%:Contact%></a> <%:and fill out all required fields.%>
38    <p />
39</div>
40<%end%>
41
42<% uci:foreach("wireless", "wifi-device", function(section)
43    local device = section[".name"]
44    local url = luci.dispatcher.build_url(luci.dispatcher.context.path[1], "network", "wireless")
45    if section.diversity ~= "0" and section.disabled ~= "1" then
46        print('<div class="error">' .. translate("Diversity is enabled for device") .. ' <b>' .. device .. '</b>. '
47        .. translate("Go to") .. ' <a href="' .. url .. '">' .. translate("wireless settings") .. '</a> ' ..
48        translate("to disable it.") .. '</div><p />')
49    end
50end) %>
51
52<%+footer%>
Note: See TracBrowser for help on using the browser.