Browse Source

rename methods

Davide Alberani 7 years ago
parent
commit
06d49cf27e
3 changed files with 16 additions and 16 deletions
  1. 1 1
      angular_app/event-tickets.html
  2. 14 14
      angular_app/js/controllers.js
  3. 1 1
      angular_app/ticket-edit.html

+ 1 - 1
angular_app/event-tickets.html

@@ -72,7 +72,7 @@
                                         </span>
                                     </td>
                                     <td class="text-center">
-                                        <button ng-click="removeAttendee(person)" type="button" class="btn btn-link fa fa-lg fa-trash"></button>
+                                        <button ng-click="deleteTicket(person)" type="button" class="btn btn-link fa fa-lg fa-trash"></button>
                                     </td>
                                 </tr>
                             </tbody>

+ 14 - 14
angular_app/js/controllers.js

@@ -267,7 +267,7 @@ eventManControllers.controller('EventTicketsCtrl', ['$scope', '$state', 'Event',
         });
 
         $scope._localRemoveTicket = function(person) {
-            $log.debug('_localRemoveAttendee');
+            $log.debug('_localRemoveTicket');
             $log.debug(person);
             if (!(person && person._id && $scope.event.persons)) {
                 return;
@@ -292,17 +292,6 @@ eventManControllers.controller('EventTicketsCtrl', ['$scope', '$state', 'Event',
             }
         };
 
-        $scope._setAttended = function(person) {
-            $scope.setPersonAttribute(person, 'attended', true, function() {
-                var all_person_idx = $scope.allPersons.findIndex(function(el, idx, array) {
-                    return person._id == el._id;
-                });
-                if (all_person_idx != -1) {
-                    $scope.allPersons.splice(all_person_idx, 1);
-                }
-            }, true);
-        };
-
         $scope.setPersonAttribute = function(person, key, value, callback, hideMessage) {
             $log.debug('EventDetailsCtrl.setPersonAttribute.event_id: ' + $state.params.id);
             $log.debug('EventDetailsCtrl.setPersonAttribute._id: ' + person._id);
@@ -344,7 +333,18 @@ eventManControllers.controller('EventTicketsCtrl', ['$scope', '$state', 'Event',
             $scope.query = '';
         };
 
-        $scope.removeAttendee = function(person) {
+        $scope._setAttended = function(person) {
+            $scope.setPersonAttribute(person, 'attended', true, function() {
+                var all_person_idx = $scope.allPersons.findIndex(function(el, idx, array) {
+                    return person._id == el._id;
+                });
+                if (all_person_idx != -1) {
+                    $scope.allPersons.splice(all_person_idx, 1);
+                }
+            }, true);
+        };
+
+        $scope.deleteTicket = function(person) {
             EventTicket.delete({
                     event_id: $state.params.id,
                     ticket_id: person._id
@@ -380,7 +380,7 @@ eventManControllers.controller('EventTicketsCtrl', ['$scope', '$state', 'Event',
             });
         };
 
-        $scope.toggleTicket = function() {
+        $scope.toggleCancelledTicket = function() {
             if (!$scope.ticket._id) {
                 return;
             }

+ 1 - 1
angular_app/ticket-edit.html

@@ -50,7 +50,7 @@
                             {{'Toggle dangerous actions' | translate}}
                         </button>
                         &nbsp;
-                        <button ng-disabled="!guiOptions.dangerousActionsEnabled" ng-click="toggleTicket({id: ticket._id})" class="btn btn-danger">
+                        <button ng-disabled="!guiOptions.dangerousActionsEnabled" ng-click="toggleCancelledTicket({id: ticket._id})" class="btn btn-danger">
                             <span ng-class="{fa: true, 'fa-sign-out': !ticket.cancelled, 'fa-sign-in': ticket.cancelled, vcenter: true}"></span>
                             <span ng-if="!ticket.cancelled">{{'Leave this event' | translate}}</span>
                             <span ng-if="ticket.cancelled">{{'Join again this event' | translate}}</span>