From cc90b4ec42ab09ae7bbbdddab2d3defa71049db2 Mon Sep 17 00:00:00 2001
From: Kathrin Osswald <kathrin.osswald@uni-ulm.de>
Date: Mon, 28 Oct 2019 13:23:25 +0100
Subject: [PATCH] Adjusted loginform.mustache template due to upstream changes
 in Moodle core.

---
 CHANGES.md                            |  1 +
 templates/loginform.mustache          | 24 +++++++++++++++++++++---
 templates/loginform.mustache.original | 24 +++++++++++++++++++++---
 3 files changed, 43 insertions(+), 6 deletions(-)

diff --git a/CHANGES.md b/CHANGES.md
index f08b5a9..1598fe1 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -6,6 +6,7 @@ Changes
 
 ### Unreleased
 
+* 2019-10-28 - Adjusted loginform.mustache template due to upstream changes in Moodle core.
 * 2019-10-28 - Adjusted function favicon() in core_renderer.php due to upstream changes in Moodle core.
 * 2019-10-28 - Removed CSS rule for maintenance warning due to upstream changes.
 
diff --git a/templates/loginform.mustache b/templates/loginform.mustache
index a387d5a..552c0f0 100644
--- a/templates/loginform.mustache
+++ b/templates/loginform.mustache
@@ -38,8 +38,9 @@
     * cookieshelpiconformatted - Formatted html of cookies help icon,
     * errorformatted - Formatted error,
     * logourl - Flag, logo url,
-    * sitename - Name of site.
-    * logintoken - Random token to protect login request.
+    * sitename - Name of site.,
+    * logintoken - Random token to protect login request.,
+    * maintenance - Maintenance message
 
     Example context (json):
     {
@@ -89,7 +90,8 @@
         "errorformatted": "",
         "logourl": false,
         "sitename": "Beer & Chips",
-        "logintoken": "randomstring"
+        "logintoken": "randomstring",
+        "maintenance": "For full access to this site, you need to login in as an admin."
     }
 }}
 {{! MODIFICATION:
@@ -228,6 +230,22 @@
     </div>
 {{/hasinstructions}}
 
+{{#maintenance}}
+    <div class="row justify-content-center mt-3">
+        <div class="col-xl-6 col-sm-8">
+            <div class="card">
+                <div class="card-body">
+                    <div class="card-title">
+                        <h2>{{#str}}sitemaintenance, core_admin{{/str}}</h2>
+                    </div>
+                    <div>
+                        {{{maintenance}}}
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+{{/maintenance}}
 {{#js}}
     {{#error}}
         require(['jquery'], function($) {
diff --git a/templates/loginform.mustache.original b/templates/loginform.mustache.original
index 5f80666..27b8ec5 100644
--- a/templates/loginform.mustache.original
+++ b/templates/loginform.mustache.original
@@ -38,8 +38,9 @@
     * cookieshelpiconformatted - Formatted html of cookies help icon,
     * errorformatted - Formatted error,
     * logourl - Flag, logo url,
-    * sitename - Name of site.
-    * logintoken - Random token to protect login request.
+    * sitename - Name of site.,
+    * logintoken - Random token to protect login request.,
+    * maintenance - Maintenance message
 
     Example context (json):
     {
@@ -89,7 +90,8 @@
         "errorformatted": "",
         "logourl": false,
         "sitename": "Beer & Chips",
-        "logintoken": "randomstring"
+        "logintoken": "randomstring",
+        "maintenance": "For full access to this site, you need to login in as an admin."
     }
 }}
 
@@ -224,6 +226,22 @@
 </div>
 {{/hasinstructions}}
 
+{{#maintenance}}
+    <div class="row justify-content-center mt-3">
+        <div class="col-xl-6 col-sm-8">
+            <div class="card">
+                <div class="card-body">
+                    <div class="card-title">
+                        <h2>{{#str}}sitemaintenance, core_admin{{/str}}</h2>
+                    </div>
+                    <div>
+                        {{{maintenance}}}
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+{{/maintenance}}
 {{#js}}
     {{#error}}
         require(['jquery'], function($) {
-- 
GitLab