Commit ca190d013c68c13bd32de49063c2e4a2004a8f08

Authored by Caio Almeida
1 parent ea413de3

Revert "Ticket #99: Support proposal, part 1"

This reverts commit d0ff0de42f1ce1e4e8ef27a13c3209b8d3694bdc.
Showing 2 changed files with 1 additions and 75 deletions   Show diff stats
www/html/_proposal.html
... ... @@ -24,9 +24,6 @@
24 24 <button class="button follow" ng-click="follow(proposal)" ng-hide="isFollowing(proposal) || proposal.author.id == profile.id">
25 25 <i class="icon ion-eye"></i> <span>Seguir</span>
26 26 </button>
27   - <button class="button vote" ng-click="vote(proposal)" ng-hide="alreadyVoted(proposal) || proposal.author.id == profile.id">
28   - <i class="icon ion-thumbsup"></i> <span>Votar</span>
29   - </button>
30 27 <br />
31 28 <button class="button" onclick="window.open(ConfJuvAppUtils.shareOnTwitter(), '_system')">
32 29 <i class="icon ion-social-twitter"></i> <span>Compartilhar no Twitter</span>
... ...
www/js/controllers.js
... ... @@ -569,7 +569,7 @@ angular.module(&#39;confjuvapp.controllers&#39;, [])
569 569 }
570 570 else {
571 571 // Initiate the modal
572   - $ionicModal.fromTemplateUrl('html/_proposal.html?20', {
  572 + $ionicModal.fromTemplateUrl('html/_proposal.html?19', {
573 573 scope: $scope,
574 574 animation: 'slide-in-up'
575 575 }).then(function(modal) {
... ... @@ -1168,76 +1168,6 @@ angular.module(&#39;confjuvapp.controllers&#39;, [])
1168 1168 };
1169 1169  
1170 1170 /******************************************************************************
1171   - V O T E P R O P O S A L
1172   - ******************************************************************************/
1173   -
1174   -//FIXME Adapt this method for votes
1175   - $scope.showVotedProposals = function() {
1176   -// $scope.cardsBackup = [];
1177   -// $scope.showBackupProposalsLink = false;
1178   -//FIXME put this to works
1179   -// $scope.cards = $scope.following.slice();
1180   - }
1181   -
1182   -//FIXME Adapt this method for votes
1183   - $scope.loadVotedProposals = function() {
1184   - $scope.loading = true;
1185   - var config = {
1186   - headers: {
1187   - 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
1188   - },
1189   - timeout: 10000
1190   - };
1191   -
1192   - $http.get(ConfJuvAppUtils.pathTo('/articles/followed_by_me?fields=title,image,body,abstract,id,tag_list,categories,created_by&private_token=' + $scope.token + '&_=' + new Date().getTime()), config)
1193   - .then(function(resp) {
1194   - $scope.following = [];
1195   - $scope.followingIds = [];
1196   - var followed = resp.data.articles;
1197   - for (var i = 0; i < followed.length; i++) {
1198   - var p = followed[i];
1199   - $scope.following.push(p);
1200   - $scope.followingIds.push(p.id);
1201   - }
1202   - $scope.loading = false;
1203   - }, function(err) {
1204   - $scope.loading = false;
1205   - $ionicPopup.alert({ title: 'Propostas seguidas', template: 'Erro ao carregar propostas seguidas' });
1206   - });
1207   - };
1208   -
1209   -//FIXME adapt this method for votes
1210   - $scope.alreadyVoted = function(proposal) {
1211   -// if ($scope.hasOwnProperty('followingIds')) {
1212   -// return ($scope.followingIds.indexOf(proposal.id) > -1);
1213   -// }
1214   -// else {
1215   - return false;
1216   -// }
1217   - };
1218   -
1219   - $scope.vote = function(proposal) {
1220   - $scope.loading = true;
1221   -
1222   - var config = {
1223   - headers: {
1224   - 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
1225   - },
1226   - timeout: 10000
1227   - }
1228   -
1229   - $http.post(ConfJuvAppUtils.pathTo('articles/' + proposal.id + '/vote'), jQuery.param({ private_token: $scope.token}), config)
1230   - .then(function(resp) {
1231   - $ionicPopup.alert({ title: 'Votar em proposta', template: 'Pronto! Você já votou nesta proposta.' });
1232   - $scope.loading = false;
1233   - }, function(err) {
1234   - $ionicPopup.alert({ title: 'Votar em proposta', template: 'Erro ao votar na proposta.' });
1235   - $scope.loading = false;
1236   - });
1237   - };
1238   -
1239   -
1240   - /******************************************************************************
1241 1171 F O L L O W P R O P O S A L
1242 1172 ******************************************************************************/
1243 1173  
... ... @@ -1305,7 +1235,6 @@ angular.module(&#39;confjuvapp.controllers&#39;, [])
1305 1235 });
1306 1236 };
1307 1237  
1308   -
1309 1238 /******************************************************************************
1310 1239 P R O F I L E
1311 1240 ******************************************************************************/
... ...