From c0213c617a224d3fae9715937916e68eb51b5aaa Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Thu, 30 Jan 2014 10:41:57 +0100 Subject: [PATCH] gluon-config-mode: show map when online --- .../model/cbi/gluon-config-mode/wizard.lua | 1 + .../luci/view/gluon-config-mode/cbi/map.htm | 98 +++++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 gluon/gluon-config-mode/files/usr/lib/lua/luci/view/gluon-config-mode/cbi/map.htm diff --git a/gluon/gluon-config-mode/files/usr/lib/lua/luci/model/cbi/gluon-config-mode/wizard.lua b/gluon/gluon-config-mode/files/usr/lib/lua/luci/model/cbi/gluon-config-mode/wizard.lua index d0caee7..84f963c 100644 --- a/gluon/gluon-config-mode/files/usr/lib/lua/luci/model/cbi/gluon-config-mode/wizard.lua +++ b/gluon/gluon-config-mode/files/usr/lib/lua/luci/model/cbi/gluon-config-mode/wizard.lua @@ -51,6 +51,7 @@ o.datatype = "integer" s = f:section(SimpleSection, nil, [[Um deinen Knoten auf der Karte anzeigen zu können benötigen wir seine Koordinaten. Hier hast du die Möglichkeit diese zu hinterlegen.]]) +s.template = "gluon-config-mode/cbi/map" o = s:option(Flag, "_location", "Knoten auf der Karte anzeigen") o.default = uci:get_first("gluon-locaton", "location", "share_location", o.disabled) diff --git a/gluon/gluon-config-mode/files/usr/lib/lua/luci/view/gluon-config-mode/cbi/map.htm b/gluon/gluon-config-mode/files/usr/lib/lua/luci/view/gluon-config-mode/cbi/map.htm new file mode 100644 index 0000000..7a89424 --- /dev/null +++ b/gluon/gluon-config-mode/files/usr/lib/lua/luci/view/gluon-config-mode/cbi/map.htm @@ -0,0 +1,98 @@ +
+ <% if self.title and #self.title > 0 then -%> + <%=self.title%> + <%- end %> + <% if self.description and #self.description > 0 then -%> +
<%=self.description%>
+ <%- end %> +
+
+ <% self:render_children(1, scope or {}) %> +
+ <% if self.error and self.error[1] then -%> +
+
    <% for _, e in ipairs(self.error[1]) do -%> +
  • + <%- if e == "invalid" then -%> + <%:One or more fields contain invalid values!%> + <%- elseif e == "missing" then -%> + <%:One or more required fields have no value!%> + <%- else -%> + <%=pcdata(e)%> + <%- end -%> +
  • + <%- end %>
+
+ <%- end %> + + + + + +
+ + +
+
+
+<%- + if type(self.hidden) == "table" then + for k, v in pairs(self.hidden) do +-%> + +<%- + end + end +%> +