New Features

- added notifications
- added toggle switches
- added delete feature
- added email verification
This commit is contained in:
Luke Vella 2015-01-26 13:11:48 +01:00
parent e61ef151f6
commit 1b20a11bba
91 changed files with 6859 additions and 2756 deletions

View file

@ -1,17 +1,9 @@
angular.module('rallly')
.controller('NewEventCtrl', function($scope, $http, $state, Event, ConfirmModal){
.controller('NewEventCtrl', function($scope, $http, $state, Event, ConfirmModal, Notification){
$scope.title = "Schedule a New Event";
$scope.description = "Fill in the form below to create your event and share it with your friends and colleagues.";
var showModal = function(title, message){
var modal = new ConfirmModal({
title : title || 'Not so fast!',
message : message || 'Make sure you fill in all the required fields and try again.',
cancelText : 'OK'
});
}
$scope.submit = function(){
if ($scope.form.$valid){
$http.post('/api/event', $scope.event)
@ -24,10 +16,18 @@ angular.module('rallly')
});
})
.error(function(){
showModal('Uh oh!', 'There was an error creating your event. Please try again later.');
var modal = new ConfirmModal({
title : 'Uh oh!',
message : 'There was an error creating your event. Please try again later.',
cancelText : 'OK'
});
});
} else {
showModal();
var notification = new Notification({
title : 'Not so fast',
message : 'Make sure you fill in all the required fields and try again.',
type : 'error'
});
}
}