{{! 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 . }} {{! @template format_tiles/course_module Tiles course module template. The purpose of this template is to render a li activity element representing a single course module. Classes required for JS: * none Data attributes required for JS: * none Context variables required for this template: * cmid - course module id * modname - course module name (type) * modnameDisplay - module name to display to user on sub tile or course mod * modtitle - title to display on this sub tile or course mod * modtitle_inplaceeditable - in place editable version of the title * modResourceType - resource type e.g. pdf, * is_label - is this a label * hasSpacersBefore - does this sub tile need spacer sub tiles before it? * previouswaslabel - was the previous sub tile a label? * useSubtiles - are we usign sub tiles here (or standard list form)? * isEmbeddedResource - is this a resource whcih launces a modal when clicked? * clickable - is this item clickable by user (or click disabled?) * extraclasses - any extra classes * isediting - is the user editing? * content - some activities have content e.g. labels and pages, to be displayed in modal * modinstance - ID from the module table * url - URL for the link to launch the module, * description - Description entered on the course module edit page * cmeditmenu - HTML for course module edit menu * cmmove - move icon * availabilityinfo - availability information to display to user about this cm * completionInUseForCm - are we using completion for this cm? * completionIsManual - is completion manual? * completionstring - what to display when hover over the completion icon * completionstate - is the item marked as complete * completionstateInverse - invers of completionstate Example context (json): { "cmid": 123456, "modname": "label", "modnameDisplay": "", "modtitle": "", "modtitle_inplaceeditable": "", "modResourceType": "", "is_label": 1, "hasSpacersBefore": 0, "previouswaslabel": 0, "useSubtiles": 1, "isEmbeddedResource": 0, "clickable": 1, "extraclasses": "", "isediting": 1, "content": "This is a label", "modinstance": "", "url": "", "description": "", "cmeditmenu": "", "cmmove": "", "availabilityinfo": "", "completionInUseForCm": 1, "completionIsManual": 1, "completionstring": "Click to toggle completion status", "completionstate": 1, "completionstateInverse": "0" } }} {{! if this is a label (except first one in section) we need spacer activities before it so that the previous row of subtiles has correct flexbox width }} {{#hasSpacersBefore}} {{^isediting}} {{/isediting}} {{/hasSpacersBefore}}
  • {{^useSubtiles}} {{#indentlevel}}
    {{/indentlevel}} {{/useSubtiles}}
    {{#is_label}} {{#clickable}} {{! clickable really means user is allowed to see content - }} {{{content}}} {{/clickable}} {{#availabilitymessage}} {{>format_tiles/availability_info}} {{/availabilitymessage}} {{/is_label}} {{^is_label}} {{#useSubtiles}}
    {{modnameDisplay}}
    {{^isediting}}
    {{#clickable}} {{#isEmbeddedResource}}

    {{{modtitle}}}

    {{/isEmbeddedResource}} {{^isEmbeddedResource}}

    {{{modtitle}}}

    {{/isEmbeddedResource}} {{/clickable}} {{^clickable}}

    {{{modtitle}}}

    {{/clickable}}
    {{#clickable}}{{/clickable}} {{/isediting}} {{#isediting}}
    {{#modtitle_inplaceeditable}} {{>format_tiles/inplace_editable}} {{/modtitle_inplaceeditable}} {{^modtitle_inplaceeditable}} {{{modtitle}}} {{/modtitle_inplaceeditable}}
    {{/isediting}} {{/useSubtiles}} {{^useSubtiles}} {{#isediting}}
    {{#modtitle_inplaceeditable}} {{>format_tiles/inplace_editable}} {{/modtitle_inplaceeditable}} {{^modtitle_inplaceeditable}} {{{modtitle}}} {{/modtitle_inplaceeditable}}
    {{/isediting}} {{^isediting}} {{#clickable}} {{{modtitle}}} {{{modtitle}}} {{/clickable}} {{^clickable}} {{{modtitle}}} {{{modtitle}}} {{/clickable}} {{{afterlink}}} {{/isediting}} {{/useSubtiles}} {{/is_label}} {{#isediting}} {{{cmmove}}} {{/isediting}}
    {{#isediting}} {{{cmeditmenu}}} {{/isediting}} {{#completionInUseForCm}} {{! completion is enabled for this course module}} {{! we only want to display a completion icon if we are using subtiles but this item is not a label,}} {{! or we are not using sub tiles. This is because in subtiles format, labels are only}} {{! used to divide activity sub tiles }} {{#useSubtiles}} {{^is_label}} {{#completionenabled}} {{>format_tiles/completion_icon}} {{/completionenabled}} {{/is_label}} {{/useSubtiles}} {{^useSubtiles}} {{#completionenabled}} {{>format_tiles/completion_icon}} {{/completionenabled}} {{/useSubtiles}} {{/completionInUseForCm}} {{^useSubtiles}} {{#showdescription}} {{/showdescription}} {{/useSubtiles}}