diff options
Diffstat (limited to 'modules/luci-mod-freifunk')
9 files changed, 22 insertions, 45 deletions
diff --git a/modules/luci-mod-freifunk/Makefile b/modules/luci-mod-freifunk/Makefile index 550db1df15..70de10879c 100644 --- a/modules/luci-mod-freifunk/Makefile +++ b/modules/luci-mod-freifunk/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=LuCI Freifunk module -LUCI_DEPENDS:=+luci-mod-admin-full +luci-lib-json +freifunk-firewall +freifunk-common +LUCI_DEPENDS:=+luci-mod-admin-full +luci-lib-json +luci-lib-ipkg +freifunk-firewall +freifunk-common include ../../luci.mk diff --git a/modules/luci-mod-freifunk/htdocs/luci-static/resources/osm.js b/modules/luci-mod-freifunk/htdocs/luci-static/resources/osm.js index cae0cd66f7..48ae91cd81 100644 --- a/modules/luci-mod-freifunk/htdocs/luci-static/resources/osm.js +++ b/modules/luci-mod-freifunk/htdocs/luci-static/resources/osm.js @@ -53,8 +53,8 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, { trigger: function(e) { var lonlat = map.getLonLatFromViewPortPx(e.xy); - lat=merc2lat(lonlat.lat); - lon=merc2lon(lonlat.lon); + var lat=merc2lat(lonlat.lat); + var lon=merc2lon(lonlat.lon); if(parent.document.getElementById(latfield_id)==null){ latfield=document.getElementById('osmlat'); }else{ @@ -92,7 +92,7 @@ function init(){ function drawmap() { OpenLayers.Lang.setCode('de'); - mapdiv=document.getElementById('map'); + var mapdiv=document.getElementById('map'); mapdiv.style.height=window.innerHeight+"px"; mapdiv.style.width=window.innerWidth+"px"; map = new OpenLayers.Map('map', { diff --git a/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/basics.lua b/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/basics.lua index b08366de6c..eb0b49b11c 100644 --- a/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/basics.lua +++ b/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/basics.lua @@ -15,7 +15,7 @@ community.rmempty = false local profile for profile in fs.glob(profiles) do - local name = uci:get_first(profile, "community", "name") or "?" + local name = uci:get_first(string.gsub(profile, "/etc/config/", ""), "community", "name") or "?" community:value(string.gsub(profile, "/etc/config/profile_", ""), name) end diff --git a/modules/luci-mod-freifunk/luasrc/view/freifunk-map/frame.htm b/modules/luci-mod-freifunk/luasrc/view/freifunk-map/frame.htm index dbf3820f5c..bd936ac705 100644 --- a/modules/luci-mod-freifunk/luasrc/view/freifunk-map/frame.htm +++ b/modules/luci-mod-freifunk/luasrc/view/freifunk-map/frame.htm @@ -4,7 +4,7 @@ local has_latlon = false local uci = require "luci.model.uci".cursor() uci:foreach("olsrd", "LoadPlugin", function(s) - if s.library == "olsrd_nameservice.so.0.3" and s.latlon_file then + if s.library == "olsrd_nameservice" and s.latlon_file then has_latlon = true end end) diff --git a/modules/luci-mod-freifunk/luasrc/view/freifunk-map/map.htm b/modules/luci-mod-freifunk/luasrc/view/freifunk-map/map.htm index c3951f9c63..f69401d6e3 100644 --- a/modules/luci-mod-freifunk/luasrc/view/freifunk-map/map.htm +++ b/modules/luci-mod-freifunk/luasrc/view/freifunk-map/map.htm @@ -85,7 +85,7 @@ local uci = require "luci.model.uci".cursor() uci:foreach("olsrd", "LoadPlugin", function(s) - if s.library == "olsrd_nameservice.so.0.3" and s.latlon_file then + if s.library == "olsrd_nameservice" and s.latlon_file then fd = io.open(s.latlon_file) end end) diff --git a/modules/luci-mod-freifunk/luasrc/view/freifunk/adminindex.htm b/modules/luci-mod-freifunk/luasrc/view/freifunk/adminindex.htm index e0252ba891..a3f079716c 100644 --- a/modules/luci-mod-freifunk/luasrc/view/freifunk/adminindex.htm +++ b/modules/luci-mod-freifunk/luasrc/view/freifunk/adminindex.htm @@ -1,22 +1,15 @@ <%+header%> <% local uci = require "luci.model.uci".cursor() -local contact = uci:get_all("freifunk", "contact") +local nickname = uci:get("freifunk", "contact", "nickname") or "" +local name = uci:get("freifunk", "contact", "name") or "" +local mail = uci:get("freifunk", "contact", "mail") or "" local contacturl = luci.dispatcher.build_url(luci.dispatcher.context.path[1], "freifunk", "contact") local hostname = uci:get_first ("system", "system", "hostname") local latitude = uci:get_first ("system", "system", "latitude") local longitude = uci:get_first ("system", "system", "longitude") local location = uci:get_first ("system", "system", "location") local basicsurl = luci.dispatcher.build_url(luci.dispatcher.context.path[1], "freifunk", "basics") -local nickname, name, mail -if not contact then - nickname, name, mail = "" -else - nickname = contact.nickname - name = contact.name - mail = contact.mail -end - %> <h2><%:Freifunk Overview%></h2> diff --git a/modules/luci-mod-freifunk/luasrc/view/freifunk/contact.htm b/modules/luci-mod-freifunk/luasrc/view/freifunk/contact.htm index dca35376cb..dececeff51 100644 --- a/modules/luci-mod-freifunk/luasrc/view/freifunk/contact.htm +++ b/modules/luci-mod-freifunk/luasrc/view/freifunk/contact.htm @@ -9,22 +9,15 @@ <% local uci = require "luci.model.uci".cursor() -local contact = uci:get_all("freifunk", "contact") -local nickname, name, mail, phone, location, note -local lon = uci:get_first("system", "system", "longitude") -local lat = uci:get_first("system", "system", "latitude") - -if not contact then - nickname, name, homepage, mail, phone, location, note = "" -else - nickname = contact.nickname or "" - name = contact.name or "" - homepage = contact.homepage or {} - mail = contact.mail or "" - phone = contact.phone or "" - location = uci:get_first("system", "system", "location") or contact.location - note = contact.note or "" -end +local nickname = uci:get("freifunk", "contact", "nickname") or "" +local name = uci:get("freifunk", "contact", "name") or "" +local homepage = uci:get("freifunk", "contact", "homepage") or {} +local mail = uci:get("freifunk", "contact", "mail") or "" +local phone = uci:get("freifunk", "contact", "phone") or "" +local location = uci:get_first("system", "system", "locaton") or uci:get("freifunk", "contact", "location") or "" +local note = uci:get("freifunk", "contact", "note") or "" +local lon = uci:get_first("system", "system", "longitude") or "" +local lat = uci:get_first("system", "system", "latitude") or "" %> <h2 name="content"><%:Contact%></h2> 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" diff --git a/modules/luci-mod-freifunk/luasrc/view/freifunk/public_status.htm b/modules/luci-mod-freifunk/luasrc/view/freifunk/public_status.htm index a56e4826a9..572f8585d1 100644 --- a/modules/luci-mod-freifunk/luasrc/view/freifunk/public_status.htm +++ b/modules/luci-mod-freifunk/luasrc/view/freifunk/public_status.htm @@ -110,7 +110,6 @@ end <%+header%> -<script type="text/javascript" src="<%=resource%>/cbi.js"></script> <script type="text/javascript">//<![CDATA[ XHR.poll(<%=interval%> , '<%=REQUEST_URI%>', { status: 1 }, |