Commit 711f2a8a authored by Matheus Miranda's avatar Matheus Miranda
Browse files

Merge branch 'develop' into 'master'

Add feature to download user reports

See merge request !67
parents 85efd392 1803d054
......@@ -36,6 +36,7 @@
function fetchNtes() {
var params = { date: ctrl.date };
ctrl.openned = 0;
if (ctrl.role) {
params['role'] = ctrl.role;
......@@ -48,7 +49,7 @@
ctrl.openned = nte.id;
}
}
}
}
NteParticipationReport.query(params, (data) => {
ctrl.ntes = data;
......@@ -57,9 +58,9 @@
}
function filterNtes() {
if (ctrl.search) {
if (ctrl.city) {
ctrl.filteredNtes = ctrl.ntes.filter(nte => {
return nte.name.toLowerCase().includes(ctrl.search.toLowerCase());
return nte.municipios.includes(ctrl.city);
});
} else {
ctrl.filteredNtes = ctrl.ntes;
......
......@@ -27,6 +27,10 @@
ctrl.minimized = true;
toggleDetails();
}
if (ctrl.openned === 0) {
ctrl.minimized = true;
}
};
ctrl.$onInit = function() {
......
......@@ -40,6 +40,12 @@
}
}
$scope.download_actions = function() {
var options = '?';
options += ('user=' + ctrl.user.id);
window.open('/api/iat/actions-user' + options + '&format=xlsx','_blank');
}
function fetchUserActivitiesPage(page) {
ActionsUserReport.get({ user: ctrl.user.id, page }, (data) => {
if (ctrl.actions !== undefined) {
......
......@@ -41,13 +41,6 @@
<td><b>{{ classroom.participation.total }}</b></td>
</tr>
</div>
<tr class="total">
<td><b>TOTAL GERAL</b></td>
<td><b>{{ $ctrl.total.actives }}</b></td>
<td><b>{{ $ctrl.total.not_actives }}</b></td>
<td><b>{{ $ctrl.total.not_involved }}</b></td>
<td><b>{{ $ctrl.total.total }}</b></td>
</tr>
</tbody>
</table>
</div>
......
{% verbatim %}
<h3 class="widget-title">Percursos</h3>
<div>
<h3 class="widget-title">Percursos</h3>
<button class="btn btn-primary download classroom-report--btn-download pull-right" ng-if="$ctrl.actions.length > 0" ng-click="download_actions()">
Baixar percursos
</button>
</div>
<div class="classroom-report--kv-table classroom-report--table" ng-if="$ctrl.actions.length > 0">
<dl ng-repeat="action in $ctrl.actions | limitTo: limit">
<dt>{{ action.action_phrase }}</dt>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment