diff --git a/lib/templates/action_menu.mustache b/lib/templates/action_menu.mustache index 6445e77ee84..a6dc24377ab 100644 --- a/lib/templates/action_menu.mustache +++ b/lib/templates/action_menu.mustache @@ -15,7 +15,20 @@ along with Moodle. If not, see . }} {{! + @template core/action_menu + Action menu. + + Example context (json): + { + "classes": "", + "primary": { + "items": [{"rawhtml": "

Item in primary menu

"}] + }, + "secondary": { + "items": [{"rawhtml": "

Item in secondary menu

"}] + } + } }}
{{#primary}} @@ -37,8 +50,6 @@ {{#items}}
  • {{> core/action_menu_item }}
  • {{/items}} {{/secondary}} - -
    {{#js}} require(['core/yui'], function(Y) { diff --git a/lib/templates/action_menu_item.mustache b/lib/templates/action_menu_item.mustache index d00323a5c48..bbbf864c791 100644 --- a/lib/templates/action_menu_item.mustache +++ b/lib/templates/action_menu_item.mustache @@ -15,7 +15,14 @@ along with Moodle. If not, see . }} {{! + @template core/action_menu_item + Action menu item. + + Example context (json): + { + "rawhtml": "

    [rawhtml]

    " + } }} {{#actionmenulink}}{{> core/action_menu_link }}{{/actionmenulink}} {{#actionmenufiller}} {{/actionmenufiller}} diff --git a/lib/templates/action_menu_link.mustache b/lib/templates/action_menu_link.mustache index 3c41ad8dd7b..054df8b5302 100644 --- a/lib/templates/action_menu_link.mustache +++ b/lib/templates/action_menu_link.mustache @@ -15,7 +15,18 @@ along with Moodle. If not, see . }} {{! + @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}} {{#icon}}{{>core/pix_icon}}{{/icon}}{{#showtext}}{{{text}}}{{/showtext}} diff --git a/lib/templates/action_menu_trigger.mustache b/lib/templates/action_menu_trigger.mustache index 977d382d232..20683739e26 100644 --- a/lib/templates/action_menu_trigger.mustache +++ b/lib/templates/action_menu_trigger.mustache @@ -15,6 +15,15 @@ along with Moodle. If not, see . }} {{! + @template core/action_menu_trigger + Action menu trigger. + + Example context (json): + { + "instance": "1", + "title": "Trigger me!", + "menutrigger": true + } }} {{{actiontext}}}{{{menutrigger}}}{{#icon}}{{> core/pix_icon}}{{/icon}}{{#rawicon}}{{{.}}}{{/rawicon}}{{#menutrigger}}{{/menutrigger}} \ No newline at end of file diff --git a/lib/templates/actions.mustache b/lib/templates/actions.mustache index 3d76246d83c..40b2b69115d 100644 --- a/lib/templates/actions.mustache +++ b/lib/templates/actions.mustache @@ -15,7 +15,14 @@ along with Moodle. If not, see . }} {{! + @template core/actions + Actions. + + Example context (json): + { + "actions": [{"event": "event", "jsfunction": "Y.log", "id": "id"}] + } }} {{#js}} require(['core/yui'], function(Y) { diff --git a/lib/templates/chart.mustache b/lib/templates/chart.mustache index 34867354670..fdb9a944214 100644 --- a/lib/templates/chart.mustache +++ b/lib/templates/chart.mustache @@ -15,17 +15,25 @@ along with Moodle. If not, see . }} {{! + @template core/chart + Chart rendering. + + Example context (json): + { + "withtable": true, + "chartdata": "null" + } }} diff --git a/lib/templates/chooser.mustache b/lib/templates/chooser.mustache index eea553c6bc7..166cf5ddef4 100644 --- a/lib/templates/chooser.mustache +++ b/lib/templates/chooser.mustache @@ -15,7 +15,26 @@ along with Moodle. If not, see . }} {{! + @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" + }] + }] + } }}
    {{title}} diff --git a/lib/templates/chooser_item.mustache b/lib/templates/chooser_item.mustache index cfdea061de6..722b2f57f76 100644 --- a/lib/templates/chooser_item.mustache +++ b/lib/templates/chooser_item.mustache @@ -15,7 +15,18 @@ along with Moodle. If not, see . }} {{! + @template core/chooser_item + Chooser item. + + Example context (json): + { + "id": "1", + "paramname": "param", + "value": "1", + "label": "item one", + "description": "description one" + } }}