libs/core/ip: optmizations
[project/luci.git] / modules / freifunk / luasrc / controller / freifunk / freifunk.lua
1 --[[
2 LuCI - Lua Configuration Interface
3
4 Copyright 2008 Steven Barth <steven@midlink.org>
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         http://www.apache.org/licenses/LICENSE-2.0
11
12 $Id$
13 ]]--
14 module("luci.controller.freifunk.freifunk", package.seeall)
15
16 function index()
17         local i18n = luci.i18n.translate
18
19         local page  = node()
20         page.lock   = true
21         page.target = alias("freifunk")
22         page.subindex = true
23         page.index = false
24
25         local page    = node("freifunk")
26         page.title    = "Freifunk"
27         page.target   = alias("freifunk", "index")
28         page.order    = 5
29         page.setuser  = "nobody"
30         page.setgroup = "nogroup"
31         page.i18n     = "freifunk"
32         page.index    = true
33
34         local page  = node("freifunk", "index")
35         page.target = template("freifunk/index")
36         page.title  = "Übersicht"
37         page.order  = 10
38         page.indexignore = true
39
40         local page  = node("freifunk", "index", "contact")
41         page.target = template("freifunk/contact")
42         page.title  = "Kontakt"
43
44
45         local page  = node("freifunk", "status")
46         page.target = form("freifunk/public_status")
47         page.title  = "Status"
48         page.order  = 20
49         page.i18n   = "admin-core"
50         page.setuser  = false
51         page.setgroup = false
52
53         assign({"freifunk", "olsr"}, {"admin", "status", "olsr"}, "OLSR", 30)
54
55         if luci.fs.isfile("/etc/config/luci_statistics") then
56                 assign({"freifunk", "graph"}, {"admin", "statistics", "graph"}, i18n("stat_statistics", "Statistiken"), 40)
57         end
58
59         assign({"mini", "freifunk"}, {"admin", "freifunk"}, "Freifunk", 15)
60         entry({"admin", "freifunk"}, alias("admin", "freifunk", "index"), "Freifunk", 15)
61         local page  = node("admin", "freifunk", "index")
62         page.target = cbi("freifunk/freifunk")
63         page.title  = "Freifunk"
64         page.order  = 30
65
66         local page  = node("admin", "freifunk", "contact")
67         page.target = cbi("freifunk/contact")
68         page.title  = "Kontakt"
69         page.order  = 40
70 end