From c2b3975964ebeefc9b3437a851ca78c84d56e96b Mon Sep 17 00:00:00 2001 From: Jan-Tarek Butt <buttjantarek@googlemail.com> Date: Sat, 18 Jul 2015 10:27:41 +0200 Subject: [PATCH] add package ffnw-config-mode-contact-info --- ffnw-config-mode-contact-info/Makefile | 36 +++++++++++++++++++ .../config-mode/wizard/0500-contact-info.lua | 34 ++++++++++++++++++ ffnw-config-mode-contact-info/i18n/de.po | 27 ++++++++++++++ .../i18n/gluon-config-mode-contact-info.pot | 14 ++++++++ 4 files changed, 111 insertions(+) create mode 100644 ffnw-config-mode-contact-info/Makefile create mode 100644 ffnw-config-mode-contact-info/files/lib/gluon/config-mode/wizard/0500-contact-info.lua create mode 100644 ffnw-config-mode-contact-info/i18n/de.po create mode 100644 ffnw-config-mode-contact-info/i18n/gluon-config-mode-contact-info.pot diff --git a/ffnw-config-mode-contact-info/Makefile b/ffnw-config-mode-contact-info/Makefile new file mode 100644 index 0000000..a640d93 --- /dev/null +++ b/ffnw-config-mode-contact-info/Makefile @@ -0,0 +1,36 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=ffnw-config-mode-contact-info +PKG_VERSION:=1 + +PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) + +include $(GLUONDIR)/include/package.mk + +PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG) + + +define Package/ffnw-config-mode-contact-info + SECTION:=gluon + CATEGORY:=Gluon + TITLE:=Set a custom string that will be distributed in the mesh. + DEPENDS:=gluon-config-mode-core-virtual +ffnw-node-info +endef + +define Build/Prepare + mkdir -p $(PKG_BUILD_DIR) +endef + +define Build/Configure +endef + +define Build/Compile + $(call GluonBuildI18N,ffnw-config-mode-contact-info,i18n) +endef + +define Package/ffnw-config-mode-contact-info/install + $(CP) ./files/* $(1)/ + $(call GluonInstallI18N,ffnw-config-mode-contact-info,$(1)) +endef + +$(eval $(call BuildPackage,ffnw-config-mode-contact-info)) diff --git a/ffnw-config-mode-contact-info/files/lib/gluon/config-mode/wizard/0500-contact-info.lua b/ffnw-config-mode-contact-info/files/lib/gluon/config-mode/wizard/0500-contact-info.lua new file mode 100644 index 0000000..a2182f9 --- /dev/null +++ b/ffnw-config-mode-contact-info/files/lib/gluon/config-mode/wizard/0500-contact-info.lua @@ -0,0 +1,34 @@ +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( + 'You can provide your contact information here to ' + .. 'allow others to contact you. Please note that ' + .. 'this information will be visible <em>publicly</em> ' + .. 'on the internet together with your node\'s coordinates.' + ) + ) + + local o = s:option(cbi.Value, "_contact", i18n.translate("Contact info")) + o.default = uci:get_first("gluon-node-info", "owner", "contact", "") + o.rmempty = true + o.datatype = "string" + o.description = i18n.translate("e.g. E-mail or phone number") + o.maxlen = 140 +end + +function M.handle(data) + if data._contact ~= nil then + uci:set("gluon-node-info", uci:get_first("gluon-node-info", "owner"), "contact", data._contact) + else + uci:delete("gluon-node-info", uci:get_first("gluon-node-info", "owner"), "contact") + end + uci:save("gluon-node-info") + uci:commit("gluon-node-info") +end + +return M diff --git a/ffnw-config-mode-contact-info/i18n/de.po b/ffnw-config-mode-contact-info/i18n/de.po new file mode 100644 index 0000000..719246f --- /dev/null +++ b/ffnw-config-mode-contact-info/i18n/de.po @@ -0,0 +1,27 @@ +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"PO-Revision-Date: 2015-03-19 01:32+0100\n" +"Last-Translator: Matthias Schiffer <mschiffer@universe-factory.net>\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 "Contact info" +msgstr "Kontakt" + +msgid "" +"You can provide your contact information here to allow others to contact " +"you. Please note that this information will be visible <em>publicly</em> on " +"the internet together with your node's coordinates." +msgstr "" +"Hier kannst du einen <em>öffentlichen</em> Hinweis hinterlegen, um anderen " +"zu ermöglichen, Kontakt mit dir aufzunehmen. Bitte beachte, dass " +"dieser Hinweis auch öffentlich im Internet, zusammen mit den Koordinaten " +"deines Knotens, einsehbar sein wird." + +msgid "e.g. E-mail or phone number" +msgstr "z.B. E-Mail oder Telefonnummer" diff --git a/ffnw-config-mode-contact-info/i18n/gluon-config-mode-contact-info.pot b/ffnw-config-mode-contact-info/i18n/gluon-config-mode-contact-info.pot new file mode 100644 index 0000000..63939a8 --- /dev/null +++ b/ffnw-config-mode-contact-info/i18n/gluon-config-mode-contact-info.pot @@ -0,0 +1,14 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8" + +msgid "Contact info" +msgstr "" + +msgid "" +"You can provide your contact information here to allow others to contact " +"you. Please note that this information will be visible <em>publicly</em> on " +"the internet together with your node's coordinates." +msgstr "" + +msgid "e.g. E-mail or phone number" +msgstr "" -- GitLab