Browse Source

Adds ffho-config-mode-geo-location

Modified Version of gluon-config-mode-geo-location
Field for Altitude removed
Karsten Böddeker 8 years ago
parent
commit
a63b1eada8

+ 36 - 0
ffpb/ffho-config-mode-geo-location/Makefile

@@ -0,0 +1,36 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=ffho-config-mode-geo-location
+PKG_VERSION:=1
+
+PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
+
+include $(GLUONDIR)/include/package.mk
+
+PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
+
+
+define Package/ffho-config-mode-geo-location
+  SECTION:=gluon
+  CATEGORY:=Gluon
+  TITLE:=Set geographic location of a node
+  DEPENDS:=gluon-config-mode-core-virtual +gluon-node-info
+endef
+
+define Build/Prepare
+	mkdir -p $(PKG_BUILD_DIR)
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+	$(call GluonBuildI18N,ffho-config-mode-geo-location,i18n)
+endef
+
+define Package/ffho-config-mode-geo-location/install
+	$(CP) ./files/* $(1)/
+	$(call GluonInstallI18N,ffho-config-mode-geo-location,$(1))
+endef
+
+$(eval $(call BuildPackage,ffho-config-mode-geo-location))

+ 46 - 0
ffpb/ffho-config-mode-geo-location/files/lib/gluon/config-mode/wizard/0400-geo-location.lua

@@ -0,0 +1,46 @@
+local cbi = require "luci.cbi"
+local i18n = require "luci.i18n"
+local uci = luci.model.uci.cursor()
+
+local M = {}
+
+function M.section(form)
+  local s = form:section(cbi.SimpleSection, nil, i18n.translate(
+    'If you want the location of your node to be displayed on the map, '
+      .. 'you can enter its coordinates here.'))
+
+
+  local o
+
+  o = s:option(cbi.Flag, "_location", i18n.translate("Show node on the map"))
+  o.default = uci:get_first("gluon-node-info", "location", "share_location", o.disabled)
+  o.rmempty = false
+
+  o = s:option(cbi.Value, "_latitude", i18n.translate("Latitude"))
+  o.default = uci:get_first("gluon-node-info", "location", "latitude")
+  o:depends("_location", "1")
+  o.rmempty = false
+  o.datatype = "float"
+  o.description = i18n.translatef("e.g. %s", "53.873621")
+
+  o = s:option(cbi.Value, "_longitude", i18n.translate("Longitude"))
+  o.default = uci:get_first("gluon-node-info", "location", "longitude")
+  o:depends("_location", "1")
+  o.rmempty = false
+  o.datatype = "float"
+  o.description = i18n.translatef("e.g. %s", "10.689901")
+end
+
+function M.handle(data)
+  local sname = uci:get_first("gluon-node-info", "location")
+
+  uci:set("gluon-node-info", sname, "share_location", data._location)
+  if data._location and data._latitude ~= nil and data._longitude ~= nil then
+    uci:set("gluon-node-info", sname, "latitude", data._latitude)
+    uci:set("gluon-node-info", sname, "longitude", data._longitude)
+  end
+  uci:save("gluon-node-info")
+  uci:commit("gluon-node-info")
+end
+
+return M

+ 30 - 0
ffpb/ffho-config-mode-geo-location/i18n/de.po

@@ -0,0 +1,30 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: ffho-config-mode-geo-location\n"
+"PO-Revision-Date: 2015-10-23 14:45+0200\n"
+"Last-Translator: Karsten Böddeker <freifunk@kb-light.de>\n"
+"Language-Team: German\n"
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgid ""
+"If you want the location of your node to be displayed on the map, you can "
+"enter its coordinates here."
+msgstr ""
+"Um deinen Knoten auf der Karte anzeigen zu können, benötigen wir seine "
+"Koordinaten. Hier hast du die Möglichkeit, diese zu hinterlegen."
+
+msgid "Latitude"
+msgstr "Breitengrad"
+
+msgid "Longitude"
+msgstr "Längengrad"
+
+msgid "Show node on the map"
+msgstr "Knoten auf der Karte anzeigen"
+
+msgid "e.g. %s"
+msgstr "z.B. %s"

+ 19 - 0
ffpb/ffho-config-mode-geo-location/i18n/ffho-config-mode-geo-location.pot

@@ -0,0 +1,19 @@
+msgid ""
+msgstr "Content-Type: text/plain; charset=UTF-8"
+
+msgid ""
+"If you want the location of your node to be displayed on the map, you can "
+"enter its coordinates here."
+msgstr ""
+
+msgid "Latitude"
+msgstr ""
+
+msgid "Longitude"
+msgstr ""
+
+msgid "Show node on the map"
+msgstr ""
+
+msgid "e.g. %s"
+msgstr ""