From d1cd4a7f53603b08036dcf7b7a11bba267a7b28b Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 16 May 2014 12:36:01 +0200 Subject: [PATCH] gluon-config-mode: allow using templates for texts again --- .../usr/lib/lua/luci/controller/gluon-config-mode/index.lua | 2 +- .../usr/lib/lua/luci/view/gluon-config-mode/cbi/wizard.htm | 4 +++- .../usr/lib/lua/luci/view/gluon-config-mode/reboot.htm | 6 +++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/gluon/gluon-config-mode/files/usr/lib/lua/luci/controller/gluon-config-mode/index.lua b/gluon/gluon-config-mode/files/usr/lib/lua/luci/controller/gluon-config-mode/index.lua index 8803dde..731ed73 100644 --- a/gluon/gluon-config-mode/files/usr/lib/lua/luci/controller/gluon-config-mode/index.lua +++ b/gluon/gluon-config-mode/files/usr/lib/lua/luci/controller/gluon-config-mode/index.lua @@ -64,7 +64,7 @@ function action_reboot() if nixio.fork() ~= 0 then luci.template.render("gluon-config-mode/reboot", - {pubkey=pubkey, hostname=hostname, site=site}) + {luci=luci, pubkey=pubkey, hostname=hostname, site=site}) else debug.setfenv(io.stdout, debug.getfenv(io.open '/dev/null')) io.stdout:close() diff --git a/gluon/gluon-config-mode/files/usr/lib/lua/luci/view/gluon-config-mode/cbi/wizard.htm b/gluon/gluon-config-mode/files/usr/lib/lua/luci/view/gluon-config-mode/cbi/wizard.htm index db5fe8b..cadfb00 100644 --- a/gluon/gluon-config-mode/files/usr/lib/lua/luci/view/gluon-config-mode/cbi/wizard.htm +++ b/gluon/gluon-config-mode/files/usr/lib/lua/luci/view/gluon-config-mode/cbi/wizard.htm @@ -1,10 +1,12 @@ <%- local site = require 'gluon.site_config' + local sysconfig = require 'gluon.sysconfig' + local template = require 'luci.template' -%>

Willkommen!

- <%= site.config_mode.msg_welcome %> + <%= template.render_string(site.config_mode.msg_welcome, {hostname=hostname, sysconfig=sysconfig}) %>

<% if not self.embedded then %> diff --git a/gluon/gluon-config-mode/files/usr/lib/lua/luci/view/gluon-config-mode/reboot.htm b/gluon/gluon-config-mode/files/usr/lib/lua/luci/view/gluon-config-mode/reboot.htm index 238da27..db9cbc2 100644 --- a/gluon/gluon-config-mode/files/usr/lib/lua/luci/view/gluon-config-mode/reboot.htm +++ b/gluon/gluon-config-mode/files/usr/lib/lua/luci/view/gluon-config-mode/reboot.htm @@ -13,17 +13,17 @@ <% if pubkey then %>

- <%= site.config_mode.msg_pubkey %> + <%= luci.template.render_string(site.config_mode.msg_pubkey) %>

- # Hostname: <%= hostname %> + # <%= hostname %>
<%= pubkey %>
<% end %>
- <%= site.config_mode.msg_reboot %> + <%= luci.template.render_string(site.config_mode.msg_reboot) %>