This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- HEADER AND TODO COUNT --> | |
| <div class="jumbotron text-center"> | |
| <h1>RSVP Here<span class="label label-info"></span></h1> | |
| </div> | |
| <!-- FORM TO CREATE TODOS --> | |
| <div id="rsvp-form" class="row"> | |
| <div class="col-sm-8 col-sm-offset-2 text-center"> | |
| <form> | |
| <div class="form-group"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| angular.module('myApp', []) | |
| .config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) { | |
| $routeProvider. | |
| when('/', { | |
| templateUrl: '../views/codeform.html', | |
| controller: 'MainController' | |
| }). | |
| when('/confirm/:code', { | |
| templateUrl: '../views/confirm.html', | |
| controller: 'ConfirmController' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <!-- META --> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"><!-- Optimize mobile viewport --> | |
| <title>Node/Angular Todo App</title> | |
| <!-- SCROLLS --> | |
| <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css"><!-- load bootstrap --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div id="confirm-form" class="row"> | |
| <div class="col-sm-8 col-sm-offset-2 text-center"> | |
| <form> | |
| <div class="form-group"> | |
| <!-- BIND THIS VALUE TO formData.text IN ANGULAR --> | |
| <input type="text" class="form-control input-lg text-center" placeholder="Enter your full name" ng-model="formData.name" ng-value="rsvp.name"> | |
| <input type="text" class="form-control input-lg text-center" placeholder="Enter your Email address" ng-model="formData.email" value="{{ rsvp.email }}"> | |
| <h3>Attending?</h3> | |
| <label>True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div id="confirm-form" class="row"> | |
| <div class="col-sm-8 col-sm-offset-2 text-center"> | |
| <form> | |
| <div class="form-group"> | |
| <!-- BIND THIS VALUE TO formData.text IN ANGULAR --> | |
| <input type="text" class="form-control input-lg text-center" placeholder="Enter your full name" ng-model="formData.name" ng-value="rsvp.name"> | |
| <h4>{{rsvp.email}}</h4> | |
| <input type="text" class="form-control input-lg text-center" placeholder="Enter your Email address" ng-model="formData.email" value="{{ rsvp.email }}"> | |
| <h3>Attending?</h3> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var myApp = angular.module('myApp', ['ngRoute']); | |
| myApp.config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) { | |
| $routeProvider. | |
| when('/', { | |
| templateUrl: '../views/codeform.html', | |
| controller: 'MainController', | |
| access: {restricted: false} | |
| }). | |
| when('/confirm/:code', { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var myApp = angular.module('myApp', ['ngRoute']); | |
| myApp.config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) { | |
| $routeProvider. | |
| when('/', { | |
| templateUrl: '../views/codeform.html', | |
| controller: 'MainController', | |
| access: {restricted: false} | |
| }). | |
| when('/confirm/:code', { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var express = require('express'); | |
| var router = express.Router(); | |
| var mongoose = require('mongoose'); | |
| var User = require('../models/user.js'); | |
| var passport = require('passport'); | |
| router.post('/register', function(req, res) { | |
| User.register(new User({ username: req.body.username}), req.body.password, function(err, account) { | |
| if (err) { | |
| return res.status(500).json({err:err}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <table class="table table-striped"> | |
| <tr> | |
| <th>Name</th> | |
| <th>Email</th> | |
| <th>Attending</th> | |
| <th>Allowed Extras</th> | |
| <th>RSVP'd Extras</th> | |
| </tr> | |
| <div ng-repeat="person in rsvplist"> | |
| <tr> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .controller('AdminController', ['$scope', '$location', 'rsvpDataService', function($scope, $location, rsvpDS) { | |
| $scope.rsvplist = []; | |
| $scope.status; | |
| getRsvpList(); | |
| function getRsvpList() { | |
| rsvpDS.getAllRsvp() | |
| .success(function(rsvps) { | |
| angular.extend($scope.rsvplist, rsvps); |