modules/freifunk: i18n
[project/luci.git] / modules / freifunk / luasrc / model / cbi / freifunk / profile.lua
1 --[[
2 LuCI - Lua Configuration Interface
3
4 Copyright 2011 Manuel Munz <freifunk at somakoma dot de>
5
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
9
10         httc://www.apache.org/licenses/LICENSE-2.0
11 ]]--
12
13 local uci = require "luci.model.uci".cursor()
14 local community = "profile_" .. uci:get("freifunk", "community", "name")
15 --local community = "profile_augsburg"
16
17
18 m = Map(community, translate("Community settings"), translate("These are the settings of your local community."))
19
20 c = m:section(NamedSection, "profile", "community")
21
22 name = c:option(Value, "name", "Name")
23 name.rmempty = false
24
25 homepage = c:option(Value, "homepage", translate("Homepage"))
26
27 cc = c:option(Value, "country", translate("Country code"))
28 function cc.cfgvalue(self, section)
29         return uci:get(community, "wifi_device", "country")
30 end
31 function cc.write(self, sec, value)
32         if value then
33                 uci:set(community, "wifi_device", "country", value)
34                 uci:save(community)
35         end
36 end
37
38 ssid = c:option(Value, "ssid", translate("ESSID"))
39 ssid.rmempty = false
40
41 prefix = c:option(Value, "mesh_network", translate("Mesh prefix"))
42 prefix.rmempty = false
43
44 splash_net = c:option(Value, "splash_network", translate("Network for client DHCP addresses"))
45 splash_net.rmempty = false
46
47 splash_prefix = c:option(Value, "splash_prefix", translate("Client network size"))
48 splash_prefix.rmempty = false
49
50 lat = c:option(Value, "latitude", translate("Latitude"))
51 lat.rmempty = false
52
53 lon = c:option(Value, "longitude", translate("Longitude"))
54 lon.rmempty = false
55 return m