MDL-66362 mod_forum: Add forum name to the grading panel breadcrumb
authorSimey Lameze <simey@moodle.com>
Fri, 27 Sep 2019 03:15:17 +0000 (11:15 +0800)
committerMathew May <mathewm@hotmail.co.nz>
Wed, 30 Oct 2019 02:23:40 +0000 (10:23 +0800)
Part of MDL-66074

mod/forum/amd/build/grades/grader.min.js
mod/forum/amd/build/grades/grader.min.js.map
mod/forum/amd/build/local/grades/grader.min.js
mod/forum/amd/build/local/grades/grader.min.js.map
mod/forum/amd/src/grades/grader.js
mod/forum/amd/src/local/grades/grader.js
mod/forum/classes/local/exporters/forum.php
mod/forum/templates/discussion_list.mustache
mod/forum/templates/local/grades/local/grader/navigation.mustache

index 1c6d8ee..6169ac5 100644 (file)
Binary files a/mod/forum/amd/build/grades/grader.min.js and b/mod/forum/amd/build/grades/grader.min.js differ
index e643030..5b80040 100644 (file)
Binary files a/mod/forum/amd/build/grades/grader.min.js.map and b/mod/forum/amd/build/grades/grader.min.js.map differ
index 9a7b35d..b2cfa92 100644 (file)
Binary files a/mod/forum/amd/build/local/grades/grader.min.js and b/mod/forum/amd/build/local/grades/grader.min.js differ
index 8e26ad9..a79da72 100644 (file)
Binary files a/mod/forum/amd/build/local/grades/grader.min.js.map and b/mod/forum/amd/build/local/grades/grader.min.js.map differ
index 55af0b1..a44979a 100644 (file)
@@ -129,6 +129,7 @@ export const registerLaunchListeners = () => {
                     {
                         groupid: data.groupid,
                         initialUserId: data.initialuserid,
+                        moduleName: data.name
                     }
                 );
             } else {
index bbe702f..33b2b75 100644 (file)
@@ -86,7 +86,7 @@ const getSaveUserGradeFunction = (root, setGradeForUser) => {
 
 // Make this explicit rather than object
 export const launch = async(getListOfUsers, getContentForUser, getGradeForUser, setGradeForUser, {
-    initialUserId = 0,
+    initialUserId = 0, moduleName
 } = {}) => {
 
     const [
@@ -95,7 +95,7 @@ export const launch = async(getListOfUsers, getContentForUser, getGradeForUser,
         userList,
     ] = await Promise.all([
         createFullScreenWindow({fullscreen: false, showLoader: false}),
-        Templates.render(templateNames.grader.app, {}),
+        Templates.render(templateNames.grader.app, {moduleName: moduleName}),
         getListOfUsers(),
     ]);
     const graderContainer = graderLayout.getContainer();
index e12ddfc..850c322 100644 (file)
@@ -61,6 +61,7 @@ class forum extends exporter {
     protected static function define_other_properties() {
         return [
             'id' => ['type' => PARAM_INT],
+            'name' => ['type' => PARAM_RAW],
             'state' => [
                 'type' => [
                     'groupmode' => ['type' => PARAM_INT],
@@ -116,6 +117,7 @@ class forum extends exporter {
 
         return [
             'id' => $this->forum->get_id(),
+            'name' => $this->forum->get_name(),
             'state' => [
                 'groupmode' => $this->forum->get_effective_group_mode(),
             ],
index 5697117..135cf73 100644 (file)
@@ -35,6 +35,7 @@
 <div id="discussion-list-{{uniqid}}" {{!
     }}data-contextid="{{contextid}}" {{!
     }}data-cmid="{{cmid}}" {{!
+    }}data-name="{{forum.name}}" {{!
     }}data-group="{{forum.groupid}}" {{!
     }}data-grading-component="{{gradingcomponent}}" {{!
     }}data-grading-component-subtype="{{gradingcomponentsubtype}}" {{!
index c181c30..c7aaa3a 100644 (file)
     <div class="row">
         <div class="col-sm-12 col-md-8 py-3">
             <div class="d-block">
-                <h6 class="d-inline btn px-0 font-weight-bold fa fa-folder mb-0"></h6>
+                <h6 class="d-inline btn px-0 font-weight-bold text-muted mb-0">{{moduleName}}</h6>
                 <h6 class="d-inline btn px-0 font-weight-bold text-muted mb-0"> > </h6>
-                <h6 class="d-inline btn px-0 font-weight-bold text-muted mb-0">Forum: Week 3</h6>
-                <h6 class="d-inline btn px-0 font-weight-bold text-muted mb-0"> > </h6>
-                <h6 class="d-inline btn px-0 font-weight-bold mb-0">Grading</h6>
+                <h6 class="d-inline btn px-0 font-weight-bold mb-0">{{#str}}grading, forum{{/str}}</h6>
             </div>
         </div>