From 5c121c16084cbfde46a0bebde384402ab45f528c Mon Sep 17 00:00:00 2001
From: Matthias Schiffer <mschiffer@universe-factory.net>
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/package/gluon-config-mode/files/usr/lib/lua/luci/controller/gluon-config-mode/index.lua b/package/gluon-config-mode/files/usr/lib/lua/luci/controller/gluon-config-mode/index.lua
index 8803dde67..731ed73b4 100644
--- a/package/gluon-config-mode/files/usr/lib/lua/luci/controller/gluon-config-mode/index.lua
+++ b/package/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/package/gluon-config-mode/files/usr/lib/lua/luci/view/gluon-config-mode/cbi/wizard.htm b/package/gluon-config-mode/files/usr/lib/lua/luci/view/gluon-config-mode/cbi/wizard.htm
index db5fe8b09..cadfb0069 100644
--- a/package/gluon-config-mode/files/usr/lib/lua/luci/view/gluon-config-mode/cbi/wizard.htm
+++ b/package/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'
 -%>
 
 <h2>Willkommen!</h2>
 <p>
-	<%= site.config_mode.msg_welcome %>
+	<%= template.render_string(site.config_mode.msg_welcome, {hostname=hostname, sysconfig=sysconfig}) %>
 </p>
 
 <% if not self.embedded then %>
diff --git a/package/gluon-config-mode/files/usr/lib/lua/luci/view/gluon-config-mode/reboot.htm b/package/gluon-config-mode/files/usr/lib/lua/luci/view/gluon-config-mode/reboot.htm
index 238da2753..db9cbc231 100644
--- a/package/gluon-config-mode/files/usr/lib/lua/luci/view/gluon-config-mode/reboot.htm
+++ b/package/gluon-config-mode/files/usr/lib/lua/luci/view/gluon-config-mode/reboot.htm
@@ -13,17 +13,17 @@
         <% if pubkey then %>
         <fieldset class="cbi-section">
           <p>
-            <%= site.config_mode.msg_pubkey %>
+            <%= luci.template.render_string(site.config_mode.msg_pubkey) %>
           </p>
           <div class="the-key">
-            # Hostname: <%= hostname %>
+            # <%= hostname %>
             <br/>
             <%= pubkey %>
           </div>
         </fieldset>
         <% end %>
         <fieldset class="cbi-section">
-          <%= site.config_mode.msg_reboot %>
+          <%= luci.template.render_string(site.config_mode.msg_reboot) %>
         </fieldset>
       </div>
     </div>
-- 
GitLab