diff --git a/angular_app/event-tickets.html b/angular_app/event-tickets.html index ae0a47e..7da52e3 100644 --- a/angular_app/event-tickets.html +++ b/angular_app/event-tickets.html @@ -1,6 +1,5 @@
-
diff --git a/angular_app/index.html b/angular_app/index.html index 5396413..2791a38 100644 --- a/angular_app/index.html +++ b/angular_app/index.html @@ -98,6 +98,7 @@
+
diff --git a/angular_app/js/controllers.js b/angular_app/js/controllers.js index 7ad8669..6a2b5ab 100644 --- a/angular_app/js/controllers.js +++ b/angular_app/js/controllers.js @@ -192,11 +192,10 @@ eventManControllers.controller('EventDetailsCtrl', ['$scope', '$state', 'Event', ); -eventManControllers.controller('EventTicketsCtrl', ['$scope', '$state', 'Event', 'EventTicket', 'Setting', '$log', '$translate', '$rootScope', 'EventUpdates', '$uibModal', '$filter', - function ($scope, $state, Event, EventTicket, Setting, $log, $translate, $rootScope, EventUpdates, $uibModal, $filter) { +eventManControllers.controller('EventTicketsCtrl', ['$scope', '$state', 'Event', 'EventTicket', 'Setting', '$log', '$translate', '$rootScope', 'EventUpdates', '$uibModal', '$filter', 'toaster', + function ($scope, $state, Event, EventTicket, Setting, $log, $translate, $rootScope, EventUpdates, $uibModal, $filter, toaster) { $scope.ticketsOrder = ["name", "surname"]; $scope.countAttendees = 0; - $scope.message = {}; $scope.query = ''; $scope.event = {}; $scope.event.tickets = []; @@ -294,7 +293,7 @@ eventManControllers.controller('EventTicketsCtrl', ['$scope', '$state', 'Event', return false; } if (data.error && data.message) { - $scope.showMessage({message: data.message, isError: true}); + toaster.pop({type: 'error', title: 'Error', body: data.message, timeout: 5000}); return; } if (!$scope.event.tickets) { @@ -482,15 +481,16 @@ eventManControllers.controller('EventTicketsCtrl', ['$scope', '$state', 'Event', $scope.showAttendedMessage = function(ticket, attends) { var msg = {}; + var msg_type = 'success'; var name = $scope.buildTicketLabel(ticket); if (attends) { msg.message = name + ' successfully added to event ' + $scope.event.title; } else { msg.message = name + ' successfully removed from event ' + $scope.event.title; - msg.isWarning = true; + msg_type = 'warning'; } - $scope.showMessage(msg); + toaster.pop({type: msg_type, title: msg.message}); }; $scope.setTicketAttributeAndRefocus = function(ticket, key, value) { @@ -597,7 +597,7 @@ eventManControllers.controller('EventTicketsCtrl', ['$scope', '$state', 'Event', }); if ($state.is('event.ticket.edit')) { $scope.updateTicket($scope.ticket, function() { - $scope.showMessage({message: 'ticket successfully updated'}); + toaster.pop({type: 'info', title: 'ticket successfully updated'}); }); } else { $scope.addTicket($scope.ticket); @@ -651,10 +651,6 @@ eventManControllers.controller('EventTicketsCtrl', ['$scope', '$state', 'Event', $scope.filterTickets(); }; - $scope.showMessage = function(cfg) { - $scope.message && $scope.message.show && $scope.message.show(cfg); - }; - $scope.$on('$destroy', function() { $scope.EventUpdates && $scope.EventUpdates.close(); }); diff --git a/angular_app/js/directives.js b/angular_app/js/directives.js index 7c2e163..772ba98 100644 --- a/angular_app/js/directives.js +++ b/angular_app/js/directives.js @@ -40,36 +40,3 @@ eventManApp.directive('resetFocus', function () { }; }); - -eventManApp.directive('eventmanMessage', ['$timeout', - function($timeout) { - function link(scope, element, attrs) { - scope.dControl = scope.control || {}; - scope.dControl.isVisible = false; - - scope.dControl.show = function(cfg) { - cfg = cfg || {}; - scope.dControl.isVisible = true; - scope.dControl.message = cfg.message; - scope.dControl.isSuccess = true; - scope.dControl.isError = cfg.isError; - scope.dControl.isWarning = cfg.isWarning; - if (cfg.isError || cfg.isWarning) { - scope.dControl.isSuccess = false; - } - $timeout(function () { - scope.dControl.isVisible = false; - }, cfg.timeout || 4000); - }; - }; - - return { - scope: { - control: '=' - }, - link: link, - template: '
{{dControl.message}}
' - }; - }] -); - diff --git a/angular_app/ticket-edit.html b/angular_app/ticket-edit.html index 4355807..1f581bd 100644 --- a/angular_app/ticket-edit.html +++ b/angular_app/ticket-edit.html @@ -1,7 +1,5 @@
-
- diff --git a/static/css/eventman.css b/static/css/eventman.css index d69a972..2438f85 100644 --- a/static/css/eventman.css +++ b/static/css/eventman.css @@ -99,3 +99,7 @@ input[type=text].form-control, input[type=search].form-control { .registered-counter { margin-right: 5px; } + +#toast-container.toast-bottom-center>div, #toast-container.toast-center>div, #toast-container.toast-top-center>div { + margin-bottom: 4px; +}