1{{! 2 This file is part of Moodle - http://moodle.org/ 3 4 Moodle is free software: you can redistribute it and/or modify 5 it under the terms of the GNU General Public License as published by 6 the Free Software Foundation, either version 3 of the License, or 7 (at your option) any later version. 8 9 Moodle is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 GNU General Public License for more details. 13 14 You should have received a copy of the GNU General Public License 15 along with Moodle. If not, see <http://www.gnu.org/licenses/>. 16}} 17{{! 18 @template core/availability_info 19 20 Renders the availability info on the course outline page. 21 22 Availability info can be displayed for activity modules or whole course 23 sections. Activity modules can be either hidden from students, or available 24 but not shown on course page (stealth), or the access can be restricted by 25 configured conditions. Sections can be hidden. 26 27 Classes required for JS: 28 * none 29 30 Data attributes required for JS: 31 * none 32 33 Context variables required for this template: 34 * classes String list of CSS classes for the wrapping element 35 * text HTML formatted text with the actual availability information 36 * ishidden Boolean flag indiciating that the item is hidden from students 37 * isstealth Boolean flag indicating that the item is in stealth mode 38 * isrestricted Boolean flag indicating that restricted access conditions apply 39 * isfullinfo Boolean flag indicating that the full list of restricted 40 access conditions is displayed (aka teacher's view). 41 42 Example context (json): 43 { 44 "classes": "", 45 "text": "Not available unless: <ul><li>It is on or after <strong>8 June 2012</strong></li></ul>", 46 "ishidden": 0, 47 "isstealth": 0, 48 "isrestricted": 1, 49 "isfullinfo": 1 50 } 51}} 52{{#text}} 53<div class="availabilityinfo {{classes}}"> 54 {{^isrestricted}} 55 <span class="badge badge-info">{{{text}}}</span> 56 {{/isrestricted}} 57 {{#isrestricted}} 58 <span class="badge badge-info">{{#str}}restricted, core{{/str}}</span> {{{text}}} 59 {{/isrestricted}} 60</div> 61{{/text}} 62