Skip to content

Commit

Permalink
MDL-75423 gradereport_singleview: Zero state cleanup
Browse files Browse the repository at this point in the history
Removes unnecessary components from the zero state pages.
  • Loading branch information
Mihail Geshoski committed Nov 10, 2022
1 parent b16067d commit 1c93256
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 50 deletions.
Expand Up @@ -32,10 +32,7 @@ public function init($selfitemisempty = false) {
* @return string
*/
public function html(): string {
global $OUTPUT, $COURSE, $PAGE, $USER;

$PAGE->requires->js_call_amd('gradereport_singleview/grade', 'init');
$PAGE->requires->js_call_amd('core_grades/searchwidget/group', 'init');
global $OUTPUT, $COURSE, $USER;

$userlink = new \moodle_url('/grade/report/singleview/index.php', ['id' => $COURSE->id, 'item' => 'user_select']);
$gradelink = new \moodle_url('/grade/report/singleview/index.php', ['id' => $COURSE->id, 'item' => 'grade_select']);
Expand Down
5 changes: 1 addition & 4 deletions grade/report/singleview/classes/local/screen/user_select.php
Expand Up @@ -34,10 +34,7 @@ public function init($selfitemisempty = false) {
* @return string
*/
public function html(): string {
global $OUTPUT, $COURSE, $PAGE, $USER;

$PAGE->requires->js_call_amd('gradereport_singleview/user', 'init');
$PAGE->requires->js_call_amd('core_grades/searchwidget/group', 'init');
global $OUTPUT, $COURSE, $USER;

$userlink = new \moodle_url('/grade/report/singleview/index.php', ['id' => $COURSE->id, 'item' => 'user_select']);
$gradelink = new \moodle_url('/grade/report/singleview/index.php', ['id' => $COURSE->id, 'item' => 'grade_select']);
Expand Down
21 changes: 1 addition & 20 deletions grade/report/singleview/templates/zero_state_grade.mustache
Expand Up @@ -21,30 +21,11 @@
Example context (json):
{
"imglink": "http://foo.bar/gradereport/?userid=25",
"courseid": "2",
"groupmodeenabled": true,
"groupactionbaseurl": "index.php?item=grade_select",
"groupid": 2
"imglink": "http://foo.bar/gradereport/?userid=25"
}
}}
<div class="justify-content-end d-flex">
{{>gradereport_singleview/page_toggler}}
</div>
<div class="mx-auto w-50 text-center">
<img src="{{imglink}}" alt="Temp" class="w-50 h-50 mb-4">
<h3>{{#str}}selectgrade, gradereport_singleview{{/str}}</h3>
<p>{{#str}}selectgradeinstructions, gradereport_singleview{{/str}}</p>
{{#groupmodeenabled}}
<a href="#"
class="btn btn-light border-secondary groupwidget"
data-courseid="{{courseid}}"
data-action-base-url="{{groupactionbaseurl}}"
data-searchtype="group"
>{{#str}}selectgrouplink, grades{{/str}}</a>
{{/groupmodeenabled}}
<a href="#"
class="btn btn-light border-secondary gradewidget"
data-courseid="{{courseid}}" data-searchtype="gradeitems"
>{{#str}}selectgradeitemlink, gradereport_singleview{{/str}}</a>
</div>
23 changes: 1 addition & 22 deletions grade/report/singleview/templates/zero_state_user.mustache
Expand Up @@ -21,32 +21,11 @@
Example context (json):
{
"imglink": "http://foo.bar/gradereport/?userid=25",
"courseid": "2",
"groupmodeenabled": true,
"groupactionbaseurl": "index.php?item=user_select",
"groupid": 2
"imglink": "http://foo.bar/gradereport/?userid=25"
}
}}
<div class="justify-content-end d-flex">
{{>gradereport_singleview/page_toggler}}
</div>
<div class="mx-auto w-50 text-center">
<img src="{{imglink}}" alt="Temp" class="w-50 h-50 mb-4">
<h3>{{#str}}selectuser, gradereport_singleview{{/str}}</h3>
<p>{{#str}}selectuserinstructions, gradereport_singleview{{/str}}</p>
{{#groupmodeenabled}}
<a href="#"
class="btn btn-light border-secondary groupwidget"
data-courseid="{{courseid}}"
data-action-base-url="{{groupactionbaseurl}}"
data-searchtype="group"
>{{#str}}selectgrouplink, grades{{/str}}</a>
{{/groupmodeenabled}}
<a href="#"
class="btn btn-light border-secondary userwidget"
data-courseid="{{courseid}}"
data-groupid="{{groupid}}"
data-searchtype="user"
>{{#str}}selectuserlink, grades{{/str}}</a>
</div>

0 comments on commit 1c93256

Please sign in to comment.