mirror of
https://github.com/lukevella/rallly.git
synced 2025-05-10 07:26:48 +02:00
New Features
- added notifications - added toggle switches - added delete feature - added email verification
This commit is contained in:
parent
e61ef151f6
commit
1b20a11bba
91 changed files with 6859 additions and 2756 deletions
|
@ -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'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue