Merge branch 'MDL-57338-master' of git://github.com/danpoltawski/moodle
authorDavid Monllao <david.monllao@gmail.com>
Thu, 29 Dec 2016 09:44:01 +0000 (10:44 +0100)
committerDavid Monllao <david.monllao@gmail.com>
Thu, 29 Dec 2016 09:44:01 +0000 (10:44 +0100)
37 files changed:
lib/templates/action_menu.mustache
lib/templates/action_menu_item.mustache
lib/templates/action_menu_link.mustache
lib/templates/action_menu_trigger.mustache
lib/templates/actions.mustache
lib/templates/chart.mustache
lib/templates/chooser.mustache
lib/templates/chooser_item.mustache
lib/templates/dataformat_selector.mustache
lib/templates/email_fromname.mustache
lib/templates/email_html.mustache
lib/templates/email_subject.mustache
lib/templates/email_text.mustache
lib/templates/help_icon.mustache
lib/templates/hover_tooltip.mustache
lib/templates/loading.mustache
lib/templates/login.mustache
lib/templates/pix_icon.mustache
lib/templates/progress_bar.mustache
lib/templates/select_time.mustache
lib/templates/signup_form_layout.mustache
lib/templates/skip_links.mustache
message/templates/add_contact_button.mustache
message/templates/remove_contact_button.mustache
theme/boost/templates/admin_setting_tabs.mustache
theme/boost/templates/core/action_menu.mustache
theme/boost/templates/core/action_menu_item.mustache
theme/boost/templates/core/action_menu_link.mustache
theme/boost/templates/core/chooser.mustache
theme/boost/templates/core/dataformat_selector.mustache
theme/boost/templates/core/help_icon.mustache
theme/boost/templates/core/progress_bar.mustache
theme/boost/templates/core/select_time.mustache
theme/boost/templates/core/signup_form_layout.mustache
theme/boost/templates/core/skip_links.mustache
theme/boost/templates/nav-drawer.mustache
theme/bootstrapbase/templates/theme_boost/admin_setting_tabs.mustache

