mirror of
https://github.com/lukevella/rallly.git
synced 2025-05-11 07:56:47 +02:00
Update
- updated styles - added edit functionality
This commit is contained in:
parent
2630cc237a
commit
b72dfc474e
21 changed files with 136 additions and 52 deletions
|
@ -18,6 +18,12 @@ exports.show = function(req, res, next){
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exports.update = function(req, res){
|
||||||
|
Event.update({ '_id' : req.params.id }, req.body, function(){
|
||||||
|
return res.status(204).end();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
exports.createParticipant = function(req, res, next){
|
exports.createParticipant = function(req, res, next){
|
||||||
var eventId = req.params.id;
|
var eventId = req.params.id;
|
||||||
var participant = req.body;
|
var participant = req.body;
|
||||||
|
|
|
@ -13,6 +13,7 @@ var EventSchema = new Schema({
|
||||||
title : String,
|
title : String,
|
||||||
dates : [Date],
|
dates : [Date],
|
||||||
emails : [String],
|
emails : [String],
|
||||||
|
location: String,
|
||||||
participants : [{
|
participants : [{
|
||||||
id : Schema.Types.ObjectId,
|
id : Schema.Types.ObjectId,
|
||||||
name : String,
|
name : String,
|
||||||
|
|
|
@ -7,5 +7,6 @@ var debug = require('debug')('api/event/index');
|
||||||
router.post('/', controller.create);
|
router.post('/', controller.create);
|
||||||
router.get('/:id', controller.show);
|
router.get('/:id', controller.show);
|
||||||
router.post('/:id/participant', controller.createParticipant);
|
router.post('/:id/participant', controller.createParticipant);
|
||||||
|
router.put('/:id', controller.update);
|
||||||
router.delete('/:id/participant/:pid', controller.deleteParticipant);
|
router.delete('/:id/participant/:pid', controller.deleteParticipant);
|
||||||
module.exports = router;
|
module.exports = router;
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
BIN
public/images/error@2x.png
Normal file
BIN
public/images/error@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
BIN
public/images/nope@2x.png
Normal file
BIN
public/images/nope@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 335 B |
BIN
public/images/success@2x.png
Normal file
BIN
public/images/success@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
BIN
public/images/tick@2x.png
Normal file
BIN
public/images/tick@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 555 B |
BIN
public/images/user_blue@2x.png
Normal file
BIN
public/images/user_blue@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 585 B |
BIN
public/images/user_gray@2x.png
Normal file
BIN
public/images/user_gray@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 573 B |
|
@ -1,13 +1,22 @@
|
||||||
angular.module('rallly')
|
angular.module('rallly')
|
||||||
.controller('EventCtrl', function($scope, $http, $state, Event, Participant){
|
.controller('EventCtrl', function($scope, $http, $state, Event, Participant){
|
||||||
|
|
||||||
var id = $state.params.id;
|
var id = $state.params.id;
|
||||||
$scope.event = Event.get({id:id});
|
$scope.event = Event.get({id:id});
|
||||||
$scope.deleteParticipant = function(pid){
|
$scope.deleteParticipant = function(participant){
|
||||||
Participant.remove({ id : id , pid : pid }, function(event){
|
if (confirm("Are you sure you want to remove "+participant.name+"?")){
|
||||||
$scope.event = event;
|
Participant.remove({ id : id , pid : participant._id }, function(event){
|
||||||
});
|
$scope.event = event;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
$scope.edit = function(index){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$scope.update = function(participant){
|
||||||
|
Event.update({'_id':$scope.event.id}, $scope.event);
|
||||||
|
}
|
||||||
|
|
||||||
$scope.save = function(participant){
|
$scope.save = function(participant){
|
||||||
var participant = new Participant(participant);
|
var participant = new Participant(participant);
|
||||||
participant.$save({id:id}, function(event){
|
participant.$save({id:id}, function(event){
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
angular.module('rallly')
|
angular.module('rallly')
|
||||||
.controller('NewEventCtrl', function($scope, $http, $state){
|
.controller('NewEventCtrl', function($scope, $http, $state){
|
||||||
$scope.event = {};
|
$scope.event = {};
|
||||||
$scope.templates = {
|
|
||||||
modal : 'templates/modal.html'
|
|
||||||
};
|
|
||||||
$scope.submit = function(){
|
$scope.submit = function(){
|
||||||
$http.post('/api/event', $scope.event)
|
$http.post('/api/event', $scope.event)
|
||||||
.success(function(event, status, headers, config){
|
.success(function(event, status, headers, config){
|
||||||
|
@ -17,7 +14,6 @@ angular.module('rallly')
|
||||||
})
|
})
|
||||||
.error(function(data, status, headers, config){
|
.error(function(data, status, headers, config){
|
||||||
$scope.errors = data.errors;
|
$scope.errors = data.errors;
|
||||||
console.log(data.errors);
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
$scope.clearDates = null
|
$scope.clearDates = null
|
||||||
|
@ -51,15 +47,4 @@ angular.module('rallly')
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
|
||||||
.directive('rallly-error', function(){
|
|
||||||
return {
|
|
||||||
restrict : 'A',
|
|
||||||
scope: {
|
|
||||||
'message': '='
|
|
||||||
},
|
|
||||||
controller : function($scope){
|
|
||||||
console.log($scope.message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -23,7 +23,9 @@ angular.module('rallly', ['ui.router','ngResource','ngFx'])
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.factory('Event', function($resource){
|
.factory('Event', function($resource){
|
||||||
return $resource('/api/event/:id', { id : '@_id' });
|
return $resource('/api/event/:id', { id : '@_id' }, {
|
||||||
|
'update' : { method : 'PUT' }
|
||||||
|
});
|
||||||
})
|
})
|
||||||
.factory('Participant', function($resource){
|
.factory('Participant', function($resource){
|
||||||
return $resource('/api/event/:id/participant/:pid', { id: '@_id', pid : '@pid'});
|
return $resource('/api/event/:id/participant/:pid', { id: '@_id', pid : '@pid'});
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
font-weight:600;
|
font-weight:600;
|
||||||
color: $dark-gray-clr;
|
color: $dark-gray-clr;
|
||||||
text-decoration:none;
|
text-decoration:none;
|
||||||
padding: em(10px) em(20px);
|
padding: em(8px) em(20px);
|
||||||
&:focus {
|
&:focus {
|
||||||
outline:0;
|
outline:0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
background:white;
|
background:white;
|
||||||
padding: em(10px);
|
padding: em(10px);
|
||||||
|
@include transition(border-color 0.1s ease-in-out);
|
||||||
table {
|
table {
|
||||||
width:100%;
|
width:100%;
|
||||||
font-size: em($em-base);
|
font-size: em($em-base);
|
||||||
|
@ -161,8 +162,17 @@
|
||||||
position:relative;
|
position:relative;
|
||||||
cursor:default;
|
cursor:default;
|
||||||
background:white;
|
background:white;
|
||||||
|
.dow {
|
||||||
|
font-size: em(6px);
|
||||||
|
margin-top:em(-24px);
|
||||||
|
background:white;
|
||||||
|
color: #aaa;
|
||||||
|
margin-bottom: em(4px);
|
||||||
|
font-weight:normal;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
.day {
|
.day {
|
||||||
font-size: em(24px);
|
font-size: em(20px);
|
||||||
font-weight:normal;
|
font-weight:normal;
|
||||||
color: $red-clr;
|
color: $red-clr;
|
||||||
line-height: em(16px);
|
line-height: em(16px);
|
||||||
|
|
|
@ -1,39 +1,96 @@
|
||||||
.event-sidebar {
|
|
||||||
@include span-columns(4);
|
|
||||||
}
|
|
||||||
|
|
||||||
.event-main {
|
|
||||||
@include span-columns(7);
|
|
||||||
@include shift(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.event-author {
|
|
||||||
font-size: em(14px);
|
|
||||||
margin-top:em(-30px);
|
|
||||||
color: $body-clr;
|
|
||||||
margin-bottom:em(15px);
|
|
||||||
a {
|
|
||||||
color: $blue-clr;
|
|
||||||
text-decoration:none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.event-description {
|
.event-description {
|
||||||
font-size: em(14px);
|
font-size: em(18px);
|
||||||
line-height: em(21px);
|
line-height: em(21px);
|
||||||
|
color: $body-clr;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.event-poll {
|
.event-poll {
|
||||||
width:100%;
|
width:100%;
|
||||||
text-align:center;
|
margin-top:em(-10px);
|
||||||
|
margin-bottom: em(10px);
|
||||||
th {
|
th {
|
||||||
text-align:center;
|
text-align:center;
|
||||||
border-bottom:1px solid #ddd;
|
border-bottom:1px solid #ddd;
|
||||||
padding:em(10px);
|
padding-bottom:em(10px);
|
||||||
box-shadow: 0 3px 0 rgba(black, 0.05);
|
box-shadow: 0 3px 0 rgba(black, 0.05);
|
||||||
}
|
}
|
||||||
td {
|
td {
|
||||||
|
&.center {
|
||||||
|
text-align:center;
|
||||||
|
}
|
||||||
padding: em(10px);
|
padding: em(10px);
|
||||||
|
border-bottom:1px solid #ddd;
|
||||||
|
}
|
||||||
|
.event-poll-user {
|
||||||
|
text-align:left;
|
||||||
|
font-size: em(14px);
|
||||||
|
padding: em(15px) em(10px);
|
||||||
|
img {
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
input {
|
||||||
|
border:1px solid #ddd;
|
||||||
|
padding: em(5px) em(10px);
|
||||||
|
border-radius: 3px;
|
||||||
|
&:focus {
|
||||||
|
outline:0;
|
||||||
|
border-color: $primary-clr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.event-poll-participants {
|
||||||
|
text-align:left;
|
||||||
|
padding:0 em(10px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.event-entry-button {
|
||||||
|
font-size: em(12px);
|
||||||
|
text-decoration:none;
|
||||||
|
color: #aaa;
|
||||||
|
border-radius: 3px;
|
||||||
|
margin-left: em(5px);
|
||||||
|
&:hover {
|
||||||
|
color: $primary-clr;
|
||||||
|
&.danger {
|
||||||
|
color: $red-clr;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.event-poll-buttons {
|
||||||
|
text-align:right;
|
||||||
|
padding: 0 em(10px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.event-detail-list {
|
||||||
|
list-style:none;
|
||||||
|
margin-top:em(-20px);
|
||||||
|
margin-bottom:em(20px);
|
||||||
|
padding:0;
|
||||||
|
color: $body-clr;
|
||||||
|
font-size: em(12px);
|
||||||
|
li {
|
||||||
|
display:inline-block;
|
||||||
|
margin-right: em(40px);
|
||||||
|
}
|
||||||
|
a {
|
||||||
|
color: $text-clr;
|
||||||
|
text-decoration:none;
|
||||||
|
&:hover {
|
||||||
|
color: $primary-clr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.event-details {
|
||||||
|
margin-bottom: em(40px);
|
||||||
|
}
|
||||||
|
.event-button-tip {
|
||||||
|
font-size: em(11px);
|
||||||
|
color: #C4CAD2;
|
||||||
|
display:inline-block;
|
||||||
|
margin-right: em(10px);
|
||||||
|
}
|
||||||
|
|
11
public/scss/partials/_eventsuccess.scss
Normal file
11
public/scss/partials/_eventsuccess.scss
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
.form-success {
|
||||||
|
text-align:center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-success-url {
|
||||||
|
font-size: em(36px);
|
||||||
|
text-align:center;
|
||||||
|
border-radius: 3px;
|
||||||
|
border: 1px solid #eee;
|
||||||
|
color: $text-clr;
|
||||||
|
}
|
|
@ -53,6 +53,7 @@
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
font-size:em(18px);
|
font-size:em(18px);
|
||||||
|
@include transition(border-color 0.1s ease-in-out);
|
||||||
&:focus {
|
&:focus {
|
||||||
border-color: $primary-clr;
|
border-color: $primary-clr;
|
||||||
outline:none;
|
outline:none;
|
||||||
|
@ -66,6 +67,7 @@
|
||||||
}
|
}
|
||||||
&.error {
|
&.error {
|
||||||
input.form-control, textarea.form-control {
|
input.form-control, textarea.form-control {
|
||||||
|
|
||||||
border-color: $red-clr;
|
border-color: $red-clr;
|
||||||
background: rgba($red-clr,0.02);
|
background: rgba($red-clr,0.02);
|
||||||
}
|
}
|
||||||
|
@ -75,6 +77,7 @@
|
||||||
}
|
}
|
||||||
textarea.form-control {
|
textarea.form-control {
|
||||||
min-height: 100px;
|
min-height: 100px;
|
||||||
|
font-size: em(14px);
|
||||||
padding: em(8px) em(10px);
|
padding: em(8px) em(10px);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
.header {
|
.header {
|
||||||
border-bottom: 1px solid #ddd;
|
|
||||||
border-top: 5px solid $primary-clr;
|
border-top: 5px solid $primary-clr;
|
||||||
@include row();
|
@include row();
|
||||||
@include pad(em(20px) em(40px));
|
@include linear-gradient(white, transparent 50%, $fallback:transparent);
|
||||||
.primary-section {
|
.primary-section {
|
||||||
@include span-columns(6);
|
@include span-columns(6);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue