2019-05-09 18:27:19 +02:00
|
|
|
/**
|
|
|
|
* Controller used in abuses management page
|
|
|
|
*/
|
|
|
|
Application.Controllers.controller('AbusesController', ['$scope', '$state', 'Abuse', 'abusesPromise', 'growl', '_t',
|
|
|
|
function ($scope, $state, Abuse, abusesPromise, growl, _t) {
|
2019-05-21 11:49:50 +02:00
|
|
|
/* PUBLIC SCOPE */
|
|
|
|
|
2019-05-09 18:27:19 +02:00
|
|
|
// List of all reported abuses
|
2019-05-21 11:49:50 +02:00
|
|
|
$scope.abuses = [];
|
|
|
|
|
|
|
|
/* PRIVATE SCOPE */
|
|
|
|
/**
|
|
|
|
* Kind of constructor: these actions will be realized first when the controller is loaded
|
|
|
|
*/
|
|
|
|
const initialize = function () {
|
|
|
|
// we display only abuses related to projects
|
|
|
|
$scope.abuses = abusesPromise.abuses.filter(a => a.signaled_type === 'Project');
|
|
|
|
};
|
|
|
|
|
|
|
|
// !!! MUST BE CALLED AT THE END of the controller
|
|
|
|
return initialize();
|
2019-05-09 18:27:19 +02:00
|
|
|
}
|
|
|
|
]);
|