Merge branch 'MDL-59492-master' of git://github.com/lameze/moodle
authorJun Pataleta <jun@moodle.com>
Mon, 14 Aug 2017 04:16:08 +0000 (12:16 +0800)
committerJun Pataleta <jun@moodle.com>
Mon, 14 Aug 2017 04:16:08 +0000 (12:16 +0800)
blocks/myoverview/classes/output/courses_view.php
blocks/myoverview/templates/course-event-list.mustache
blocks/myoverview/templates/course-summary.mustache
blocks/myoverview/templates/courses-view-course-item.mustache
theme/bootstrapbase/templates/block_myoverview/course-event-list.mustache
theme/bootstrapbase/templates/block_myoverview/course-summary.mustache
theme/bootstrapbase/templates/block_myoverview/courses-view-course-item.mustache

index 2949c09..2f8cb9a 100644 (file)
@@ -83,6 +83,9 @@ class courses_view implements renderable, templatable {
             // Convert summary to plain text.
             $exportedcourse->summary = content_to_text($exportedcourse->summary, $exportedcourse->summaryformat);
 
+            // Include course visibility.
+            $exportedcourse->visible = (bool)$course->visible;
+
             $courseprogress = null;
 
             $classified = course_classify_for_timeline($course);
index 74922d6..d9e729a 100644 (file)
@@ -22,6 +22,9 @@
 
     Example context (json):
     {
+        "urls": {
+            "noevents": "#"
+        }
     }
 }}
 <div data-region="event-list-container"
@@ -93,7 +96,7 @@
              alt="{{#str}} noevents, block_myoverview {{/str}}"
              role="presentation">
         <p class="text-muted m-t-1">{{#str}} noevents, block_myoverview {{/str}}</p>
-        <a href="{{viewurl}}" class="btn btn-secondary text-primary"
+        <a href="{{viewurl}}" class="btn btn-secondary {{#visible}}text-primary{{/visible}}"
            aria-label="{{#str}} viewcoursename, block_myoverview, {{fullnamedisplay}} {{/str}}">
             {{#str}} viewcourse, block_myoverview {{/str}}
         </a>
index 21368a7..acc214b 100644 (file)
 <div class="course-info-container" id="course-info-container-{{id}}">
     <div class="hidden-sm-up hidden-tablet hidden-phone">
         {{> block_myoverview/progress-chart}}
-        <h4 class="h5"><a href="{{viewurl}}">{{{fullnamedisplay}}}</a></h4>
+        <h4 class="h5"><a href="{{viewurl}}" class="{{^visible}}dimmed{{/visible}}">{{{fullnamedisplay}}}</a></h4>
     </div>
     <div class="hidden-sm-down hidden-tablet hidden-desktop">
         {{> block_myoverview/progress-chart}}
-        <h4 class="h5"><a href="{{viewurl}}">{{{fullnamedisplay}}}</a></h4>
+        <h4 class="h5"><a href="{{viewurl}}" class="{{^visible}}dimmed{{/visible}}">{{{fullnamedisplay}}}</a></h4>
     </div>
     <div class="hidden-xs-down hidden-md-up visible-tablet">
         <div class="media">
@@ -43,7 +43,7 @@
                 </div>
             </div>
             <div class="media-body">
-                <h4 class="h5"><a href="{{viewurl}}">{{{fullnamedisplay}}}</a></h4>
+                <h4 class="h5"><a href="{{viewurl}}" class="{{^visible}}dimmed{{/visible}}">{{{fullnamedisplay}}}</a></h4>
             </div>
         </div>
     </div>
index b2f39a8..fd8a4fb 100644 (file)
@@ -31,7 +31,7 @@
         <div class="card-block course-info-container" id="course-info-container-{{id}}">
             <div class="hidden-sm-up hidden-phone">
                 {{> block_myoverview/progress-chart}}
-                <h4 class="h5"><a href="{{viewurl}}">{{{fullnamedisplay}}}</a></h4>
+                <h4 class="h5"><a href="{{viewurl}}" class="{{^visible}}dimmed{{/visible}}">{{{fullnamedisplay}}}</a></h4>
             </div>
             <div class="hidden-xs-down visible-phone">
                 <div class="media">
@@ -41,7 +41,7 @@
                         </div>
                     </div>
                     <div class="media-body">
-                        <h4 class="h5"><a href="{{viewurl}}">{{{fullnamedisplay}}}</a></h4>
+                        <h4 class="h5"><a href="{{viewurl}}" class="{{^visible}}dimmed{{/visible}}">{{{fullnamedisplay}}}</a></h4>
                     </div>
                 </div>
             </div>
index f6bcb03..45ea47e 100644 (file)
@@ -22,6 +22,9 @@
 
     Example context (json):
     {
+         "urls": {
+            "noevents": "#"
+        }
     }
 }}
 <div data-region="event-list-container"
@@ -93,7 +96,7 @@
              alt="{{#str}} noevents, block_myoverview {{/str}}"
              role="presentation">
         <p class="text-muted m-t-1">{{#str}} noevents, block_myoverview {{/str}}</p>
-        <a href="{{viewurl}}" class="btn btn-secondary text-primary"
+        <a href="{{viewurl}}" class="btn"
            aria-label="{{#str}} viewcoursename, block_myoverview, {{fullnamedisplay}} {{/str}}">
             {{#str}} viewcourse, block_myoverview {{/str}}
         </a>
index e799799..e6c99b2 100644 (file)
@@ -29,7 +29,7 @@
 <div class="course-info-container" id="course-info-container-{{id}}">
     <div class="visible-desktop">
         {{> block_myoverview/progress-chart}}
-        <h4><a href="{{viewurl}}">{{fullnamedisplay}}</a></h4>
+        <h4><a href="{{viewurl}}" class="{{^visible}}dimmed{{/visible}}">{{fullnamedisplay}}</a></h4>
     </div>
     <div class="hidden-desktop">
         <div class="media">
@@ -39,7 +39,7 @@
                 </div>
             </div>
             <div class="media-body">
-                <h4 class="media-heading"><a href="{{viewurl}}">{{fullnamedisplay}}</a></h4>
+                <h4 class="media-heading"><a href="{{viewurl}}" class="{{^visible}}dimmed{{/visible}}">{{fullnamedisplay}}</a></h4>
             </div>
         </div>
     </div>
index ba7c132..d4c448a 100644 (file)
@@ -35,7 +35,7 @@
                 </div>
             </div>
             <div class="media-body">
-                <h4 class="media-heading"><a href="{{viewurl}}">{{fullnamedisplay}}</a></h4>
+                <h4 class="media-heading"><a href="{{viewurl}}" class="{{^visible}}dimmed{{/visible}}">{{fullnamedisplay}}</a></h4>
             </div>
         </div>
         <p class="text-muted">