MDL-64500 tool_analytics: No invalid analysables message

This commit is contained in:
David Monllao 2019-01-04 17:12:43 +01:00 committed by David Monllaó
parent a62e275984
commit b9249eb3d8
3 changed files with 41 additions and 27 deletions

View file

@ -153,6 +153,12 @@ class invalid_analysables implements \renderable, \templatable {
$data->analysables[] = $obj; $data->analysables[] = $obj;
} }
if (empty($data->analysables)) {
$data->noanalysables = [
'message' => get_string('noinvalidanalysables', 'tool_analytics'),
'announce' => true,
];
}
return $data; return $data;
} }
} }

View file

@ -75,6 +75,7 @@ $string['nextpage'] = 'Next page';
$string['nodatatoevaluate'] = 'There is no data to evaluate the model'; $string['nodatatoevaluate'] = 'There is no data to evaluate the model';
$string['nodatatopredict'] = 'No new elements to get predictions for'; $string['nodatatopredict'] = 'No new elements to get predictions for';
$string['nodatatotrain'] = 'There is no new data that can be used for training'; $string['nodatatotrain'] = 'There is no new data that can be used for training';
$string['noinvalidanalysables'] = 'This site does not contain any invalid analysable element.';
$string['notdefined'] = 'Not yet defined'; $string['notdefined'] = 'Not yet defined';
$string['pluginname'] = 'Analytic models'; $string['pluginname'] = 'Analytic models';
$string['predictionresults'] = 'Prediction results'; $string['predictionresults'] = 'Prediction results';

View file

@ -48,6 +48,12 @@
<div class="box"> <div class="box">
<h3>{{#str}}modelinvalidanalysables, tool_analytics, {{modelname}}{{/str}}</h3> <h3>{{#str}}modelinvalidanalysables, tool_analytics, {{modelname}}{{/str}}</h3>
<div>{{#str}}invalidanalysablesinfo, tool_analytics{{/str}}</div> <div>{{#str}}invalidanalysablesinfo, tool_analytics{{/str}}</div>
{{#noanalysables}}
<div class="m-t-2 m-b-1">
{{> core/notification_info}}
</div>
{{/noanalysables}}
{{#analysables}}
<div class="m-t-2 m-b-1"> <div class="m-t-2 m-b-1">
<span>{{#prev}}{{> core/single_button}}{{/prev}}</span> <span>{{#prev}}{{> core/single_button}}{{/prev}}</span>
<span>{{#next}}{{> core/single_button}}{{/next}}</span> <span>{{#next}}{{> core/single_button}}{{/next}}</span>
@ -75,4 +81,5 @@
<span>{{#prev}}{{> core/single_button}}{{/prev}}</span> <span>{{#prev}}{{> core/single_button}}{{/prev}}</span>
<span>{{#next}}{{> core/single_button}}{{/next}}</span> <span>{{#next}}{{> core/single_button}}{{/next}}</span>
</div> </div>
{{/analysables}}
</div> </div>