MDL-64092 block_timeline: Separate the activity view and submission link
authorPeter <peter@moodle.com>
Tue, 20 Nov 2018 03:38:51 +0000 (11:38 +0800)
committerPeter <peter@moodle.com>
Wed, 21 Nov 2018 06:26:38 +0000 (14:26 +0800)
* Reintroduce separate links similar to 35
* Hide submission links if not actionable

blocks/timeline/templates/event-list-item.mustache
theme/bootstrapbase/templates/block_timeline/event-list-item.mustache

index 40fe0dc..1ff653c 100644 (file)
         }
     }
 }}
-<a
-    class="list-group-item list-group-item-action flex-column py-2 pl-0 pr-0 border-0"
-    href="{{{action.url}}}"
-    title="{{name}}"
+<div class="list-group-item flex-column py-2 pl-0 pr-0 border-0"
     data-region="event-list-item"
-    aria-label='{{#str}} ariaeventlistitem, block_timeline, { "name": "{{name}}", "course": "{{course.fullnamedisplay}}", "date": "{{#userdate}} {{timesort}}, {{#str}} strftimedatetime, core_langconfig {{/str}} {{/userdate}}" } {{/str}}'
->
+    >
     <div class="d-flex">
-        <div class="icon-size-4 d-flex align-self-center">
+        <div class="icon-size-4 d-flex align-self-top">
             {{#icon}}{{#pix}} {{key}}, {{component}}, {{alttext}} {{/pix}}{{/icon}}
         </div>
         <div class="w-100 event-name-container text-truncate line-height-3">
-            <h6 class="event-name text-truncate mb-0">{{{name}}}</h6>
+            <a href="{{url}}"
+               title="{{name}}"
+               aria-label='{{#str}} ariaeventlistitem, block_timeline, { "name": "{{name}}", "course": "{{course.fullnamedisplay}}", "date": "{{#userdate}} {{timesort}}, {{#str}} strftimedatetime, core_langconfig {{/str}} {{/userdate}}" } {{/str}}'
+            ><h6 class="event-name text-truncate mb-0">{{{name}}}</h6></a>
             <small class="text-muted text-truncate m-b-0">{{{course.fullnamedisplay}}}</small>
+            {{#action.actionable}}
+            <h6 class="m-b-0 pt-2">
+                <a href="{{{action.url}}}" aria-label="{{{action.name}}}" title="{{{action.name}}}" class="list-group-item-action">{{{action.name}}}</a>
+            </h6>
+            {{/action.actionable}}
         </div>
         <small class="text-right text-nowrap ml-1">
             {{#userdate}} {{timesort}}, {{#str}} strftimetime24, core_langconfig {{/str}} {{/userdate}}
         </small>
+
     </div>
-</a>
+</div>
index af008b1..981a6c4 100644 (file)
     }
 }}
 <li class="media">
-    <a
-        class="media"
-        href="{{{action.url}}}"
-        title="{{name}}"
-        data-region="event-list-item"
-        aria-label='{{#str}} ariaeventlistitem, block_timeline, { "name": "{{name}}", "course": "{{course.fullnamedisplay}}", "date": "{{#userdate}} {{timesort}}, {{#str}} strftimedatetime, core_langconfig {{/str}} {{/userdate}}" } {{/str}}'
-    >
+    <div class="media" data-region="event-list-item">
         <div class="icon-size-4 pull-left">
             {{#icon}}{{#pix}} {{key}}, {{component}}, {{alttext}} {{/pix}}{{/icon}}
         </div>
             {{#userdate}} {{timesort}}, {{#str}} strftimetime24, core_langconfig {{/str}} {{/userdate}}
         </small>
         <div class="text-truncate line-height-3 media-body">
-            <h6 class="text-truncate m-0">{{{name}}}</h6>
-            <small class="text-muted text-truncate">{{{course.fullnamedisplay}}}</small>
+            <a href="{{url}}"
+               title="{{name}}"
+               aria-label='{{#str}} ariaeventlistitem, block_timeline, { "name": "{{name}}", "course": "{{course.fullnamedisplay}}", "date": "{{#userdate}} {{timesort}}, {{#str}} strftimedatetime, core_langconfig {{/str}} {{/userdate}}" } {{/str}}'
+            >
+                <h6 class="text-truncate m-0">{{{name}}}</h6>
+                <small class="text-muted text-truncate">{{{course.fullnamedisplay}}}</small>
+            </a>
+            {{#action.actionable}}
+            <h6 class="m-b-0 pt-2">
+                <a href="{{{action.url}}}" aria-label="{{{action.name}}}" title="{{{action.name}}}" class="list-group-item-action">{{{action.name}}}</a>
+            </h6>
+            {{/action.actionable}}
         </div>
-    </a>
+    </div>
 </li>