MDL-56198 assignment: improve grading info responsiveness
[moodle.git] / mod / assign / templates / grading_navigation.mustache
blob4b107deec3fc517fd0dc9c88aafcc57507be5a2d
1 {{!
2     This file is part of Moodle - http://moodle.org/
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.
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.
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/>.
17 {{!
18     @template mod_assign/grading_navigation
20     Actions panel at the bottom of the assignment grading UI.
22     Classes required for JS:
23     * none
25     Data attributes required for JS:
26     * data-region, data-assignmentid, data-groupid
28     Context variables required for this template:
29     * see mod/assign/classes/output/grading_app.php
31     Example context (json):
32     This template includes ajax functionality, so it cannot be shown in the template library.
35 <div data-region="grading-navigation" class="row-fluid">
37 {{!
38     There are three chunks, which appear side-by-side at large screen sizes.
39     A) Assignment info, which has 3 rows:
42 <div data-region="assignment-info" class="span4">
44 {{!
45     Row 1) course name & link.
47 <a href="{{config.wwwroot}}/course/view.php?id={{courseid}}" title="{{{coursename}}}">{{{coursename}}}</a><br/>
49 {{!
50     Row 2) Assignment name & link.
52 <a href="{{config.wwwroot}}/mod/assign/view.php?id={{cmid}}" title="{{name}}">{{name}}</a>
54 {{!
55     Row 3) Edit settings, due date, with tool-tip thing.
57 <div role="tooltip" id="tooltip-{{uniqid}}" class="accesshide">
58 {{#duedate}}
59 {{#str}}duedatecolon, mod_assign, {{duedatestr}}{{/str}}
60 {{/duedate}}
62 {{#cutoffdate}}
63 <br>{{cutoffdatestr}}
64 {{/cutoffdate}}
66 {{#duedate}}
67 <br>{{timeremainingstr}}
68 {{/duedate}}
69 </div>
71 <br/>
72 {{#caneditsettings}}
73 <a href="{{config.wwwroot}}/course/modedit.php?update={{cmid}}&return=1">{{#pix}}t/edit, core,{{#str}}editsettings{{/str}}{{/pix}}</a>
74 {{/caneditsettings}}
75 {{#duedate}}
76 <small data-region="assignment-tooltip" aria-describedby="tooltip-{{uniqid}}">{{#str}}duedatecolon, mod_assign, {{duedatestr}}{{/str}}</small>
77 {{/duedate}}
78 </span>
79 </div>
81 {{!
82     B) Current user name and info.
84 <div data-region="user-info" class="span4" data-assignmentid="{{assignmentid}}" data-groupid="{{groupid}}">
85     {{> mod_assign/grading_navigation_user_info }}
86 </div>
88 {{!
89     C) User selector widget.
91 <div data-region="user-selector" class="span4">
92     <div class="alignment">
93         {{> mod_assign/grading_navigation_user_selector }}
94     </div>
95 </div>
96 </div>
97 {{#js}}
98 require(['mod_assign/grading_navigation', 'core/tooltip'], function(GradingNavigation, ToolTip) {
99     var nav = new GradingNavigation('[data-region="user-selector"]');
100     var tooltip = new ToolTip('[data-region="assignment-tooltip"]');
102 {{/js}}