moodle/lib/templates/user_menu_metadata.mustache

63 lines
2.2 KiB
Plaintext

{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template core/user_menu_metadata
User menu metadata template.
Context variables required for this template:
* metadata - Array of additional metadata to be displayed in the dropdown button.
* classes - Additional classes to be applied to the content
* content - The content to be displayed. May/may not have html within it.
* avatardata - Array of avatars to be displayed. Usually only the current user's avatar. If viewing as another user,
includes that user's avatar.
* classes - Additional classes to be applied to the content
* content - The content to be displayed. May/may not have html within it.
* userfullname - The name of the logged in user
Example context (json):
{
"metadata": [
{
"classes": "loginfailures",
"content": "<span>1</span> failed login attempts"
}
],
"avatardata": [
{
"classes": "current",
"content": "<img src=\"http://localhost/stable_master/theme/image.php/boost/core/1617863836/u/f2\" class=\"userpicture defaultuserpic\">"
}
],
"userfullname": "Admin User"
}
}}
{{#metadata}}
<span class="usertext d-flex mr-3">
<span class="meta d-flex {{classes}}">
{{{content}}}
</span>
</span>
{{/metadata}}
<span class="avatars">
{{#avatardata}}
<span class="avatar {{classes}}">
{{{content}}}
</span>
{{/avatardata}}
</span>