From 02ea6dd911c2e010667e61b49d47f7b635e996a0 Mon Sep 17 00:00:00 2001 From: DanouNauck Date: Tue, 6 Aug 2024 14:41:42 +0200 Subject: [PATCH] initial commit for extension of the viewed element --- .../local/content/cm/activity.mustache | 172 ++++++++++++++++++ .../local/content/cm/tarsussetting.mustache | 58 ++++++ 2 files changed, 230 insertions(+) create mode 100644 templates/core_courseformat/local/content/cm/activity.mustache create mode 100644 templates/core_courseformat/local/content/cm/tarsussetting.mustache diff --git a/templates/core_courseformat/local/content/cm/activity.mustache b/templates/core_courseformat/local/content/cm/activity.mustache new file mode 100644 index 00000000000..cf81f379713 --- /dev/null +++ b/templates/core_courseformat/local/content/cm/activity.mustache @@ -0,0 +1,172 @@ +{{! + 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 core_courseformat/local/content/cm/activity + + Display the activity content of a cm. + + Example context (json): + { + "cmname": { + "displayvalue" : "Activity example" + }, + "hasname": "true", + "afterlink": "24.7 KB ยท Uploaded 26/05/23, 16:29", + "activitybadge": { + "badgecontent": "PDF", + "badgestyle": "badge-none", + "badgeurl": "http://example.org/help", + "badgeelementid": "myelementid", + "badgeextraattributes": [ + { + "name": "data-el1name", + "value": "el1value" + }, + { + "name": "data-el2name", + "value": "el2value" + } + ] + }, + "hasextras": true, + "extras": ["[extras]"], + "activityinfo": { + "hasmodavailability": true, + "activityname": "Activity example", + "hascompletion": true, + "uservisible": true, + "hasdates": true, + "isautomatic": true, + "istrackeduser": true, + "activitydates": [ + { + "label": "Opens:", + "datestring": "6 April 2021, 6:46 PM" + } + ], + "completiondetails": [ + { + "statuscomplete": 1, + "description": "Viewed" + }, + { + "statusincomplete": 1, + "description": "Receive a grade" + } + ] + }, + "visibility": { + "isInteractive": false, + "modhiddenfromstudents": true + } + } +}} +{{#moveicon}} {{{moveicon}}} {{/moveicon}} +
+ + {{! Icon, Name & Badge }} + {{#hasname}} + {{#cmname}} + {{$ core_courseformat/local/content/cm/cmname }} + {{> core_courseformat/local/content/cm/cmname }} + {{/ core_courseformat/local/content/cm/cmname }} + {{/cmname}} + {{/hasname}} + + {{! Dates }} + {{#dates}} + {{#hasdates}} +
+ {{#activitydates}} + {{$core_course/activity_date}} + {{>core_course/activity_date}} + {{/core_course/activity_date}} + {{/activitydates}} +
+ {{/hasdates}} + {{/dates}} + + {{! Visibility }} + {{$ core_courseformat/local/content/cm/badges }} + {{> core_courseformat/local/content/cm/badges }} + {{/ core_courseformat/local/content/cm/badges }} + + {{! Group mode }} + {{#groupmodeinfo}} +
+ {{$ core_courseformat/local/content/cm/groupmode}} + {{> core_courseformat/local/content/cm/groupmode}} + {{/ core_courseformat/local/content/cm/groupmode}} +
+ {{/groupmodeinfo}} + + {{! Tarsus mode }} + {{^tarsussettinginfo}} +
+ {{$ core_courseformat/local/content/cm/tarsussetting}} + {{> core_courseformat/local/content/cm/tarsussetting}} + {{/ core_courseformat/local/content/cm/tarsussetting}} +
+ {{/tarsussettinginfo}} + + {{! Completion }} + {{#completion}} + {{#hascompletion}} +
+ {{$ core_courseformat/local/content/cm/activity_info}} + {{> core_courseformat/local/content/cm/activity_info}} + {{/ core_courseformat/local/content/cm/activity_info}} +
+ {{/hascompletion}} + {{/completion}} + + {{! Action menu }} + {{#controlmenu}} +
+ {{$ core_courseformat/local/content/cm/controlmenu }} + {{> core_courseformat/local/content/cm/controlmenu }} + {{/ core_courseformat/local/content/cm/controlmenu }} +
+ {{/controlmenu}} + + {{! Description }} + {{#altcontent}} +
+ {{{altcontent}}} +
+ {{/altcontent}} + + {{! Availability }} + {{#modavailability}} + {{$ core_courseformat/local/content/cm/availability }} + {{> core_courseformat/local/content/cm/availability }} + {{/ core_courseformat/local/content/cm/availability }} + {{/modavailability}} + + {{! Afterlink }} + {{#afterlink}} + + {{/afterlink}} +
diff --git a/templates/core_courseformat/local/content/cm/tarsussetting.mustache b/templates/core_courseformat/local/content/cm/tarsussetting.mustache new file mode 100644 index 00000000000..4d155658728 --- /dev/null +++ b/templates/core_courseformat/local/content/cm/tarsussetting.mustache @@ -0,0 +1,58 @@ +{{! + 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 core_courseformat/local/content/cm/tarsussetting + + Container to display tarsus information on the course page. + + Example context (json): + { + "activityname": "Course announcements", + "groupicon": "i/groupv", + "groupalt": "Visible groups" + } +}} + +{{#isInteractive}} + {{#dropwdown}} + {{< core/local/dropdown/status}} + {{$ buttonclasses }} + {{#autohide}} v-parent-focus {{/autohide}} + tarsus-information btn btn-icon icon-no-margin + {{/ buttonclasses }} + {{$ buttoncontent }} + {{{groupicon}}} + {{groupalt}} + {{/ buttoncontent }} + {{/ core/local/dropdown/status}} + {{/dropwdown}} +{{/isInteractive}} +{{^isInteractive}} +
+ + + + +
+{{/isInteractive}}