From f07cb88c57ab9802f4f116bacbc37beeec5ac1c2 Mon Sep 17 00:00:00 2001 From: Dan Poltawski Date: Thu, 13 Oct 2016 17:58:30 +0100 Subject: [PATCH] MDL-56448 mustache: fix json errors in example context --- .../templates/course_competency_statistics.mustache | 8 ++++---- admin/tool/lp/templates/template_statistics.mustache | 12 ++++++------ lib/templates/modal.mustache | 2 +- message/templates/message_preferences.mustache | 6 +++--- .../templates/message_preferences_component.mustache | 6 +++--- ...ssage_preferences_notification_processor.mustache | 6 +++--- message/templates/notification_preferences.mustache | 8 ++++---- .../notification_preferences_component.mustache | 8 ++++---- ...ation_preferences_component_notification.mustache | 2 +- .../notification_preferences_processor.mustache | 2 +- mod/assign/templates/grading_actions.mustache | 1 - mod/assign/templates/grading_app.mustache | 1 - mod/assign/templates/grading_navigation.mustache | 1 - .../grading_navigation_user_selector.mustache | 1 - .../grading_navigation_user_summary.mustache | 2 +- mod/assign/templates/grading_panel.mustache | 1 - search/templates/result.mustache | 6 +++--- theme/boost/templates/core/modal.mustache | 2 +- theme/boost/templates/core/pix_icon.mustache | 3 ++- .../templates/mod_assign/grading_actions.mustache | 1 - .../templates/mod_assign/grading_navigation.mustache | 1 - .../grading_navigation_user_selector.mustache | 1 - 22 files changed, 37 insertions(+), 44 deletions(-) diff --git a/admin/tool/lp/templates/course_competency_statistics.mustache b/admin/tool/lp/templates/course_competency_statistics.mustache index 437bd53e9c1..bb4a267d81e 100644 --- a/admin/tool/lp/templates/course_competency_statistics.mustache +++ b/admin/tool/lp/templates/course_competency_statistics.mustache @@ -32,10 +32,10 @@ Example context (json): { - competencycount: 4, - proficientcompetencycount: 3, - proficientcompetencypercentage: 75, - proficientcompetencypercentageformatted: 75.0 + "competencycount": 4, + "proficientcompetencycount": 3, + "proficientcompetencypercentage": 75, + "proficientcompetencypercentageformatted": 75.0 } }} diff --git a/admin/tool/lp/templates/template_statistics.mustache b/admin/tool/lp/templates/template_statistics.mustache index 91b45127d45..85b738fcd1b 100644 --- a/admin/tool/lp/templates/template_statistics.mustache +++ b/admin/tool/lp/templates/template_statistics.mustache @@ -32,12 +32,12 @@ Example context (json): { - linkedcompetencycount: 4, - competencycount: 8, - linkedcompetencypercentage: 50, - plancount: 40, - completedplancount: 30, - completedplanpercentage: 75, + "linkedcompetencycount": 4, + "competencycount": 8, + "linkedcompetencypercentage": 50, + "plancount": 40, + "completedplancount": 30, + "completedplanpercentage": 75 } }} diff --git a/lib/templates/modal.mustache b/lib/templates/modal.mustache index 7db14072ab8..d8c4b70dafc 100644 --- a/lib/templates/modal.mustache +++ b/lib/templates/modal.mustache @@ -36,7 +36,7 @@ { "title": "Example modal", "body": "Some example content for the body", - "footer": "Footer text, right here!", + "footer": "Footer text, right here!" } }} diff --git a/message/templates/message_preferences.mustache b/message/templates/message_preferences.mustache index e1cfb217f44..43e2ea9e8f5 100644 --- a/message/templates/message_preferences.mustache +++ b/message/templates/message_preferences.mustache @@ -52,14 +52,14 @@ "name": "loggedin", "displayname": "When I'm logged in", "checked": 0, - "disableall": 0, + "disableall": 0 }, "loggedoff": { "name": "loggedoff", "displayname": "When I'm offline", "checked": 0, - "disableall": 0, - }, + "disableall": 0 + } } ] } diff --git a/message/templates/message_preferences_component.mustache b/message/templates/message_preferences_component.mustache index 5047b710cfa..1cf3fc6a8a5 100644 --- a/message/templates/message_preferences_component.mustache +++ b/message/templates/message_preferences_component.mustache @@ -46,14 +46,14 @@ "name": "loggedin", "displayname": "When I'm logged in", "checked": 0, - "disableall": 0, + "disableall": 0 }, "loggedoff": { "name": "loggedoff", "displayname": "When I'm offline", "checked": 0, - "disableall": 0, - }, + "disableall": 0 + } } ] } diff --git a/message/templates/message_preferences_notification_processor.mustache b/message/templates/message_preferences_notification_processor.mustache index 8ab1f8dc7d4..0e35d4a4b86 100644 --- a/message/templates/message_preferences_notification_processor.mustache +++ b/message/templates/message_preferences_notification_processor.mustache @@ -46,14 +46,14 @@ "name": "loggedin", "displayname": "When I'm logged in", "checked": 0, - "disableall": 0, + "disableall": 0 }, "loggedoff": { "name": "loggedoff", "displayname": "When I'm offline", "checked": 0, - "disableall": 0, - }, + "disableall": 0 + } } ] } diff --git a/message/templates/notification_preferences.mustache b/message/templates/notification_preferences.mustache index 8a82b39ff39..ac4b959f773 100644 --- a/message/templates/notification_preferences.mustache +++ b/message/templates/notification_preferences.mustache @@ -40,7 +40,7 @@ "processors": [ { "onlinehelphtml": "

help button HTML

", - "offlinehelphtml": "

help button HTML

", + "offlinehelphtml": "

help button HTML

" } ], "notifications": [ @@ -57,14 +57,14 @@ "name": "loggedin", "displayname": "When I'm logged in", "checked": 0, - "disableall": 0, + "disableall": 0 }, "loggedoff": { "name": "loggedoff", "displayname": "When I'm offline", "checked": 0, - "disableall": 0, - }, + "disableall": 0 + } } ] } diff --git a/message/templates/notification_preferences_component.mustache b/message/templates/notification_preferences_component.mustache index 313729b8331..c220e719624 100644 --- a/message/templates/notification_preferences_component.mustache +++ b/message/templates/notification_preferences_component.mustache @@ -36,7 +36,7 @@ "processors": [ { "onlinehelphtml": "

help button HTML

", - "offlinehelphtml": "

help button HTML

", + "offlinehelphtml": "

help button HTML

" } ], "notifications": [ @@ -53,14 +53,14 @@ "name": "loggedin", "displayname": "When I'm logged in", "checked": 0, - "disableall": 0, + "disableall": 0 }, "loggedoff": { "name": "loggedoff", "displayname": "When I'm offline", "checked": 0, - "disableall": 0, - }, + "disableall": 0 + } } ] } diff --git a/message/templates/notification_preferences_component_notification.mustache b/message/templates/notification_preferences_component_notification.mustache index ca33fd84018..acc39f8d373 100644 --- a/message/templates/notification_preferences_component_notification.mustache +++ b/message/templates/notification_preferences_component_notification.mustache @@ -50,7 +50,7 @@ "displayname": "When I'm offline", "checked": 0, "iconurl": "some url" - }, + } } ] } diff --git a/message/templates/notification_preferences_processor.mustache b/message/templates/notification_preferences_processor.mustache index b772f82b9f4..b030b51efa6 100644 --- a/message/templates/notification_preferences_processor.mustache +++ b/message/templates/notification_preferences_processor.mustache @@ -38,7 +38,7 @@ "name": "popup", "hassettings": 1, "userid": 3, - "contextid": 3, + "contextid": 3 } }} diff --git a/mod/assign/templates/grading_actions.mustache b/mod/assign/templates/grading_actions.mustache index 28c89f1e0fd..5118bc0da04 100644 --- a/mod/assign/templates/grading_actions.mustache +++ b/mod/assign/templates/grading_actions.mustache @@ -28,7 +28,6 @@ Context variables required for this template: * see mod/assign/classes/output/grading_app.php - Example context (json): This template is initially hidden, and is only displayed after the current user info has been loaded. }}
diff --git a/mod/assign/templates/grading_app.mustache b/mod/assign/templates/grading_app.mustache index 23f192be6be..60d2ec26a8d 100644 --- a/mod/assign/templates/grading_app.mustache +++ b/mod/assign/templates/grading_app.mustache @@ -28,7 +28,6 @@ Context variables required for this template: * see mod/assign/classes/output/grading_app.php - Example context (json): This template includes ajax functionality, so it cannot be shown in the template library. }}
diff --git a/mod/assign/templates/grading_navigation.mustache b/mod/assign/templates/grading_navigation.mustache index 4b107deec3f..bd1abf5f3ac 100644 --- a/mod/assign/templates/grading_navigation.mustache +++ b/mod/assign/templates/grading_navigation.mustache @@ -28,7 +28,6 @@ Context variables required for this template: * see mod/assign/classes/output/grading_app.php - Example context (json): This template includes ajax functionality, so it cannot be shown in the template library. }} diff --git a/mod/assign/templates/grading_navigation_user_selector.mustache b/mod/assign/templates/grading_navigation_user_selector.mustache index 79835b1e44a..888da9f875b 100644 --- a/mod/assign/templates/grading_navigation_user_selector.mustache +++ b/mod/assign/templates/grading_navigation_user_selector.mustache @@ -28,7 +28,6 @@ Context variables required for this template: * see mod/assign/classes/output/grading_app.php - Example context (json): This template uses ajax functionality, so it cannot be shown in the template library. }} {{{larrow}}} diff --git a/mod/assign/templates/grading_navigation_user_summary.mustache b/mod/assign/templates/grading_navigation_user_summary.mustache index 49ee55c3ff7..864e05dcd01 100644 --- a/mod/assign/templates/grading_navigation_user_summary.mustache +++ b/mod/assign/templates/grading_navigation_user_summary.mustache @@ -33,7 +33,7 @@ "id": "5", "fullname": "Mr T", "hasidentity": true, - "identity": "t@example.org, T" + "identity": "t@example.org, T", "profileimageurl": "https://moodle.org/pix/u/f3.png" } }} diff --git a/mod/assign/templates/grading_panel.mustache b/mod/assign/templates/grading_panel.mustache index 7ac97dfb649..afc6a9dced0 100644 --- a/mod/assign/templates/grading_panel.mustache +++ b/mod/assign/templates/grading_panel.mustache @@ -28,7 +28,6 @@ Context variables required for this template: * None - Example context (json): This template loads it's content via ajax, so it cannot be shown in the template library. }} {{> mod_assign/loading }} diff --git a/search/templates/result.mustache b/search/templates/result.mustache index dc276950e39..331c7a340a8 100644 --- a/search/templates/result.mustache +++ b/search/templates/result.mustache @@ -49,15 +49,15 @@ "title": "Example title", "docurl": "https://example.com/mod/example/view.php?id=4", "content": "I am content", - "contexturl": "https://example.com/mod/example/view.php?id=2" + "contexturl": "https://example.com/mod/example/view.php?id=2", "userurl": "https://example.com/user/profile.php?id=3", "userfullname": "Example User Full Name", "multiplefiles": true, "filenames": - { + [ "file1.txt", "file2.txt" - } + ] } }}
diff --git a/theme/boost/templates/core/modal.mustache b/theme/boost/templates/core/modal.mustache index f0635ddc759..57ebbfdde32 100644 --- a/theme/boost/templates/core/modal.mustache +++ b/theme/boost/templates/core/modal.mustache @@ -36,7 +36,7 @@ { "title": "Example modal", "body": "Some example content for the body", - "footer": "Footer text, right here!", + "footer": "Footer text, right here!" } }} diff --git a/theme/boost/templates/core/pix_icon.mustache b/theme/boost/templates/core/pix_icon.mustache index 78634da8ba2..fd62cd415e4 100644 --- a/theme/boost/templates/core/pix_icon.mustache +++ b/theme/boost/templates/core/pix_icon.mustache @@ -33,7 +33,8 @@ Example context (json): { "attributes": [ - { "name": "src", "value": "http://moodle.com/wp-content/themes/moodle/images/logo-hat2.png" }, + {"name": "src", "value": "http://moodle.com/wp-content/themes/moodle/images/logo-hat2.png"}, + {"name": "alt", "value": "Alt text for icon"} ] } diff --git a/theme/boost/templates/mod_assign/grading_actions.mustache b/theme/boost/templates/mod_assign/grading_actions.mustache index 203ba174083..34889dce09c 100644 --- a/theme/boost/templates/mod_assign/grading_actions.mustache +++ b/theme/boost/templates/mod_assign/grading_actions.mustache @@ -28,7 +28,6 @@ Context variables required for this template: * see mod/assign/classes/output/grading_app.php - Example context (json): This template is initially hidden, and is only displayed after the current user info has been loaded. }} {{#showreview}} diff --git a/theme/boost/templates/mod_assign/grading_navigation.mustache b/theme/boost/templates/mod_assign/grading_navigation.mustache index bc769ab8791..91bb1a592c8 100644 --- a/theme/boost/templates/mod_assign/grading_navigation.mustache +++ b/theme/boost/templates/mod_assign/grading_navigation.mustache @@ -28,7 +28,6 @@ Context variables required for this template: * see mod/assign/classes/output/grading_app.php - Example context (json): This template includes ajax functionality, so it cannot be shown in the template library. }}
diff --git a/theme/boost/templates/mod_assign/grading_navigation_user_selector.mustache b/theme/boost/templates/mod_assign/grading_navigation_user_selector.mustache index 6b3c59ef85d..8906fa88fa2 100644 --- a/theme/boost/templates/mod_assign/grading_navigation_user_selector.mustache +++ b/theme/boost/templates/mod_assign/grading_navigation_user_selector.mustache @@ -28,7 +28,6 @@ Context variables required for this template: * see mod/assign/classes/output/grading_app.php - Example context (json): This template uses ajax functionality, so it cannot be shown in the template library. }} {{{larrow}}}