MDL-66076 message: Add copy of template plus JS comment fix
authorMichael Hawkins <michaelh@moodle.com>
Wed, 9 Oct 2019 05:45:44 +0000 (13:45 +0800)
committerJun Pataleta <jun@moodle.com>
Fri, 11 Oct 2019 03:09:50 +0000 (11:09 +0800)
message/amd/build/message_send_bulk.min.js
message/amd/build/message_send_bulk.min.js.map
message/amd/src/message_send_bulk.js
message/templates/send_bulk_message.mustache [new file with mode: 0644]

index 124d648..9b4b767 100644 (file)
Binary files a/message/amd/build/message_send_bulk.min.js and b/message/amd/build/message_send_bulk.min.js differ
index 4b83000..7295857 100644 (file)
Binary files a/message/amd/build/message_send_bulk.min.js.map and b/message/amd/build/message_send_bulk.min.js.map differ
index 50c56ec..6d51015 100644 (file)
@@ -49,13 +49,13 @@ export const showModal = (users, callback = null) => {
 
     return ModalFactory.create({
         type: ModalFactory.types.SAVE_CANCEL,
-        body: Templates.render('core_user/send_bulk_message', {}),
+        body: Templates.render('core_message/send_bulk_message', {}),
         title: titlePromise,
     })
     .then(function(modal) {
         modal.setSaveButtonText(titlePromise);
 
-        // We want to focus on the action select when the dialog is closed.
+        // When the dialog is closed, perform the callback (if provided).
         modal.getRoot().on(ModalEvents.hidden, function() {
             if (callback) {
                 callback();
diff --git a/message/templates/send_bulk_message.mustache b/message/templates/send_bulk_message.mustache
new file mode 100644 (file)
index 0000000..752f172
--- /dev/null
@@ -0,0 +1,41 @@
+{{!
+    This file is part of Moodle - http://moodle.org/
+
+    Moodle is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    Moodle is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+}}
+{{!
+    @template core_message/send_bulk_message
+
+    Template for the send bulk message modal.
+
+    Context variables required for this template:
+      None
+
+    Example context (json):
+    {
+    }
+}}
+<form>
+<p>
+<label for="bulk-message">
+<span class="sr-only">{{#str}}message, core_message{{/str}}</span>
+</label>
+<textarea id="bulk-message" rows="3" data-max-rows="10" data-auto-rows="true" cols="30" class="form-control"></textarea>
+</p>
+</form>
+{{#js}}
+require(['core/auto_rows'], function(AutoRows) {
+    AutoRows.init(document.getElementById('bulk-message'));
+});
+{{/js}}