From 5f0e1523f7e68ad949a711010d82c4b887614549 Mon Sep 17 00:00:00 2001 From: Dan Poltawski Date: Fri, 9 Dec 2016 12:17:39 +0000 Subject: [PATCH] MDL-57338 templates: add missing example context --- lib/templates/dataformat_selector.mustache | 13 +++++++++++-- lib/templates/email_fromname.mustache | 7 ++++++- lib/templates/email_html.mustache | 5 +++++ lib/templates/email_subject.mustache | 7 ++++++- lib/templates/email_text.mustache | 5 +++++ lib/templates/pix_icon.mustache | 5 +++-- 6 files changed, 36 insertions(+), 6 deletions(-) diff --git a/lib/templates/dataformat_selector.mustache b/lib/templates/dataformat_selector.mustache index e961ae1194d..6f5110161db 100644 --- a/lib/templates/dataformat_selector.mustache +++ b/lib/templates/dataformat_selector.mustache @@ -17,8 +17,7 @@ {{! @template core/dataformat_selector - Template for all html emails. Note that it may wrap content formatted - elsewhere in another a module template. + Template for dataformat selection and download form. Context variables required for this template: * label @@ -28,6 +27,16 @@ * options * sesskey * submit + + Example context (json): + { + "base": "http://example.org/", + "name": "test", + "label": "Download table data as", + "params": false, + "options": [{"label": "CSV", "name": "csv"}, {"label": "Excel", "name": "excel"}], + "submit": "Download" + } }}
diff --git a/lib/templates/email_fromname.mustache b/lib/templates/email_fromname.mustache index ec43023a985..8bb9803ab4c 100644 --- a/lib/templates/email_fromname.mustache +++ b/lib/templates/email_fromname.mustache @@ -15,7 +15,7 @@ along with Moodle. If not, see . }} {{! - @template core/email_html + @template core/email_fromname Template for all email subjects. @@ -31,5 +31,10 @@ * fromname * replyto * replytoname + + Example context (json): + { + "fromname": "Joe Bloggs" + } }} {{{fromname}}} diff --git a/lib/templates/email_html.mustache b/lib/templates/email_html.mustache index e8c1aaaf593..a8d93d98f7f 100644 --- a/lib/templates/email_html.mustache +++ b/lib/templates/email_html.mustache @@ -34,5 +34,10 @@ * replyto * replytoname * body + + Example context (json): + { + "body": "Email body" + } }} {{{body}}} diff --git a/lib/templates/email_subject.mustache b/lib/templates/email_subject.mustache index c67afdd263e..8454983e23d 100644 --- a/lib/templates/email_subject.mustache +++ b/lib/templates/email_subject.mustache @@ -15,7 +15,7 @@ along with Moodle. If not, see . }} {{! - @template core/email_html + @template core/email_subject Template for all email subjects. @@ -31,5 +31,10 @@ * fromname * replyto * replytoname + + Example context (json): + { + "subject": "Email subject" + } }} {{{subject}}} diff --git a/lib/templates/email_text.mustache b/lib/templates/email_text.mustache index 8ffc85a853d..7e537c11f32 100644 --- a/lib/templates/email_text.mustache +++ b/lib/templates/email_text.mustache @@ -33,5 +33,10 @@ * replyto * replytoname * body + + Example context (json): + { + "body": "Email body" + } }} {{{body}}} diff --git a/lib/templates/pix_icon.mustache b/lib/templates/pix_icon.mustache index 63cedac297f..034bc35ee65 100644 --- a/lib/templates/pix_icon.mustache +++ b/lib/templates/pix_icon.mustache @@ -33,8 +33,9 @@ Example context (json): { "attributes": [ - { "name": "src", "value": "http://moodle.com/wp-content/themes/moodle/images/logo-hat2.png" }, - { "name": "class", "value": "iconsmall" } + { "name": "src", "value": "https://moodle.org/logo/moodle-logo.svg" }, + { "name": "class", "value": "iconsmall" }, + {"name": "alt", "value": "Alt text for icon"} ] }