2 LuCI - Lua Configuration Interface
4 Copyright 2011 Manuel Munz <freifunk at somakoma dot de>
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
10 httc://www.apache.org/licenses/LICENSE-2.0
13 local uci = require "luci.model.uci".cursor()
14 local community = uci:get("freifunk", "community", "name")
15 luci.i18n.loadc("freifunk")
17 if community == nil then
18 luci.http.redirect(luci.dispatcher.build_url("admin", "freifunk", "profile_error"))
21 community = "profile_" .. community
22 m = Map(community, translate("Community settings"), translate("These are the settings of your local community."))
23 c = m:section(NamedSection, "profile", "community")
25 name = c:option(Value, "name", "Name")
28 homepage = c:option(Value, "homepage", translate("Homepage"))
30 cc = c:option(Value, "country", translate("Country code"))
31 function cc.cfgvalue(self, section)
32 return uci:get(community, "wifi_device", "country")
34 function cc.write(self, sec, value)
36 uci:set(community, "wifi_device", "country", value)
41 ssid = c:option(Value, "ssid", translate("ESSID"))
44 prefix = c:option(Value, "mesh_network", translate("Mesh prefix"))
45 prefix.rmempty = false
47 splash_net = c:option(Value, "splash_network", translate("Network for client DHCP addresses"))
48 splash_net.rmempty = false
50 splash_prefix = c:option(Value, "splash_prefix", translate("Client network size"))
51 splash_prefix.rmempty = false
53 lat = c:option(Value, "latitude", translate("Latitude"))
56 lon = c:option(Value, "longitude", translate("Longitude"))