index 6445e77..a6dc243 100644 (file)
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 }}
 {{!
+    @template core/action_menu
+
     Action menu.
+
+    Example context (json):
+    {
+        "classes": "",
+        "primary": {
+            "items": [{"rawhtml": "<p>Item in primary menu</p>"}]
+        },
+        "secondary": {
+            "items": [{"rawhtml": "<p>Item in secondary menu</p>"}]
+        }
+    }
 }}
 <div class="{{classes}}" {{#attributes}}{{name}}="{{value}}"{{/attributes}}>
     {{#primary}}
@@ -37,8 +50,6 @@
             {{#items}}<li role="presentation">{{> core/action_menu_item }}</li>{{/items}}
         </ul>
     {{/secondary}}
-
-    </span>
 </div>
 {{#js}}
 require(['core/yui'], function(Y) {
index d00323a..bbbf864 100644 (file)
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 }}
 {{!
+    @template core/action_menu_item
+
     Action menu item.
+
+    Example context (json):
+    {
+        "rawhtml": "<p>[rawhtml]</p>"
+    }
 }}
 {{#actionmenulink}}{{> core/action_menu_link }}{{/actionmenulink}}
 {{#actionmenufiller}}<span class="filler">&nbsp;</span>{{/actionmenufiller}}
index 3c41ad8..054df8b 100644 (file)
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 }}
 {{!
+    @template core/action_menu_link
+
     Action menu link.
+
+    Example context (json):
+    {
+        "text": "Example link text",
+        "showtext": true,
+        "url": "http://example.com/link",
+        "classes": "menu-action",
+        "instance": "1"
+    }
 }}
 {{^disabled}}
     <a href="{{url}}" class="{{classes}}" {{#attributes}}{{name}}={{#quote}}{{value}}{{/quote}}{{/attributes}} {{#showtext}}aria-labelledby="actionmenuaction-{{instance}}"{{/showtext}}>{{#icon}}{{>core/pix_icon}}{{/icon}}{{#showtext}}<span class="menu-action-text" id="actionmenuaction-{{instance}}">{{{text}}}</span>{{/showtext}}</a>
index 977d382..2068373 100644 (file)
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 }}
 {{!
+    @template core/action_menu_trigger
+
     Action menu trigger.
+
+    Example context (json):
+    {
+        "instance": "1",
+        "title": "Trigger me!",
+        "menutrigger": true
+    }
 }}
 <a href="#" class="toggle-display {{#menutrigger}}textmenu{{/menutrigger}}" id="action-menu-toggle-{{instance}}" title="{{title}}" role="menuitem">{{{actiontext}}}{{{menutrigger}}}{{#icon}}{{> core/pix_icon}}{{/icon}}{{#rawicon}}{{{.}}}{{/rawicon}}{{#menutrigger}}<b class="caret"></b>{{/menutrigger}}</a>
\ No newline at end of file
index 3d76246..40b2b69 100644 (file)
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 }}
 {{!
+    @template core/actions
+
     Actions.
+
+    Example context (json):
+    {
+        "actions": [{"event": "event", "jsfunction": "Y.log", "id": "id"}]
+    }
 }}
 {{#js}}
     require(['core/yui'], function(Y) {
index 3486735..fdb9a94 100644 (file)
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 }}
 {{!
+    @template core/chart
+
     Chart rendering.
+
+    Example context (json):
+    {
+        "withtable": true,
+        "chartdata": "null"
+    }
 }}
 <div class="chart-area" id="chart-area-{{uniqid}}">
-    <div class="chart-image" role="decoration" aria-describedby="chart-table-data-{{uniqid}}"></div>
+    <div class="chart-image" role="presentation" aria-describedby="chart-table-data-{{uniqid}}"></div>
     <div class="chart-table {{^withtable}}accesshide{{/withtable}}">
         <p class="chart-table-expand">
             <a href="#" aria-controls="chart-table-data-{{uniqid}}" role="button">
                 {{#str}}showchartdata, moodle{{/str}}
             </a>
         </p>
-        <div class="chart-table-data" id="chart-table-data-{{uniqid}}" {{#withtable}}aria-expanded="false"{{/withtable}}></div>
+        <div class="chart-table-data" id="chart-table-data-{{uniqid}}" {{#withtable}}role="complementary" aria-expanded="false"{{/withtable}}></div>
     </div>
 </div>
 
index eea553c..166cf5d 100644 (file)
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 }}
 {{!
+    @template core/chooser
+
     Chooser.
+
+    Example context (json):
+    {
+        "title": "Chooser title",
+        "method": "post",
+        "actionurl": "http://example.org/test",
+        "instructions": "Choose one:",
+        "paramname": "param",
+        "sections": [{
+            "id": "section-1",
+            "label": "Section one",
+            "items": [{
+                "label": "item one",
+                "description": "description one"
+            }]
+        }]
+    }
 }}
 <div class="hd choosertitle">
     {{title}}
index cfdea06..722b2f5 100644 (file)
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 }}
 {{!
+    @template core/chooser_item
+
     Chooser item.
+
+    Example context (json):
+    {
+        "id": "1",
+        "paramname": "param",
+        "value": "1",
+        "label": "item one",
+        "description": "description one"
+    }
 }}
 <div class="option">
     <label for="item_{{id}}">
index e961ae1..6f51101 100644 (file)
@@ -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
     * 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"
+    }
 }}
 <form method="get" action="{{base}}" class="dataformatselector">
     <div class="mdl-align">
index ec43023..8bb9803 100644 (file)
@@ -15,7 +15,7 @@
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 }}
 {{!
-    @template core/email_html
+    @template core/email_fromname
 
     Template for all email subjects.
 
     * fromname
     * replyto
     * replytoname
+
+    Example context (json):
+    {
+        "fromname": "Joe Bloggs"
+    }
 }}
 {{{fromname}}}
index e8c1aaa..a8d93d9 100644 (file)
     * replyto
     * replytoname
     * body
+
+    Example context (json):
+    {
+        "body": "Email body"
+    }
 }}
 {{{body}}}
index c67afdd..8454983 100644 (file)
@@ -15,7 +15,7 @@
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 }}
 {{!
-    @template core/email_html
+    @template core/email_subject
 
     Template for all email subjects.
 
     * fromname
     * replyto
     * replytoname
+
+    Example context (json):
+    {
+        "subject": "Email subject"
+    }
 }}
 {{{subject}}}
index 8ffc85a..7e537c1 100644 (file)
     * replyto
     * replytoname
     * body
+
+    Example context (json):
+    {
+        "body": "Email body"
+    }
 }}
 {{{body}}}
index d73c8c3..72b2dcd 100644 (file)
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 }}
 {{!
+    @template core/help_icon
+
     Help icon.
+
+    Example context (json):
+    {
+        "title": "Help with something",
+        "url": "http://example.org/help",
+        "linktext": "",
+        "icon":{
+            "attributes": [
+                {"name": "class", "value": "iconhelp"},
+                {"name": "src", "value": "../../../pix/help.svg"},
+                {"name": "alt", "value": "Help icon"}
+            ]
+        }
+    }
 }}
 <span class="helptooltip">
     <a href="{{url}}" title={{#quote}}{{title}}{{/quote}} aria-haspopup="true" target="_blank">{{#icon}}{{>core/pix_icon}}{{/icon}}{{#linktext}}{{.}}{{/linktext}}</a>
index b15e58a..0a85c16 100644 (file)
 
     Context variables required for this template:
     * none
+
+    Example context (json):
+    {
+    }
 }}
 <div class="hover-tooltip-container">
     {{$anchor}}{{/anchor}}
index 1c55525..d8199b9 100644 (file)
@@ -29,5 +29,8 @@
 
     Context variables required for this template:
     *
+
+    Example context (json):
+    {}
 }}
 <span class="loading-icon">{{#pix}} y/loading, core, {{#str}} loading {{/str}} {{/pix}}</span>
index 0096a07..3ee5e2a 100644 (file)
     @template core/login
 
     Moodle template for the login page.
+
+    Example context (json):
+    {
+        "autofocusform": false,
+        "canloginasguest": true,
+        "canloginbyemail": true,
+        "cansignup": true,
+        "error": "testerror",
+        "errorformatted": "Test error formatted",
+        "forgotpasswordurl": "http://example.com/login/forgot_password.php",
+        "hasidentityproviders": false,
+        "hasinstructions": true,
+        "instructions": "For full access to this site, you first need to create an account.",
+        "loginurl": "http://example.com/stable_master/login/index.php",
+        "rememberusername": true,
+        "passwordautocomplete": false,
+        "signupurl": "http://localhost/stable_master/login/signup.php",
+        "cookieshelpiconformatted": "",
+        "username": ""
+    }
 }}
 {{#hasinstructions}}
 <div class="loginbox clearfix twocolumns">
             });
         {{/autofocusform}}
     {{/error}}
