Skip to content
Snippets Groups Projects
Commit d20266b4 authored by FFS-Roland's avatar FFS-Roland
Browse files
parents f69f9034 8423c810
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@ PKG_VERSION:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(GLUONDIR)/include/package.mk
include $(TOPDIR)/../package/gluon.mk
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
......
......@@ -5,7 +5,7 @@ PKG_VERSION:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(GLUONDIR)/include/package.mk
include $(TOPDIR)/../package/gluon.mk
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
......
......@@ -5,7 +5,7 @@ PKG_VERSION:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(GLUONDIR)/include/package.mk
include $(TOPDIR)/../package/gluon.mk
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
......
......@@ -6,7 +6,7 @@ PKG_VERSION:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
PKG_BUILD_DEPENDS := respondd
include $(GLUONDIR)/include/package.mk
include $(TOPDIR)/../package/gluon.mk
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
......@@ -15,7 +15,7 @@ define Package/gluon-config-mode-zip
SECTION:=gluon
CATEGORY:=Gluon
TITLE:=Set ZIP-Code location of a node
DEPENDS:=gluon-config-mode-core-virtual +gluon-node-info
DEPENDS:=+gluon-config-mode-core +gluon-node-info
endef
define Build/Prepare
......
local cbi = require "luci.cbi"
local i18n = require "luci.i18n"
local uci = luci.model.uci.cursor()
local M = {}
return function(form, uci)
local location = uci:get_first("gluon-node-info", "location")
local text = translate("gluon-config-mode:zip-help")
function M.section(form)
local text = i18n.translate("gluon-config-mode:zip-help")
local fieldlabel = i18n.translate("ZIP-Code")
local s = form:section(cbi.SimpleSection, nil, text)
local s = form:section(Section, nil, text)
local o = s:option(cbi.Value, "_zip", fieldlabel)
o.value = uci:get_first("gluon-node-info", "location", "zip")
o.rmempty = true
local o = s:option(Value, "zip", translate("ZIP-Code"), translatef("e.g. %s", "70499"))
o.default = uci:get("gluon-node-info", location, "zip")
o.datatype = "uinteger"
o.description = i18n.translatef("e.g. %s", "70499")
o.optional = true
function o:write(data)
uci:set("gluon-node-info", location, "zip", data)
end
function M.handle(data)
local sname = uci:get_first("gluon-node-info", "location")
if data._zip ~= nil then
uci:set("gluon-node-info", sname, "zip", data._zip:trim())
else
uci:delete("gluon-node-info", sname, "zip")
end
uci:save("gluon-node-info")
uci:commit("gluon-node-info")
return {'gluon-node-info'}
end
\ No newline at end of file
return M
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment