diff --git a/www/html/_left_sidebar.html b/www/html/_left_sidebar.html
index 873b0eb..5e93066 100644
--- a/www/html/_left_sidebar.html
+++ b/www/html/_left_sidebar.html
@@ -7,6 +7,7 @@
- Meu Perfil
- Atualizar Perfil
+ - Etapa Nacional
- Minhas Propostas
- Propostas Seguidas
- Propostas Apoiadas
diff --git a/www/index.html b/www/index.html
index 395263d..8780949 100644
--- a/www/index.html
+++ b/www/index.html
@@ -35,7 +35,7 @@
-
+
diff --git a/www/js/config.js.example b/www/js/config.js.example
index 3ef8884..edd46ff 100644
--- a/www/js/config.js.example
+++ b/www/js/config.js.example
@@ -3,5 +3,6 @@ var ConfJuvAppConfig = {
noosferoApiPublicHost: 'http://app.juventude.gov.br',
noosferoApiVersion: 'v1',
noosferoDiscussion: 99895,
- noosferoStatutePath: 'articles/participatorio/0010/2309/Resolucao-01-2015-etapa-digital.pdf'
+ noosferoStatutePath: 'articles/participatorio/0010/2309/Resolucao-01-2015-etapa-digital.pdf',
+ noosferoNationalPhaseProfileId: '31118'
};
diff --git a/www/js/controllers.js b/www/js/controllers.js
index d3bf67f..8a7846a 100644
--- a/www/js/controllers.js
+++ b/www/js/controllers.js
@@ -329,21 +329,22 @@ angular.module('confjuvapp.controllers', [])
$scope.loading = true;
var path = 'states/';
- if($scope.profile && $scope.profile.region){
+ if ($scope.profile && $scope.profile.region) {
path += $scope.profile.region.parent_id;
- }else{
+ }
+ else {
return;
}
$http.get(ConfJuvAppUtils.pathTo(path))
.then(function(resp) {
$scope.profile.state = resp.data;
- if($scope.profile.state){
+ if ($scope.profile.state) {
$scope.setCityOfProfile();
}
$scope.loading = false;
}, function(err) {
- $ionicPopup.alert({ title: 'Estados', template: 'Não foi possível atribuir o estado ao perfil' });
+ // $ionicPopup.alert({ title: 'Estados', template: 'Não foi possível atribuir o estado ao perfil' });
$scope.loading = false;
});
};
@@ -1572,4 +1573,47 @@ angular.module('confjuvapp.controllers', [])
}
};
+ /******************************************************************************
+ N A T I O N A L P H A S E P R O P O S A L S
+ ******************************************************************************/
+
+ $scope.nationalProposals = [];
+
+ $scope.showNationalProposals = function() {
+ $scope.cardsBackup = [];
+ $scope.showBackupProposalsLink = false;
+
+ if ($scope.nationalProposals.length == 0) {
+ $scope.cards = [];
+
+ var config = {
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
+ },
+ timeout: defaultTimeout
+ };
+
+ var path = 'articles?private_token=' + $scope.token + '&fields=title,image,body,abstract,id,tag_list,categories,created_by,author.name,votes_count,comments_count,followers_count&content_type=ProposalsDiscussionPlugin::Proposal&_=' + (new Date().getTime()) + '&author_id=' + ConfJuvAppConfig.noosferoNationalPhaseProfileId + '&per_page=400&parent_id[]=';
+
+ for (var i = 0; i < $scope.topics.length; i++) {
+ path += '&parent_id[]=' + $scope.topics[i].id;
+ }
+ $scope.loading = true;
+
+ $http.get(ConfJuvAppUtils.pathTo(path), config)
+ .then(function(resp) {
+ console.log('NATIONAL PROPOSALS: ' + resp.data.articles.length);
+ $scope.nationalProposals = resp.data.articles;
+ $scope.cards = $scope.nationalProposals.slice();
+ $scope.loading = false;
+ }, function(err) {
+ $scope.loading = false;
+ });
+ }
+ else {
+ $scope.cards = $scope.nationalProposals.slice();
+ }
+ };
+
+
}); // Ends controller
--
libgit2 0.21.2