diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2014-12-03 15:17:05 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2015-01-08 16:26:20 +0100 |
commit | 1bb4822dca6113f73e3bc89e2acf15935e6f8e92 (patch) | |
tree | 35e16f100466e4e00657199b38bb3d87d52bf73f /modules/luci-mod-freifunk/luasrc/view/freifunk/index.htm | |
parent | 9edd0e46c3f880727738ce8ca6ff1c8b85f99ef4 (diff) |
Rework LuCI build system
* Rename subdirectories to their repective OpenWrt package names
* Make each LuCI module its own standalone package
* Deploy a shared luci.mk which is used by each module Makefile
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Diffstat (limited to 'modules/luci-mod-freifunk/luasrc/view/freifunk/index.htm')
-rw-r--r-- | modules/luci-mod-freifunk/luasrc/view/freifunk/index.htm | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/modules/luci-mod-freifunk/luasrc/view/freifunk/index.htm b/modules/luci-mod-freifunk/luasrc/view/freifunk/index.htm new file mode 100644 index 0000000000..0fcec45971 --- /dev/null +++ b/modules/luci-mod-freifunk/luasrc/view/freifunk/index.htm @@ -0,0 +1,92 @@ +<%# +LuCI - Lua Configuration Interface +Copyright 2008 Steven Barth <steven@midlink.org> +Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net> + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +$Id$ + +-%> +<%+header%> +<% +local uci = require "luci.model.uci".cursor() +local tpl = require "luci.template" +local fs = require "luci.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 co = "profile_" .. community +--local community = uci:get_first(co, "community", "name") or "Freifunk" +local url = uci:get_first(co, "community", "homepage") or "http://www.freifunk.net" + + +local usertext = fs.readfile("/www/luci-static/index_user.html") + +if DefaultText ~= "disabled" then + + defaulttext = '<h2><a id="content" name="content">'.. + (translate("Hello and welcome in the network of")).. + ' '.. + (community or "Freifunk Deutschland").. + '!</a></h2><p>'.. + translate("We are an initiative to establish a free, independent and open wireless mesh network.").. + '<br />'.. + translate("This is the access point").. + ' '.. + luci.sys.hostname().. + '. '.. + translate("It is operated by").. + ' <a href="'.. + luci.dispatcher.build_url("freifunk", "contact").. + '">'.. + (nickname or translate("Please set your contact information")).. + '</a>.</p><p>'.. + translate("You can find further information about the global Freifunk initiative at").. + ' <a href="http://freifunk.net">Freifunk.net</a>.<br />'.. + translate("If you are interested in our project then contact the local community").. + ' <a href="'..url..'">'..community..'</a>.</p><p><strong>'.. + translate("Notice").. + '</strong>: '.. + translate("Internet access depends on technical and organisational conditions and may or may not work for you.").. + '</p>' +end +%> + +<%=defaulttext%> +<%=usertext%> + +<% +-- add custom widgets from view/freifunk/widgets +local widgets = {} +local dir = "/usr/lib/lua/luci/view/freifunk/widgets" + +uci:foreach("freifunk-widgets", "widget", + function(s) + if s.enabled == "1" then + table.insert(widgets, s) + end + end) + +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", { data = v }) + end +end + +%> +<%+footer%> |