moodle/lib/templates/availability_info.mustache
Amaia Anabitarte b9a840f638 MDL-78288 behat: New availability info selectors
- Create a new availability info selectors for section and activity data info regions
- Replace css_element by created selectors in the existing behat tests
2023-07-12 14:22:56 +02:00

64 lines
2.4 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/availability_info
@deprecated since Moodle 3.9 MDL-68612 - Use core_courseformat\\output\\local\\content\\section\\availability instead
Renders the availability info on the course outline page.
Availability info can be displayed for activity modules or whole course
sections. Activity modules can be either hidden from students, or available
but not shown on course page (stealth), or the access can be restricted by
configured conditions. Sections can be hidden.
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* classes String list of CSS classes for the wrapping element
* text HTML formatted text with the actual availability information
* ishidden Boolean flag indiciating that the item is hidden from students
* isstealth Boolean flag indicating that the item is in stealth mode
* isrestricted Boolean flag indicating that restricted access conditions apply
* isfullinfo Boolean flag indicating that the full list of restricted
access conditions is displayed (aka teacher's view).
Example context (json):
{
"classes": "",
"text": "Not available unless: <ul><li>It is on or after <strong>8 June 2012</strong></li></ul>",
"ishidden": 0,
"isstealth": 0,
"isrestricted": 1,
"isfullinfo": 1
}
}}
{{#text}}
<div class="availabilityinfo {{classes}}" data-region="availabilityinfo">
{{^isrestricted}}
<span class="badge badge-info">{{{text}}}</span>
{{/isrestricted}}
{{#isrestricted}}
<span class="badge badge-info">{{#str}}restricted, core{{/str}}</span> {{{text}}}
{{/isrestricted}}
</div>
{{/text}}