Permalink
Browse files

MDL-57338 templates: add missing example context

  • Loading branch information...
danpoltawski committed Dec 9, 2016
1 parent b4a6579 commit 2d29386c449442790412118e9ec864912d2cc1b2
Showing with 312 additions and 14 deletions.
  1. +13 −2 lib/templates/action_menu.mustache
  2. +7 −0 lib/templates/action_menu_item.mustache
  3. +9 −0 lib/templates/action_menu_link.mustache
  4. +9 −0 lib/templates/action_menu_trigger.mustache
  5. +7 −0 lib/templates/actions.mustache
  6. +19 −0 lib/templates/chooser.mustache
  7. +11 −0 lib/templates/chooser_item.mustache
  8. +11 −2 lib/templates/dataformat_selector.mustache
  9. +6 −1 lib/templates/email_fromname.mustache
  10. +5 −0 lib/templates/email_html.mustache
  11. +6 −1 lib/templates/email_subject.mustache
  12. +5 −0 lib/templates/email_text.mustache
  13. +16 −0 lib/templates/help_icon.mustache
  14. +4 −0 lib/templates/hover_tooltip.mustache
  15. +3 −0 lib/templates/loading.mustache
  16. +20 −1 lib/templates/login.mustache
  17. +3 −2 lib/templates/pix_icon.mustache
  18. +4 −2 lib/templates/progress_bar.mustache
  19. +13 −0 lib/templates/select_time.mustache
  20. +8 −0 lib/templates/signup_form_layout.mustache
  21. +11 −0 lib/templates/skip_links.mustache
  22. +13 −0 theme/boost/templates/core/action_menu.mustache
  23. +7 −0 theme/boost/templates/core/action_menu_item.mustache
  24. +9 −0 theme/boost/templates/core/action_menu_link.mustache
  25. +19 −0 theme/boost/templates/core/chooser.mustache
  26. +10 −0 theme/boost/templates/core/dataformat_selector.mustache
  27. +19 −0 theme/boost/templates/core/help_icon.mustache
  28. +5 −3 theme/boost/templates/core/progress_bar.mustache
  29. +13 −0 theme/boost/templates/core/select_time.mustache
  30. +10 −0 theme/boost/templates/core/signup_form_layout.mustache
  31. +11 −0 theme/boost/templates/core/skip_links.mustache
  32. +6 −0 theme/boost/templates/nav-drawer.mustache
@@ -15,7 +15,20 @@
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) {
@@ -15,7 +15,14 @@
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}}
@@ -15,7 +15,16 @@
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>
@@ -15,6 +15,15 @@
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>
@@ -15,7 +15,14 @@
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) {
@@ -15,7 +15,26 @@
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}}
@@ -15,7 +15,18 @@
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}}">
@@ -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"
}
}}
<form method="get" action="{{base}}" class="dataformatselector">
<div class="mdl-align">
@@ -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.
@@ -31,5 +31,10 @@
* fromname
* replyto
* replytoname
Example context (json):
{
"fromname": "Joe Bloggs"
}
}}
{{{fromname}}}
@@ -34,5 +34,10 @@
* replyto
* replytoname
* body
Example context (json):
{
"body": "Email body"
}
}}
{{{body}}}
@@ -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.
@@ -31,5 +31,10 @@
* fromname
* replyto
* replytoname
Example context (json):
{
"subject": "Email subject"
}
}}
{{{subject}}}
@@ -33,5 +33,10 @@
* replyto
* replytoname
* body
Example context (json):
{
"body": "Email body"
}
}}
{{{body}}}
@@ -15,7 +15,23 @@
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>
@@ -27,6 +27,10 @@
Context variables required for this template:
* none
Example context (json):
{
}
}}
<div class="hover-tooltip-container">
{{$anchor}}{{/anchor}}
@@ -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>
@@ -18,6 +18,25 @@
@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": ""
}
}}
{{#hasinstructions}}
<div class="loginbox clearfix twocolumns">
@@ -155,5 +174,5 @@
});
{{/autofocusform}}
{{/error}}
})
});
{{/js}}
@@ -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"}
]
}
@@ -15,12 +15,14 @@
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}}">
@@ -15,7 +15,20 @@
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}}>
@@ -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}}}
@@ -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>
Oops, something went wrong.

0 comments on commit 2d29386

Please sign in to comment.