weekly release 4.1dev
[moodle.git] / mod / forum / templates / local / grades / grader.mustache
CommitLineData
bae67469
MM
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 mod_forum/local/grades/local/grader
19
20 Classes required for JS:
21 * TODO
22
23 Data attributes required for JS:
a62c68fb
MM
24 * data-first-userid="350"
25 * data-cmid="1337"
bae67469
MM
26
27 Context variables required for this template:
a62c68fb
MM
28 * userid: ID of the first user to jump to
29 * cmid: ID of the course module we want to grade
bae67469
MM
30
31 Example context (json):
32 {
a62c68fb
MM
33 "userid": 350,
34 "cmid": 1337
bae67469
MM
35 }
36}}
46d51c8c 37<div
4c98e56c 38 id="grader-container-{{uniqid}}"
46d51c8c 39 class="d-flex flex-column h-100 unified-grader"
a62c68fb 40 data-region="unified-grader"
46d51c8c 41 {{#userid}}data-first-userid="{{.}}"{{/userid}}
a62c68fb 42 data-cmid="{{cmid}}"
46d51c8c
RW
43>
44 {{> mod_forum/local/grades/local/grader/navigation }}
45
34c3392f 46 <div class="d-flex flex-grow-1 overflow-hidden position-relative">
bae67469 47 {{> mod_forum/local/grades/local/grader/content }}
f63503a6 48 {{#drawer}}{{> mod_forum/local/grades/local/grader/grading }}{{/drawer}}
bae67469
MM
49 </div>
50</div>
4c98e56c
RW
51{{#js}}
52 require(['jquery', 'core/drawer'], function($, Drawer) {
53 var root = $('#grader-container-{{uniqid}}');
54 var drawer = root.find('[data-region="right-hand-drawer"]');
55 var expandButtons = root.find('[data-action="expand-grading-drawer"]');
56 var collapseButtons = root.find('[data-action="collapse-grading-drawer"]');
57
58 expandButtons.click(function() {
59 collapseButtons.removeClass('active');
60 expandButtons.addClass('active');
61 collapseButtons.attr('aria-expanded', true);
62 expandButtons.attr('aria-expanded', true);
63 Drawer.show(drawer);
64 });
65
66 collapseButtons.click(function() {
67 expandButtons.removeClass('active');
68 collapseButtons.addClass('active');
69 collapseButtons.attr('aria-expanded', false);
70 expandButtons.attr('aria-expanded', false);
71 Drawer.hide(drawer);
72 });
73 });
74{{/js}}