From 7ae3fc5478312e6213d33b6300626eeb8cde9a5f Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 25 May 2009 13:53:31 +0000 Subject: modules/freifunk: add map --- .../luci-static/resources/freifunk-map/hna.gif | Bin 0 -> 209 bytes .../luci-static/resources/freifunk-map/node.gif | Bin 0 -> 209 bytes .../luasrc/controller/freifunk/freifunk.lua | 3 + .../freifunk/luasrc/view/freifunk-map/frame.htm | 21 +++++ modules/freifunk/luasrc/view/freifunk-map/map.htm | 97 +++++++++++++++++++++ 5 files changed, 121 insertions(+) create mode 100644 modules/freifunk/htdocs/luci-static/resources/freifunk-map/hna.gif create mode 100644 modules/freifunk/htdocs/luci-static/resources/freifunk-map/node.gif create mode 100644 modules/freifunk/luasrc/view/freifunk-map/frame.htm create mode 100644 modules/freifunk/luasrc/view/freifunk-map/map.htm (limited to 'modules') diff --git a/modules/freifunk/htdocs/luci-static/resources/freifunk-map/hna.gif b/modules/freifunk/htdocs/luci-static/resources/freifunk-map/hna.gif new file mode 100644 index 000000000..818780d15 Binary files /dev/null and b/modules/freifunk/htdocs/luci-static/resources/freifunk-map/hna.gif differ diff --git a/modules/freifunk/htdocs/luci-static/resources/freifunk-map/node.gif b/modules/freifunk/htdocs/luci-static/resources/freifunk-map/node.gif new file mode 100644 index 000000000..f64ab162a Binary files /dev/null and b/modules/freifunk/htdocs/luci-static/resources/freifunk-map/node.gif differ diff --git a/modules/freifunk/luasrc/controller/freifunk/freifunk.lua b/modules/freifunk/luasrc/controller/freifunk/freifunk.lua index 6c8911b76..fd61bb3bd 100644 --- a/modules/freifunk/luasrc/controller/freifunk/freifunk.lua +++ b/modules/freifunk/luasrc/controller/freifunk/freifunk.lua @@ -71,6 +71,9 @@ function index() page.target = cbi("freifunk/contact") page.title = "Kontakt" page.order = 40 + + entry({"freifunk", "map"}, template("freifunk-map/frame"), translate("freifunk_map", "Karte"), 50) + entry({"freifunk", "map", "content"}, template("freifunk-map/map"), nil, 51) end local function fetch_olsrd() diff --git a/modules/freifunk/luasrc/view/freifunk-map/frame.htm b/modules/freifunk/luasrc/view/freifunk-map/frame.htm new file mode 100644 index 000000000..9ec4f1c5d --- /dev/null +++ b/modules/freifunk/luasrc/view/freifunk-map/frame.htm @@ -0,0 +1,21 @@ +<%+header%> + +<% + 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 + has_latlon = true + end + end) +%> + +<% if has_latlon then %> + +<% else %> +

<%:freifunk_map_error Map Error%>

+

<%:freifunk_map_nodata The OLSRd service is not configured to capture position data from the network.
+ Please make sure that the nameservice plugin is properly configured and that the latlon_file option is enabled.%>

+<% end %> + +<%+footer%> diff --git a/modules/freifunk/luasrc/view/freifunk-map/map.htm b/modules/freifunk/luasrc/view/freifunk-map/map.htm new file mode 100644 index 000000000..7ecf49521 --- /dev/null +++ b/modules/freifunk/luasrc/view/freifunk-map/map.htm @@ -0,0 +1,97 @@ + + + + Map + + + + + +
+ + -- cgit v1.2.3