-    })
+    });
 {{/js}}
index e986757..403735c 100644 (file)
@@ -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"}
         ]
     }
 
index 7a2653e..ae8ac48 100644 (file)
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 }}
 {{!
+    @template core/progress_bar
+
     Progress bar.
 
     Example context (json):
     {
-        id: 'progressbar_test',
-        width: '500'
+        "id": "progressbar_test",
+        "width": "500"
     }
 }}
 <div class="progressbar_container" style="width: {{width}}px;" id="{{id}}">
index 1661f33..e2954cd 100644 (file)
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 }}
 {{!
+    @template core/select_time
+
     Select time.
+
+    Example context (json):
+    {
+        "id": "test-id",
+        "name": "test-name",
+        "label": "Test label",
+        "options": [
+            {"name": "Option 1", "value": "1"},
+            {"name": "Option 2", "value": "2"}
+        ]
+    }
 }}
 <label for="{{id}}" class="accesshide">{{label}}</label>
 <select name="{{name}}" id="{{id}}" {{#attributes}} {{name}}="{{value}}"{{/attributes}}>
index 80bd360..dee3e2d 100644 (file)
@@ -1,2 +1,10 @@
+{{!
+    @template core/signup_form_layout
+
+    Example context (json):
+    {
+        "formhtml": "<p>(Form html would go here)</p>"
+    }
+}}
 <h3>{{#str}}newaccount{{/str}}</h3>
 {{{formhtml}}}
index 8a1ef0d..6e17fa5 100644 (file)
@@ -1,3 +1,14 @@
+{{!
+    @template core/skip_links
+
+    Example context (json):
+    {
+        "links": [
+            {"url": "http://example.com/link1", "text": "Link 1"},
+            {"url": "http://example.com/link2", "text": "Link 2"}
+        ]
+    }
+}}
 <div class="skiplinks">
 {{#links}}
     <a href="#{{{url}}}" class="skip">{{{text}}}</a>
index f944289..c06d661 100644 (file)
@@ -15,7 +15,7 @@
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 }}
 {{!
-    @template core/add_contact_button
+    @template core_message/add_contact_button
 
     Template for the contents of the add contact button on the user's profile page.
 
index 6d8fec2..2f542f5 100644 (file)
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 }}
 {{!
-    @template core/add_contact_button
+    @template core_message/add_contact_button
 
     Template for the contents of the add contact button on the user's profile page.
 
     Context variables required for this template:
-    *
+    * none
+
+    Example context (json):
+    {
+    }
 }}
 <span>
     {{#pix}} t/removecontact, core {{/pix}}
index 4d369b8..e1db0f2 100644 (file)
     You should have received a copy of the GNU General Public License
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 }}
-<ul class="nav nav-tabs">
+{{!
+    @template theme_boost/admin_setting_tabs
+
+
+    Example context (json):
+    {
+        "tabs": [
+         {
+            "name": "tab1",
+            "active": 0,
+            "displayname": "Inactive tab1",
+            "html": "<p>Tab 1 content</p>"
+         },
+         {
+            "name": "tab2",
+            "active": 1,
+            "displayname": "Active tab2",
+            "html": "<p>Tab 2 content</p>"
+         }
+        ]
+    }
+}}
+<ul class="nav nav-tabs" role="tablist">
     {{#tabs}}
         <li class="nav-item">
             <a href="#{{name}}" class="nav-link {{#active}}active{{/active}}" data-toggle="tab" role="tab">{{displayname}}</a>
index 5befb9c..5a0d38f 100644 (file)
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 }}
 {{!
+    @template core/action_menu
+
     Action menu.
+
+    Example context (json):
+    {
+        "classes": "",
+        "primary": {
+            "items": [{"rawhtml": "<p>Item in primary menu</p>"}]
+        },
+        "secondary": {
+            "items": [{"rawhtml": "<p>Item in secondary menu</p>"}]
+        }
+    }
 }}
 <div class="action-menu {{classes}}" {{#attributes}}{{name}}="{{value}}"{{/attributes}}>
     {{#primary}}
index d00323a..bbbf864 100644 (file)
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 }}
 {{!
+    @template core/action_menu_item
+
     Action menu item.
+
+    Example context (json):
+    {
+        "rawhtml": "<p>[rawhtml]</p>"
+    }
 }}
 {{#actionmenulink}}{{> core/action_menu_link }}{{/actionmenulink}}
 {{#actionmenufiller}}<span class="filler">&nbsp;</span>{{/actionmenufiller}}
index 3c41ad8..756e95c 100644 (file)
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 }}
 {{!
+    @template core/action_menu_link
+
     Action menu link.
+
+    Example context (json):
+    {
+        "text": "Example link text",
+        "showtext": true,
+        "url": "http://example.com/link"
+    }
 }}
 {{^disabled}}
     <a href="{{url}}" class="{{classes}}" {{#attributes}}{{name}}={{#quote}}{{value}}{{/quote}}{{/attributes}} {{#showtext}}aria-labelledby="actionmenuaction-{{instance}}"{{/showtext}}>{{#icon}}{{>core/pix_icon}}{{/icon}}{{#showtext}}<span class="menu-action-text" id="actionmenuaction-{{instance}}">{{{text}}}</span>{{/showtext}}</a>
index 9efbed1..5396e29 100644 (file)
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 }}
 {{!
+    @template core/chooser
+
     Chooser.
+
+    Example context (json):
+    {
+        "title": "Chooser title",
+        "method": "post",
+        "actionurl": "http://example.org/test",
+        "instructions": "Choose one:",
+        "paramname": "param",
+        "sections": [{
+            "id": "section-1",
+            "label": "Section one",
+            "items": [{
+                "label": "item one",
+                "description": "description one"
+            }]
+        }]
+    }
 }}
 <div class="hd choosertitle">
     {{title}}
index 421dfc3..7c11ab3 100644 (file)
     * options
     * sesskey
     * submit
+
+    Example context (json):
+    {
+        "base": "http://example.org/",
+        "name": "test",
+        "value": "test",
+        "label": "Download table data as",
+        "params": false,
+        "options": [{"label": "CSV", "name": "csv"}, {"label": "Excel", "name": "excel"}],
+        "submit": "Download",
+        "sesskey": ""
+    }
 }}
 <form method="get" action="{{base}}" class="dataformatselector m-a-1">
     <div class="form-inline text-xs-right">
index 5abbe5b..161f0bc 100644 (file)
@@ -1,3 +1,22 @@
+{{!
+    @template core/help_icon
+
+    Help icon.
+
+    Example context (json):
+    {
+        "title": "Help with something",
+        "url": "http://example.org/help",
+        "linktext": "",
+        "icon":{
+            "attributes": [
+                {"name": "class", "value": "iconhelp"},
+                {"name": "src", "value": "../../../pix/help.svg"},
+                {"name": "alt", "value": "Help icon"}
+            ]
+        }
+    }
+}}
 <a class="btn btn-link p-a-0" role="button"
     data-container="body" data-toggle="popover"
     data-placement="{{#ltr}}right{{/ltr}}{{^ltr}}left{{/ltr}}" data-content="{{text}} {{completedoclink}}"
index 7a9d4f6..56f8212 100644 (file)
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 }}
 {{!
+    @template core/progress_bar
+
     Progress bar.
 
     Example context (json):
     {
-        id: 'progressbar_test',
-        width: '500'
+        "id": "progressbar_test",
+        "width": "500"
     }
 }}
-<div class="row" id="{{id}}" class="progressbar_container">
+<div id="{{id}}" class="row progressbar_container">
     <div class="col-md-6 push-md-3">
         <p id="{{id}}_status" class="text-xs-center"></p>
         <progress id="{{id}}_bar" class="progress progress-striped progress-animated" value="0" max="100"></progress>
index 9116468..6493280 100644 (file)
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 }}
 {{!
+    @template core/select_time
+
     Select time.
+
+    Example context (json):
+    {
+        "id": "test-id",
+        "name": "test-name",
+        "label": "Test label",
+        "options": [
+            {"name": "Option 1", "value": "1"},
+            {"name": "Option 2", "value": "2"}
+        ]
+    }
 }}
 <label for="{{id}}" class="sr-only">{{label}}</label>
 <select name="{{name}}" id="{{id}}" {{#attributes}} {{name}}="{{value}}"{{/attributes}} class="form-control">
index e6696cd..f62655e 100644 (file)
@@ -1,3 +1,13 @@
+{{!
+    @template core/signup_form_layout
+
+    Example context (json):
+    {
+        "logourl": "https://moodle.org/logo/moodle-logo.svg",
+        "sitename": "Site name",
+        "formhtml": "<p>(Form html would go here)</p>"
+    }
+}}
 <div class="container-fluid">
     <div class="row">
         <div class="col-md-8 push-md-2 col-xl-6 push-xl-3">
index 2405f5f..d8c49a7 100644 (file)
@@ -1,3 +1,14 @@
+{{!
+    @template core/skip_links
+
+    Example context (json):
+    {
+        "links": [
+            {"url": "http://example.com/link1", "text": "Link 1"},
+            {"url": "http://example.com/link2", "text": "Link 2"}
+        ]
+    }
+}}
 <div>
 {{#links}}
     <a class="sr-only sr-only-focusable" href="#{{{url}}}">{{{text}}}</a>
index e22c726..f95ed92 100644 (file)
@@ -1,3 +1,9 @@
+{{!
+    @template theme_boost/nav-drawer
+
+
+    Example context (json): {}
+}}
 <div id="nav-drawer" data-region="drawer" class="hidden-print moodle-has-zindex {{^navdraweropen}}closed{{/navdraweropen}}" aria-hidden="{{#navdraweropen}}false{{/navdraweropen}}{{^navdraweropen}}true{{/navdraweropen}}" tabindex="-1">
     {{> theme_boost/flat_navigation }}
 </div>
index ba6240c..5659302 100644 (file)
     You should have received a copy of the GNU General Public License
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 }}
-<ul class="nav nav-tabs">
+{{!
+    @template theme_boost/admin_setting_tabs
+
+
+    Example context (json):
+    {
+        "tabs": [
+        {
+            "name": "tab1",
+            "active": 0,
+            "displayname": "Inactive tab1",
+            "html": "<p>Tab 1 content</p>"
+         },
+         {
+            "name": "tab2",
+            "active": 1,
+            "displayname": "Active tab2",
+            "html": "<p>Tab 2 content</p>"
+         }
+        ]
+    }
+}}
+<ul class="nav nav-tabs" role="tablist">
     {{#tabs}}
         <li class="{{#active}}active{{/active}}">
             <a href="#{{name}}" data-toggle="tab" role="tab">{{displayname}}</a>