MDL-57338 mustache: fix admin_setting_tabs

* Add example context
* Fix validation issue (need role="tablist" to contain the tabs)
This commit is contained in:
Dan Poltawski 2016-12-08 15:53:54 +00:00
parent c4cf1c60f5
commit 2f74b07e92
2 changed files with 46 additions and 2 deletions

View File

@ -14,7 +14,29 @@
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>

View File

@ -14,7 +14,29 @@
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>