From 21c7bef975021c8092966601da51bd046e7fe766 Mon Sep 17 00:00:00 2001 From: PMKuipers Date: Mon, 30 Dec 2024 20:59:57 +0100 Subject: [PATCH] Documentation addition to invitations --- cfg_grades.php | 4 ++-- templates/cfg_grades.mustache | 38 ++++++++++++++++++++++++++++++++++ templates/invitations.mustache | 9 ++++++-- 3 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 templates/cfg_grades.mustache diff --git a/cfg_grades.php b/cfg_grades.php index 182e061..07fa74d 100644 --- a/cfg_grades.php +++ b/cfg_grades.php @@ -50,8 +50,6 @@ foreach ($mappings as $cfg) { } } -print $OUTPUT->header(); - $action = optional_param("action","",PARAM_TEXT); if ($action == "update") { // First loop through the scales to see which need to be updated. @@ -193,6 +191,8 @@ foreach ($scales as $scale) { $data[] = $row; } +print $OUTPUT->header(); + print html_writer::start_tag("form", ["method" => "post"]); print html_writer::tag("input", null, ['name' => "action", 'value' => 'update', 'type' => 'hidden']); diff --git a/templates/cfg_grades.mustache b/templates/cfg_grades.mustache new file mode 100644 index 0000000..2bd44b5 --- /dev/null +++ b/templates/cfg_grades.mustache @@ -0,0 +1,38 @@ +{{! + This file is part of Moodle - https://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 local_treestudyplan/cfg_grades + + D + Classes required for JS: + * none + + Data attributes required for JS: + * none + + Context variables required for this template: + * none + + Example context (json): + { + "invites": array_values($DB->get_records('local_treestudyplan_invit', ['user_id' => $USER->id])); + "hasinvites": true, + } +}} +
+ +
\ No newline at end of file diff --git a/templates/invitations.mustache b/templates/invitations.mustache index 7897f2c..0ac43fd 100644 --- a/templates/invitations.mustache +++ b/templates/invitations.mustache @@ -19,10 +19,15 @@ Template for rendering the invitations page Classes required for JS: - * none + * m-action-resend + * m-action-confirm + * m-action-delete + * m-action-view Data attributes required for JS: - * none + * data-confirmtext + * data-confirmbtn + * data-actionhref Context variables required for this template: * none