MDL-58101 block_myoverview: don't display link if inactionable

Part of MDL-55611 epic.
This commit is contained in:
Mark Nelson
2017-04-03 11:36:33 +08:00
committed by Damyon Wiese
parent cf3e261607
commit ed0f8d3ca3
2 changed files with 15 additions and 4 deletions
@@ -43,11 +43,20 @@
<div class="container-fluid">
<div class="row">
{{#action.itemcount}}
<div class="pull-xs-right hidden-sm-down m-l-1">
<span class="tag tag-pill tag-default">{{.}}</span>
</div>
{{#action.actionable}}
<div class="pull-xs-right hidden-sm-down m-l-1">
<span class="tag tag-pill tag-default">{{.}}</span>
</div>
{{/action.actionable}}
{{/action.itemcount}}
<div class="d-inline-block pull-xs-right hidden-sm-down m-l-1"><a href="{{{action.url}}}">{{action.name}}</a></div>
<div class="d-inline-block pull-xs-right hidden-sm-down m-l-1">
{{#action.actionable}}
<a href="{{{action.url}}}">{{action.name}}</a>
{{/action.actionable}}
{{^action.actionable}}
<div class="text-muted">{{action.name}}</div>
{{/action.actionable}}
</div>
<div class="d-inline-block pull-xs-right hidden-sm-down">{{enddate}}</div>
<div class="d-inline-block">
{{#icon}}{{#pix}} {{key}}, {{component}}, {{alttext}} {{/pix}}{{/icon}}
+2
View File
@@ -48,6 +48,7 @@ class event_action_exporter extends exporter {
$data->name = $action->get_name();
$data->url = $action->get_url()->out(true);
$data->itemcount = $action->get_item_count();
$data->actionable = $action->is_actionable();
parent::__construct($data, $related);
}
@@ -62,6 +63,7 @@ class event_action_exporter extends exporter {
'name' => ['type' => PARAM_TEXT],
'url' => ['type' => PARAM_URL],
'itemcount' => ['type' => PARAM_INT],
'actionable' => ['type' => PARAM_BOOL]
];
}