MDL-64910 block_myoverview: Separate the category name as it's own link
authorPeter <peter@moodle.com>
Thu, 21 Feb 2019 03:50:16 +0000 (11:50 +0800)
committerPeter <peterrolanddias@gmail.com>
Fri, 3 May 2019 03:46:21 +0000 (11:46 +0800)
* Separate the link
* Add style to force color inheritance

blocks/myoverview/templates/view-cards.mustache
blocks/myoverview/templates/view-list.mustache
blocks/myoverview/templates/view-summary.mustache
course/templates/coursecard.mustache
theme/boost/scss/moodle/blocks.scss
theme/boost/style/moodle.css
theme/classic/style/moodle.css

index ff2e63c..b940a1e 100644 (file)
@@ -55,7 +55,9 @@
         <span class="sr-only">
             {{#str}}aria:coursecategory, core_course{{/str}}
         </span>
-        <div>{{{coursecategory}}}</div>
+        <span class="categoryname">
+            {{{coursecategory}}}
+        </span>
     {{/coursecategory}}
     {{$divider}}
         <div class="pl-1 pr-1">|</div>
index eafb72e..ab98fcb 100644 (file)
         data-course-id="{{{id}}}">
         <div class="row-fluid">
             <div class="{{#hasprogress}}col-md-6{{/hasprogress}}{{^hasprogress}}col-md-11 col-md-11{{/hasprogress}} d-flex align-items-center">
-                <a href="{{viewurl}}" class="coursename">
-                    <div class="text-muted muted d-flex" style="flex-flow:wrap;">
+                <div>
+                    <div class="text-muted muted d-flex flex-wrap">
                         <span class="sr-only">
                             {{#str}}aria:coursecategory, core_course{{/str}}
                         </span>
-                        {{$coursecategory}}
-                            <div>{{{coursecategory}}}</div>
-                        {{/coursecategory}}
+                        <span class="categoryname">
+                            {{{coursecategory}}}
+                        </span>
                         {{#showshortname}}
                         <div class="pl-1 pr-1">|</div>
                         <span class="sr-only">
                         <div>{{{shortname}}}</div>
                         {{/showshortname}}
                     </div>
-                    {{> core_course/favouriteicon }}
-                    <span class="sr-only">
-                        {{#str}}aria:coursename, core_course{{/str}}
-                    </span>
-                    {{{fullname}}}
-                </a>
+                    <a href="{{viewurl}}" class="coursename">
+                        {{> core_course/favouriteicon }}
+                        <span class="sr-only">
+                            {{#str}}aria:coursename, core_course{{/str}}
+                        </span>
+                        {{{fullname}}}
+                    </a>
+                </div>
             </div>
             {{#hasprogress}}
             <div class="col-md-5 pt-1">
index 8b35555..a57c690 100644 (file)
             </a>
 
             <div class="align-self-stretch d-flex flex-column w-100">
+                <div class="text-muted muted mb-1 d-flex flex-wrap">
+                    <span class="sr-only">
+                        {{#str}}aria:coursecategory, core_course{{/str}}
+                    </span>
+                    {{$coursecategory}}
+                    <span class="categoryname">
+                        {{{coursecategory}}}
+                    </span>
+                    {{/coursecategory}}
+                    {{#showshortname}}
+                    <div class="pl-1 pr-1">|</div>
+                    <span class="sr-only">
+                        {{#str}}aria:courseshortname, core_course{{/str}}
+                    </span>
+                    <div>{{{shortname}}}</div>
+                    {{/showshortname}}
+                </div>
                 <div class="d-flex mb-1">
                     <a href="{{viewurl}}" class="coursename">
-                        <div class="text-muted muted mb-1 d-flex" style="flex-flow:wrap;">
-                            <span class="sr-only">
-                                {{#str}}aria:coursecategory, core_course{{/str}}
-                            </span>
-                            {{$coursecategory}}
-                                <div>{{{coursecategory}}}</div>
-                            {{/coursecategory}}
-                            {{#showshortname}}
-                            <div class="pl-1 pr-1">|</div>
-                            <span class="sr-only">
-                                {{#str}}aria:courseshortname, core_course{{/str}}
-                            </span>
-                            <div>{{{shortname}}}</div>
-                            {{/showshortname}}
-                        </div>
                         {{> core_course/favouriteicon }}
                         <span class="sr-only">
                             {{#str}}aria:coursename, core_course{{/str}}
index 0ea7e8f..1aba15c 100644 (file)
@@ -43,8 +43,8 @@
     </a>
     <div class="card-body pr-1 course-info-container" id="course-info-container-{{id}}-{{uniqid}}">
         <div class="d-flex align-items-start">
-            <a href="{{viewurl}}" class="coursename mr-2 text-truncate">
-                <div class="text-muted muted d-flex w-100 mb-1 text-truncate" style="flex-flow:wrap;">
+            <div>
+                <div class="text-muted muted d-flex w-100 mb-1 text-truncate flex-wrap">
                     {{$coursecategory}}{{/coursecategory}}
                     {{#showshortname}}
                     {{$divider}}{{/divider}}
                     </div>
                     {{/showshortname}}
                 </div>
-                {{> core_course/favouriteicon }}
-                <span class="sr-only">
-                    {{#str}}aria:coursename, core_course{{/str}}
-                </span>
-                {{$coursename}}{{/coursename}}
-            </a>
+                <a href="{{viewurl}}" class="coursename mr-2 text-truncate">
+                    {{> core_course/favouriteicon }}
+                    <span class="sr-only">
+                            {{#str}}aria:coursename, core_course{{/str}}
+                        </span>
+                    {{$coursename}}{{/coursename}}
+                </a>
+            </div>
             {{$menu}}{{/menu}}
         </div>
     </div>
index db72131..dc1c7e6 100644 (file)
@@ -99,6 +99,7 @@ $card-gutter : $card-deck-margin * 2;
         margin-top: -0.5rem;
     }
     a.coursename,
+    span.categoryname,
     .btn-link {
         color: inherit;
     }
index 304ba37..0344eba 100644 (file)
@@ -11258,6 +11258,7 @@ div.editor_atto_toolbar button .icon {
   margin-top: -0.5rem; }
 
 .block .block-cards a.coursename,
+.block .block-cards span.categoryname,
 .block .block-cards .btn-link {
   color: inherit; }
 
index 6ddf392..9a1b626 100644 (file)
@@ -11499,6 +11499,7 @@ div.editor_atto_toolbar button .icon {
   margin-top: -0.5rem; }
 
 .block .block-cards a.coursename,
+.block .block-cards span.categoryname,
 .block .block-cards .btn-link {
   color: inherit; }