summaryrefslogtreecommitdiffhomepage
path: root/modules/freifunk
diff options
context:
space:
mode:
authorManuel Munz <freifunk@somakoma.de>2012-09-19 09:44:20 +0000
committerManuel Munz <freifunk@somakoma.de>2012-09-19 09:44:20 +0000
commit45d812dbb7b6374cd4188925661b74723cef91a7 (patch)
treeaee8ad060259a0b06dd254e689172f61e280d78e /modules/freifunk
parent3563c607f2110c8b9a0852e1fe20b55de77d5b6e (diff)
modules/freifunk: remove sorting function from widgets include in index view
Diffstat (limited to 'modules/freifunk')
-rw-r--r--modules/freifunk/luasrc/view/freifunk/index.htm11
1 files changed, 3 insertions, 8 deletions
diff --git a/modules/freifunk/luasrc/view/freifunk/index.htm b/modules/freifunk/luasrc/view/freifunk/index.htm
index d1862bd3a..0fcec4597 100644
--- a/modules/freifunk/luasrc/view/freifunk/index.htm
+++ b/modules/freifunk/luasrc/view/freifunk/index.htm
@@ -78,18 +78,13 @@ local dir = "/usr/lib/lua/luci/view/freifunk/widgets"
uci:foreach("freifunk-widgets", "widget",
function(s)
if s.enabled == "1" then
- local name = s[".name"]
- widgets[name] = s
+ table.insert(widgets, s)
end
end)
-local function cmp(a, b)
- return (widgets[a].order or 100) > (widgets[b].order or 100)
-end
-
-for k, v in luci.util.spairs(widgets, function(a,b) return (tonumber(widgets[a].order) < tonumber(widgets[b].order)) end) do
+for k, v in ipairs(widgets) do
if v['template'] and fs.access(dir .. "/" .. v['template'] .. "/main.htm") then
- tpl.render("freifunk/widgets/" .. v['template'] .. "/main", { name = k, data = v })
+ tpl.render("freifunk/widgets/" .. v['template'] .. "/main", { data = v })
end
end