Commit ac1329a8 authored by luxcem's avatar luxcem

deputes_infos dans un fichier à part

parent c99d6b96
......@@ -4,3 +4,4 @@ bower_components/
.tmp/
dist/
src/assets/deputes
src/assets/data
This diff is collapsed.
'use strict';
angular.module('soussurveillance')
.controller('DeputesCtrl', function ($scope, $http, _, Circonscriptions, Groupes, DeputesInfos) {
.controller('DeputesCtrl', function ($scope, $http, _, Circonscriptions, Groupes) {
var deputes = [];
$scope.search = {
'name': '',
......@@ -25,18 +25,20 @@ angular.module('soussurveillance')
$scope.Circonscriptions = Circonscriptions;
$scope.Groupes = Groupes;
$scope.DeputesInfos = DeputesInfos;
$http.get('assets/data/deputes_infos.json').success(function(deputesInfos){
$http.get('assets/data/deputes_en_mandat.json').success(function(data){
deputes = data.deputes;
$scope.deputes = _.shuffle(data.deputes);
for (var i = 0; i < $scope.deputes.length; i++) {
var slug = $scope.deputes[i].depute.slug;
$scope.deputes[i].infos = deputesInfos[slug];
$scope.deputes[i].show = false;
}
$scope.totalItems = data.deputes.length;
$scope.applyPaginate();
});
$http.get('assets/data/deputes_en_mandat.json').success(function(data){
deputes = data.deputes;
$scope.deputes = _.shuffle(data.deputes);
for (var i = 0; i < $scope.deputes.length; i++) {
var slug = $scope.deputes[i].depute.slug;
$scope.deputes[i].infos = DeputesInfos[slug];
$scope.deputes[i].show = false;
}
$scope.totalItems = data.deputes.length;
$scope.applyPaginate();
});
$scope.selectDepute = function selectDepute(depute) {
......@@ -92,7 +94,7 @@ angular.module('soussurveillance')
};
$scope.colorMask = function colorMask(depute) {
var status = DeputesInfos[depute.depute.slug].position;
var status = depute.infos.position;
if(status === 0) {
return 'unknown-mask';
} else if (status === 1) {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
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