summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-freifunk/luasrc/view/freifunk/index.htm
diff options
context:
space:
mode:
authorpmelange <isprotejesvalkata@gmail.com>2019-01-11 12:54:55 +0100
committerpmelange <isprotejesvalkata@gmail.com>2019-01-11 12:57:52 +0100
commitd4562ff54461cfb39320af22478e33a13f480fee (patch)
tree22958558c7e524bf9a4b3032fa7c25e8db128273 /modules/luci-mod-freifunk/luasrc/view/freifunk/index.htm
parente3fa766b587a1f8574a0aa979b9e41d9770b38e5 (diff)
luci-mod-freifunk: replace calls to get_all() with separate get() calls
The get_all() function has changed and how it was used before no longer works properly. These changes not only change to individual get() calls, but actually adds to the readability of the code and reduces file size. Signed-off-by: pmelange <isprotejesvalkata@gmail.com>
Diffstat (limited to 'modules/luci-mod-freifunk/luasrc/view/freifunk/index.htm')
-rw-r--r--modules/luci-mod-freifunk/luasrc/view/freifunk/index.htm14
1 files changed, 3 insertions, 11 deletions
diff --git a/modules/luci-mod-freifunk/luasrc/view/freifunk/index.htm b/modules/luci-mod-freifunk/luasrc/view/freifunk/index.htm
index 3134f0b1b9..3affc73fb9 100644
--- a/modules/luci-mod-freifunk/luasrc/view/freifunk/index.htm
+++ b/modules/luci-mod-freifunk/luasrc/view/freifunk/index.htm
@@ -9,18 +9,10 @@
local uci = require "luci.model.uci".cursor()
local tpl = require "luci.template"
local fs = require "nixio.fs"
-local ff = {}
-local ff = uci:get_all("freifunk")
-if not ff or not ff.community.name then
- community = "Freifunk"
- DefaultText = ""
- nickname = "No Nickname set"
-else
- community = ff.community.name
- DefaultText = ff.community.DefaultText
- nickname = ff.contact.nickname
-end
+local community = uci:get("freifunk", "community", "name") or "Freifunk"
+local DefaultText = uci:get("freifunk", "community", "DefaultText") or ""
+local nickname = uci:get("freifunk", "contact", "nickname") or "No Nickname set"
local co = "profile_" .. community
--local community = uci:get_first(co, "community", "name") or "Freifunk"