From 85963eadbf4a92916da1d3a20de661fb18046e02 Mon Sep 17 00:00:00 2001 From: Caio SBA Date: Thu, 14 May 2015 15:57:51 -0300 Subject: [PATCH] Adding configuration management and login modal --- .gitignore | 1 + ConfJuvApp/www/index.html | 23 ++++++++++++++++++++++- ConfJuvApp/www/js/config.js.example | 5 +++++ ConfJuvApp/www/js/controllers.js | 36 ++++++++++++++++++++++++++++++++++-- README.txt | 2 ++ 5 files changed, 64 insertions(+), 3 deletions(-) create mode 100644 ConfJuvApp/www/js/config.js.example diff --git a/.gitignore b/.gitignore index db500b9..8543fbb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *~ *.sw* +ConfJuvApp/www/js/config.js diff --git a/ConfJuvApp/www/index.html b/ConfJuvApp/www/index.html index 910f91f..c644026 100644 --- a/ConfJuvApp/www/index.html +++ b/ConfJuvApp/www/index.html @@ -18,6 +18,7 @@ + @@ -26,7 +27,7 @@

3ª Conferência Nacional de Juventude

- +
@@ -37,5 +38,25 @@ + + + diff --git a/ConfJuvApp/www/js/config.js.example b/ConfJuvApp/www/js/config.js.example new file mode 100644 index 0000000..e35e04b --- /dev/null +++ b/ConfJuvApp/www/js/config.js.example @@ -0,0 +1,5 @@ +var ConfJuvAppConfig = { + noosferoApiHost: '', + noosferoApiVersion: '', + noosferoApiPrivateToken: '' +}; diff --git a/ConfJuvApp/www/js/controllers.js b/ConfJuvApp/www/js/controllers.js index cd6167a..2d185a3 100644 --- a/ConfJuvApp/www/js/controllers.js +++ b/ConfJuvApp/www/js/controllers.js @@ -1,5 +1,6 @@ angular.module('confjuvapp.controllers', []) - .controller('ProposalCtrl', function($scope) { + .controller('ProposalCtrl', function($scope, $ionicModal) { + // FIXME: This list should come from the server $scope.proposalList = [ { @@ -9,4 +10,35 @@ angular.module('confjuvapp.controllers', []) title: 'Desmilitarizar a polícia' } ]; - }); + + // Login modal + + // Initiate the modal + $ionicModal.fromTemplateUrl('modal.html', { + scope: $scope, + animation: 'slide-in-up' + }).then(function(modal) { + $scope.modal = modal; + }); + + // Function to open the modal + $scope.openModal = function() { + $scope.modal.show(); + }; + + // Function to close the modal + $scope.closeModal = function() { + $scope.modal.hide(); + }; + + // Cleanup the modal when we're done with it! + $scope.$on('$destroy', function() { + $scope.modal.remove(); + }); + + // Function to login + $scope.Login = function(data) { + $scope.closeModal(); + }; + + }); // Ends controller diff --git a/README.txt b/README.txt index 895b35e..c563c0f 100644 --- a/README.txt +++ b/README.txt @@ -14,3 +14,5 @@ This application is built on top of Ionic, so you need this framework. # `ionic emulate (android|ios)` In order to compile the theme, you need to run: `gulp sass` + +You need to configure the application by creating a file `www/js/config.js` based on `www/js/config.js.example`. -- libgit2 0.21.2