windhamdavid 3 years ago
parent
commit
365f7d00bb

+ 1 - 1
app.js

@@ -107,7 +107,7 @@ var apiController = require('./controllers/api_control');
 router.get('/', homeController.index);
 router.get('/login', userController.getLogin);
 router.post('/login', userController.postLogin);
-router.get('/:username', userController.getUserURL);
+router.get('/user/:username', userController.getUserURL);
 
 router.get('/logout', userController.logout);
 router.get('/forgot', userController.getForgot);

+ 1 - 1
controllers/entry_control.js

@@ -21,7 +21,7 @@ exports.getEntry = function (req, res) {
 /********** GET / New Entry **************/
 
 exports.getEntry_new = function (req, res) {
-  res.render('entry/event_new', {
+  res.render('entry/entry_new', {
     title: 'Create an Entry'
   });
 };

+ 6 - 2
controllers/event_control.js

@@ -31,7 +31,12 @@ exports.getEvent_new = function (req, res) {
 exports.postEvent_new= function(req, res, next) {
 
   var event = new Event({
-    eventname: req.body.eventname
+    eventname: req.body.eventname,
+    eventdesc: req.body.eventdesc,
+    eventopendate: req.body.eventopendate,
+    eventenddate: req.body.eventenddate,
+    registrationtype: req.body.registrationtype,
+    jurytype: req.body.jurytype,
   });
   
   var errors = req.validationErrors();
@@ -39,7 +44,6 @@ exports.postEvent_new= function(req, res, next) {
   Event.findOne({ eventname: req.body.eventname }, function(err, existingEvent) {
     if (existingEvent) {
       req.flash('errors', { msg: 'Event with that name already exists.' });
-      return res.redirect('/event/error');
     }
     event.save(function(err) {
       if (err) {

+ 2 - 4
controllers/home_control.js

@@ -1,10 +1,8 @@
 exports.index = function(req, res) {
   if (req.user) {
-    if (req.user) {
-      return res.redirect('/user/:username');
-    }
+    return res.redirect('/user/:username');
   }
-  res.render('pages/index', {
+  res.render('index', {
     title: 'You Be the Judge'
   });
 };

+ 16 - 14
controllers/user_control.js

@@ -22,21 +22,23 @@ exports.getLogin = function (req, res) {
 /********** User GET / User URL **************/
 
 exports.getUserURL = function (req, res) {
-  User.find({ username: 'windhamdavid' }, function (err, username) {
-    console.log('%s', User.username);
-    console.log(req.originalUrl);
-    console.log(req.baseUrl);
-    console.log(req.path);
-    if (err) {
-      res.render('404', { url: req.url, error: '404 Not found' });
-      return;
-    }
-    var username = req.params.username;
-    res.render('account/user', {
-      title: username.User,
-      url: username.User
+  if (req.params.username) {
+    User.find({ username: req.params.username }, function (err, username) {
+      console.log('%s', User.username);
+      console.log(req.originalUrl);
+      console.log(req.baseUrl);
+      console.log(req.path);
+      if (!username) {
+        res.render('404', { url: req.url, error: '404 Not found' });
+        return;
+      }
+      var username = req.params.username;
+      res.render('account/user', {
+        title: username.User,
+        url: username.User
+      });
     });
-  });
+  };
 };
 
 /********** POST / Login **************/

+ 16 - 1
gulpfile.js

@@ -51,7 +51,12 @@ var buildTask = function() {
     .pipe(gulp.dest('./app/img'));
   gulp.src('./src/fonts/*')
     .pipe(gulp.dest('./app/fonts'));
-  gulp.src(['./src/js/jquery.js','./src/js/bootstrap.js'])
+  gulp.src([
+    './src/js/jquery.js',
+    './src/js/bootstrap.js',
+    './src/js/bootstrap-datepicker.js',
+    './src/js/bootstrap-validator.js'
+  ])
     .pipe(concat('lib.min.js'))
     .pipe(uglify())
     .pipe(gulp.dest('./app/js'));
@@ -76,12 +81,22 @@ gulp.task('build', function() {
 var watchTask = function() {
   gulp.src([
     './src/css/bootstrap.css',
+    './src/css/bootstrap-datepicker.css',
     './src/css/font-awesome.css',
     './src/css/main.css'
   ])
     .pipe(concat('style.min.css'))
     .pipe(minifycss())
     .pipe(gulp.dest('./app/css'));
+  gulp.src([
+    './src/js/jquery.js',
+    './src/js/bootstrap.js',
+    './src/js/bootstrap-datepicker.js',
+    './src/js/bootstrap-validator.js'
+  ])
+    .pipe(concat('lib.min.js'))
+    .pipe(uglify())
+    .pipe(gulp.dest('./app/js'));
   gulp.src(['./src/js/main.js'])
     .pipe(concat('main.min.js'))
     .pipe(uglify())

+ 7 - 2
models/event.js

@@ -3,9 +3,14 @@ var crypto = require('crypto');
 var mongoose = require('mongoose');
 
 var eventSchema = new mongoose.Schema({
-  tokens: Array,
   event: {
-    eventname: { type: String, default: '' }
+    eventname: { type: String, default: '' },
+    eventdesc: { type: String, default: '' },
+    eventopendate: { type: String, default: '' },
+    eventenddate: { type: String, default: '' },
+    registrationtype: { type: String, default: '' },
+    jurytype: { type: String, default: '' },
   }
 });
 
+module.exports = mongoose.model('Event', eventSchema);

+ 472 - 0
src/css/bootstrap-datepicker.css

@@ -0,0 +1,472 @@
+/*!
+ * Datepicker for Bootstrap v1.5.0 (https://github.com/eternicode/bootstrap-datepicker)
+ *
+ * Copyright 2012 Stefan Petre
+ * Improvements by Andrew Rowls
+ * Licensed under the Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0)
+ */
+.datepicker {
+  padding: 4px;
+  -webkit-border-radius: 4px;
+  -moz-border-radius: 4px;
+  border-radius: 4px;
+  direction: ltr;
+}
+.datepicker-inline {
+  width: 220px;
+}
+.datepicker.datepicker-rtl {
+  direction: rtl;
+}
+.datepicker.datepicker-rtl table tr td span {
+  float: right;
+}
+.datepicker-dropdown {
+  top: 0;
+  left: 0;
+}
+.datepicker-dropdown:before {
+  content: '';
+  display: inline-block;
+  border-left: 7px solid transparent;
+  border-right: 7px solid transparent;
+  border-bottom: 7px solid #999999;
+  border-top: 0;
+  border-bottom-color: rgba(0, 0, 0, 0.2);
+  position: absolute;
+}
+.datepicker-dropdown:after {
+  content: '';
+  display: inline-block;
+  border-left: 6px solid transparent;
+  border-right: 6px solid transparent;
+  border-bottom: 6px solid #ffffff;
+  border-top: 0;
+  position: absolute;
+}
+.datepicker-dropdown.datepicker-orient-left:before {
+  left: 6px;
+}
+.datepicker-dropdown.datepicker-orient-left:after {
+  left: 7px;
+}
+.datepicker-dropdown.datepicker-orient-right:before {
+  right: 6px;
+}
+.datepicker-dropdown.datepicker-orient-right:after {
+  right: 7px;
+}
+.datepicker-dropdown.datepicker-orient-bottom:before {
+  top: -7px;
+}
+.datepicker-dropdown.datepicker-orient-bottom:after {
+  top: -6px;
+}
+.datepicker-dropdown.datepicker-orient-top:before {
+  bottom: -7px;
+  border-bottom: 0;
+  border-top: 7px solid #999999;
+}
+.datepicker-dropdown.datepicker-orient-top:after {
+  bottom: -6px;
+  border-bottom: 0;
+  border-top: 6px solid #ffffff;
+}
+.datepicker > div {
+  display: none;
+}
+.datepicker table {
+  margin: 0;
+  -webkit-touch-callout: none;
+  -webkit-user-select: none;
+  -khtml-user-select: none;
+  -moz-user-select: none;
+  -ms-user-select: none;
+  user-select: none;
+}
+.datepicker td,
+.datepicker th {
+  text-align: center;
+  width: 20px;
+  height: 20px;
+  -webkit-border-radius: 4px;
+  -moz-border-radius: 4px;
+  border-radius: 4px;
+  border: none;
+}
+.table-striped .datepicker table tr td,
+.table-striped .datepicker table tr th {
+  background-color: transparent;
+}
+.datepicker table tr td.day:hover,
+.datepicker table tr td.day.focused {
+  background: #eeeeee;
+  cursor: pointer;
+}
+.datepicker table tr td.old,
+.datepicker table tr td.new {
+  color: #999999;
+}
+.datepicker table tr td.disabled,
+.datepicker table tr td.disabled:hover {
+  background: none;
+  color: #999999;
+  cursor: default;
+}
+.datepicker table tr td.highlighted {
+  background: #d9edf7;
+  border-radius: 0;
+}
+.datepicker table tr td.today,
+.datepicker table tr td.today:hover,
+.datepicker table tr td.today.disabled,
+.datepicker table tr td.today.disabled:hover {
+  background-color: #fde19a;
+  background-image: -moz-linear-gradient(to bottom, #fdd49a, #fdf59a);
+  background-image: -ms-linear-gradient(to bottom, #fdd49a, #fdf59a);
+  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fdd49a), to(#fdf59a));
+  background-image: -webkit-linear-gradient(to bottom, #fdd49a, #fdf59a);
+  background-image: -o-linear-gradient(to bottom, #fdd49a, #fdf59a);
+  background-image: linear-gradient(to bottom, #fdd49a, #fdf59a);
+  background-repeat: repeat-x;
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fdd49a', endColorstr='#fdf59a', GradientType=0);
+  border-color: #fdf59a #fdf59a #fbed50;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+  filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
+  color: #000;
+}
+.datepicker table tr td.today:hover,
+.datepicker table tr td.today:hover:hover,
+.datepicker table tr td.today.disabled:hover,
+.datepicker table tr td.today.disabled:hover:hover,
+.datepicker table tr td.today:active,
+.datepicker table tr td.today:hover:active,
+.datepicker table tr td.today.disabled:active,
+.datepicker table tr td.today.disabled:hover:active,
+.datepicker table tr td.today.active,
+.datepicker table tr td.today:hover.active,
+.datepicker table tr td.today.disabled.active,
+.datepicker table tr td.today.disabled:hover.active,
+.datepicker table tr td.today.disabled,
+.datepicker table tr td.today:hover.disabled,
+.datepicker table tr td.today.disabled.disabled,
+.datepicker table tr td.today.disabled:hover.disabled,
+.datepicker table tr td.today[disabled],
+.datepicker table tr td.today:hover[disabled],
+.datepicker table tr td.today.disabled[disabled],
+.datepicker table tr td.today.disabled:hover[disabled] {
+  background-color: #fdf59a;
+}
+.datepicker table tr td.today:active,
+.datepicker table tr td.today:hover:active,
+.datepicker table tr td.today.disabled:active,
+.datepicker table tr td.today.disabled:hover:active,
+.datepicker table tr td.today.active,
+.datepicker table tr td.today:hover.active,
+.datepicker table tr td.today.disabled.active,
+.datepicker table tr td.today.disabled:hover.active {
+  background-color: #fbf069 \9;
+}
+.datepicker table tr td.today:hover:hover {
+  color: #000;
+}
+.datepicker table tr td.today.active:hover {
+  color: #fff;
+}
+.datepicker table tr td.range,
+.datepicker table tr td.range:hover,
+.datepicker table tr td.range.disabled,
+.datepicker table tr td.range.disabled:hover {
+  background: #eeeeee;
+  -webkit-border-radius: 0;
+  -moz-border-radius: 0;
+  border-radius: 0;
+}
+.datepicker table tr td.range.today,
+.datepicker table tr td.range.today:hover,
+.datepicker table tr td.range.today.disabled,
+.datepicker table tr td.range.today.disabled:hover {
+  background-color: #f3d17a;
+  background-image: -moz-linear-gradient(to bottom, #f3c17a, #f3e97a);
+  background-image: -ms-linear-gradient(to bottom, #f3c17a, #f3e97a);
+  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f3c17a), to(#f3e97a));
+  background-image: -webkit-linear-gradient(to bottom, #f3c17a, #f3e97a);
+  background-image: -o-linear-gradient(to bottom, #f3c17a, #f3e97a);
+  background-image: linear-gradient(to bottom, #f3c17a, #f3e97a);
+  background-repeat: repeat-x;
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f3c17a', endColorstr='#f3e97a', GradientType=0);
+  border-color: #f3e97a #f3e97a #edde34;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+  filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
+  -webkit-border-radius: 0;
+  -moz-border-radius: 0;
+  border-radius: 0;
+}
+.datepicker table tr td.range.today:hover,
+.datepicker table tr td.range.today:hover:hover,
+.datepicker table tr td.range.today.disabled:hover,
+.datepicker table tr td.range.today.disabled:hover:hover,
+.datepicker table tr td.range.today:active,
+.datepicker table tr td.range.today:hover:active,
+.datepicker table tr td.range.today.disabled:active,
+.datepicker table tr td.range.today.disabled:hover:active,
+.datepicker table tr td.range.today.active,
+.datepicker table tr td.range.today:hover.active,
+.datepicker table tr td.range.today.disabled.active,
+.datepicker table tr td.range.today.disabled:hover.active,
+.datepicker table tr td.range.today.disabled,
+.datepicker table tr td.range.today:hover.disabled,
+.datepicker table tr td.range.today.disabled.disabled,
+.datepicker table tr td.range.today.disabled:hover.disabled,
+.datepicker table tr td.range.today[disabled],
+.datepicker table tr td.range.today:hover[disabled],
+.datepicker table tr td.range.today.disabled[disabled],
+.datepicker table tr td.range.today.disabled:hover[disabled] {
+  background-color: #f3e97a;
+}
+.datepicker table tr td.range.today:active,
+.datepicker table tr td.range.today:hover:active,
+.datepicker table tr td.range.today.disabled:active,
+.datepicker table tr td.range.today.disabled:hover:active,
+.datepicker table tr td.range.today.active,
+.datepicker table tr td.range.today:hover.active,
+.datepicker table tr td.range.today.disabled.active,
+.datepicker table tr td.range.today.disabled:hover.active {
+  background-color: #efe24b \9;
+}
+.datepicker table tr td.selected,
+.datepicker table tr td.selected:hover,
+.datepicker table tr td.selected.disabled,
+.datepicker table tr td.selected.disabled:hover {
+  background-color: #9e9e9e;
+  background-image: -moz-linear-gradient(to bottom, #b3b3b3, #808080);
+  background-image: -ms-linear-gradient(to bottom, #b3b3b3, #808080);
+  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#b3b3b3), to(#808080));
+  background-image: -webkit-linear-gradient(to bottom, #b3b3b3, #808080);
+  background-image: -o-linear-gradient(to bottom, #b3b3b3, #808080);
+  background-image: linear-gradient(to bottom, #b3b3b3, #808080);
+  background-repeat: repeat-x;
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#b3b3b3', endColorstr='#808080', GradientType=0);
+  border-color: #808080 #808080 #595959;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+  filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
+  color: #fff;
+  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+}
+.datepicker table tr td.selected:hover,
+.datepicker table tr td.selected:hover:hover,
+.datepicker table tr td.selected.disabled:hover,
+.datepicker table tr td.selected.disabled:hover:hover,
+.datepicker table tr td.selected:active,
+.datepicker table tr td.selected:hover:active,
+.datepicker table tr td.selected.disabled:active,
+.datepicker table tr td.selected.disabled:hover:active,
+.datepicker table tr td.selected.active,
+.datepicker table tr td.selected:hover.active,
+.datepicker table tr td.selected.disabled.active,
+.datepicker table tr td.selected.disabled:hover.active,
+.datepicker table tr td.selected.disabled,
+.datepicker table tr td.selected:hover.disabled,
+.datepicker table tr td.selected.disabled.disabled,
+.datepicker table tr td.selected.disabled:hover.disabled,
+.datepicker table tr td.selected[disabled],
+.datepicker table tr td.selected:hover[disabled],
+.datepicker table tr td.selected.disabled[disabled],
+.datepicker table tr td.selected.disabled:hover[disabled] {
+  background-color: #808080;
+}
+.datepicker table tr td.selected:active,
+.datepicker table tr td.selected:hover:active,
+.datepicker table tr td.selected.disabled:active,
+.datepicker table tr td.selected.disabled:hover:active,
+.datepicker table tr td.selected.active,
+.datepicker table tr td.selected:hover.active,
+.datepicker table tr td.selected.disabled.active,
+.datepicker table tr td.selected.disabled:hover.active {
+  background-color: #666666 \9;
+}
+.datepicker table tr td.active,
+.datepicker table tr td.active:hover,
+.datepicker table tr td.active.disabled,
+.datepicker table tr td.active.disabled:hover {
+  background-color: #006dcc;
+  background-image: -moz-linear-gradient(to bottom, #0088cc, #0044cc);
+  background-image: -ms-linear-gradient(to bottom, #0088cc, #0044cc);
+  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
+  background-image: -webkit-linear-gradient(to bottom, #0088cc, #0044cc);
+  background-image: -o-linear-gradient(to bottom, #0088cc, #0044cc);
+  background-image: linear-gradient(to bottom, #0088cc, #0044cc);
+  background-repeat: repeat-x;
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0);
+  border-color: #0044cc #0044cc #002a80;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+  filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
+  color: #fff;
+  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+}
+.datepicker table tr td.active:hover,
+.datepicker table tr td.active:hover:hover,
+.datepicker table tr td.active.disabled:hover,
+.datepicker table tr td.active.disabled:hover:hover,
+.datepicker table tr td.active:active,
+.datepicker table tr td.active:hover:active,
+.datepicker table tr td.active.disabled:active,
+.datepicker table tr td.active.disabled:hover:active,
+.datepicker table tr td.active.active,
+.datepicker table tr td.active:hover.active,
+.datepicker table tr td.active.disabled.active,
+.datepicker table tr td.active.disabled:hover.active,
+.datepicker table tr td.active.disabled,
+.datepicker table tr td.active:hover.disabled,
+.datepicker table tr td.active.disabled.disabled,
+.datepicker table tr td.active.disabled:hover.disabled,
+.datepicker table tr td.active[disabled],
+.datepicker table tr td.active:hover[disabled],
+.datepicker table tr td.active.disabled[disabled],
+.datepicker table tr td.active.disabled:hover[disabled] {
+  background-color: #0044cc;
+}
+.datepicker table tr td.active:active,
+.datepicker table tr td.active:hover:active,
+.datepicker table tr td.active.disabled:active,
+.datepicker table tr td.active.disabled:hover:active,
+.datepicker table tr td.active.active,
+.datepicker table tr td.active:hover.active,
+.datepicker table tr td.active.disabled.active,
+.datepicker table tr td.active.disabled:hover.active {
+  background-color: #003399 \9;
+}
+.datepicker table tr td span {
+  display: block;
+  width: 23%;
+  height: 54px;
+  line-height: 54px;
+  float: left;
+  margin: 1%;
+  cursor: pointer;
+  -webkit-border-radius: 4px;
+  -moz-border-radius: 4px;
+  border-radius: 4px;
+}
+.datepicker table tr td span:hover {
+  background: #eeeeee;
+}
+.datepicker table tr td span.disabled,
+.datepicker table tr td span.disabled:hover {
+  background: none;
+  color: #999999;
+  cursor: default;
+}
+.datepicker table tr td span.active,
+.datepicker table tr td span.active:hover,
+.datepicker table tr td span.active.disabled,
+.datepicker table tr td span.active.disabled:hover {
+  background-color: #006dcc;
+  background-image: -moz-linear-gradient(to bottom, #0088cc, #0044cc);
+  background-image: -ms-linear-gradient(to bottom, #0088cc, #0044cc);
+  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
+  background-image: -webkit-linear-gradient(to bottom, #0088cc, #0044cc);
+  background-image: -o-linear-gradient(to bottom, #0088cc, #0044cc);
+  background-image: linear-gradient(to bottom, #0088cc, #0044cc);
+  background-repeat: repeat-x;
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0);
+  border-color: #0044cc #0044cc #002a80;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+  filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
+  color: #fff;
+  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+}
+.datepicker table tr td span.active:hover,
+.datepicker table tr td span.active:hover:hover,
+.datepicker table tr td span.active.disabled:hover,
+.datepicker table tr td span.active.disabled:hover:hover,
+.datepicker table tr td span.active:active,
+.datepicker table tr td span.active:hover:active,
+.datepicker table tr td span.active.disabled:active,
+.datepicker table tr td span.active.disabled:hover:active,
+.datepicker table tr td span.active.active,
+.datepicker table tr td span.active:hover.active,
+.datepicker table tr td span.active.disabled.active,
+.datepicker table tr td span.active.disabled:hover.active,
+.datepicker table tr td span.active.disabled,
+.datepicker table tr td span.active:hover.disabled,
+.datepicker table tr td span.active.disabled.disabled,
+.datepicker table tr td span.active.disabled:hover.disabled,
+.datepicker table tr td span.active[disabled],
+.datepicker table tr td span.active:hover[disabled],
+.datepicker table tr td span.active.disabled[disabled],
+.datepicker table tr td span.active.disabled:hover[disabled] {
+  background-color: #0044cc;
+}
+.datepicker table tr td span.active:active,
+.datepicker table tr td span.active:hover:active,
+.datepicker table tr td span.active.disabled:active,
+.datepicker table tr td span.active.disabled:hover:active,
+.datepicker table tr td span.active.active,
+.datepicker table tr td span.active:hover.active,
+.datepicker table tr td span.active.disabled.active,
+.datepicker table tr td span.active.disabled:hover.active {
+  background-color: #003399 \9;
+}
+.datepicker table tr td span.old,
+.datepicker table tr td span.new {
+  color: #999999;
+}
+.datepicker .datepicker-switch {
+  width: 145px;
+}
+.datepicker .datepicker-switch,
+.datepicker .prev,
+.datepicker .next,
+.datepicker tfoot tr th {
+  cursor: pointer;
+}
+.datepicker .datepicker-switch:hover,
+.datepicker .prev:hover,
+.datepicker .next:hover,
+.datepicker tfoot tr th:hover {
+  background: #eeeeee;
+}
+.datepicker .cw {
+  font-size: 10px;
+  width: 12px;
+  padding: 0 2px 0 5px;
+  vertical-align: middle;
+}
+.input-append.date .add-on,
+.input-prepend.date .add-on {
+  cursor: pointer;
+}
+.input-append.date .add-on i,
+.input-prepend.date .add-on i {
+  margin-top: 3px;
+}
+.input-daterange input {
+  text-align: center;
+}
+.input-daterange input:first-child {
+  -webkit-border-radius: 3px 0 0 3px;
+  -moz-border-radius: 3px 0 0 3px;
+  border-radius: 3px 0 0 3px;
+}
+.input-daterange input:last-child {
+  -webkit-border-radius: 0 3px 3px 0;
+  -moz-border-radius: 0 3px 3px 0;
+  border-radius: 0 3px 3px 0;
+}
+.input-daterange .add-on {
+  display: inline-block;
+  width: auto;
+  min-width: 16px;
+  height: 18px;
+  padding: 4px 5px;
+  font-weight: normal;
+  line-height: 18px;
+  text-align: center;
+  text-shadow: 0 1px 0 #ffffff;
+  vertical-align: middle;
+  background-color: #eeeeee;
+  border: 1px solid #ccc;
+  margin-left: -5px;
+  margin-right: -5px;
+}

+ 10 - 26
src/css/main.css

@@ -9,6 +9,7 @@ body {
 }
 body {
   background:rgba(238, 238, 238, 1);
+  padding-top: 60px;
 }
 
 a {
@@ -16,6 +17,9 @@ a {
     -moz-transition: all .35s;
     transition: all .35s;
 }
+.fa {
+  margin-right: 6px;
+}
 
 
 /* =================================================
@@ -25,7 +29,11 @@ a {
 .navbar-default .navbar-header .navbar-brand {
   background-image:url(../img/ribbon.svg) no-repeat;
 }
-
+.navbar-nav img {
+  width: 30px;
+  height: 30px;
+  margin: -15px 15px -15px;
+}
 
 
 /* =================================================
@@ -65,30 +73,6 @@ header .header-content .header-content-inner p {
   color: rgba(255,255,255,.7);
 }
 
-@media(min-width:768px) {
-  header {
-    min-height: 100%;
-  }
-  header .header-content {
-    position: absolute;
-    top: 50%;
-    padding: 0 50px;
-    -webkit-transform: translateY(-50%);
-    -ms-transform: translateY(-50%);
-    transform: translateY(-50%);
-  }
-  header .header-content .header-content-inner {
-    margin-right: auto;
-    margin-left: auto;
-    max-width: 1000px;
-  }
-  header .header-content .header-content-inner p {
-    margin-right: auto;
-    margin-left: auto;
-    max-width: 80%;
-    font-size: 18px;
-  }
-}
 
 .skew:before {
   content: '';
@@ -118,7 +102,7 @@ section {
   padding:50px 0;
 }
 #partial {
-  padding:150px 0;
+  
 }
 #about {
   background-color: rgba(255,255,255,.2);

File diff suppressed because it is too large
+ 1920 - 0
src/js/bootstrap-datepicker.js


+ 305 - 0
src/js/bootstrap-validator.js

@@ -0,0 +1,305 @@
+/*!
+ * Validator v0.9.0 for Bootstrap 3, by @1000hz
+ * Copyright 2015 Cina Saffary
+ * Licensed under http://opensource.org/licenses/MIT
+ *
+ * https://github.com/1000hz/bootstrap-validator
+ */
+
++function ($) {
+  'use strict';
+
+  // VALIDATOR CLASS DEFINITION
+  // ==========================
+
+  var Validator = function (element, options) {
+    this.$element = $(element)
+    this.options  = options
+
+    options.errors = $.extend({}, Validator.DEFAULTS.errors, options.errors)
+
+    for (var custom in options.custom) {
+      if (!options.errors[custom]) throw new Error('Missing default error message for custom validator: ' + custom)
+    }
+
+    $.extend(Validator.VALIDATORS, options.custom)
+
+    this.$element.attr('novalidate', true) // disable automatic native validation
+    this.toggleSubmit()
+
+    this.$element.on('input.bs.validator change.bs.validator focusout.bs.validator', $.proxy(this.validateInput, this))
+    this.$element.on('submit.bs.validator', $.proxy(this.onSubmit, this))
+
+    this.$element.find('[data-match]').each(function () {
+      var $this  = $(this)
+      var target = $this.data('match')
+
+      $(target).on('input.bs.validator', function (e) {
+        $this.val() && $this.trigger('input.bs.validator')
+      })
+    })
+  }
+
+  Validator.INPUT_SELECTOR = ':input:not([type="submit"], button):enabled:visible'
+
+  Validator.DEFAULTS = {
+    delay: 500,
+    html: false,
+    disable: true,
+    custom: {},
+    errors: {
+      match: 'Does not match',
+      minlength: 'Not long enough'
+    },
+    feedback: {
+      success: 'glyphicon-ok',
+      error: 'glyphicon-remove'
+    }
+  }
+
+  Validator.VALIDATORS = {
+    'native': function ($el) {
+      var el = $el[0]
+      return el.checkValidity ? el.checkValidity() : true
+    },
+    'match': function ($el) {
+      var target = $el.data('match')
+      return !$el.val() || $el.val() === $(target).val()
+    },
+    'minlength': function ($el) {
+      var minlength = $el.data('minlength')
+      return !$el.val() || $el.val().length >= minlength
+    }
+  }
+
+  Validator.prototype.validateInput = function (e) {
+    var $el        = $(e.target)
+    var prevErrors = $el.data('bs.validator.errors')
+    var errors
+
+    if ($el.is('[type="radio"]')) $el = this.$element.find('input[name="' + $el.attr('name') + '"]')
+
+    this.$element.trigger(e = $.Event('validate.bs.validator', {relatedTarget: $el[0]}))
+
+    if (e.isDefaultPrevented()) return
+
+    var self = this
+
+    this.runValidators($el).done(function (errors) {
+      $el.data('bs.validator.errors', errors)
+
+      errors.length ? self.showErrors($el) : self.clearErrors($el)
+
+      if (!prevErrors || errors.toString() !== prevErrors.toString()) {
+        e = errors.length
+          ? $.Event('invalid.bs.validator', {relatedTarget: $el[0], detail: errors})
+          : $.Event('valid.bs.validator', {relatedTarget: $el[0], detail: prevErrors})
+
+        self.$element.trigger(e)
+      }
+
+      self.toggleSubmit()
+
+      self.$element.trigger($.Event('validated.bs.validator', {relatedTarget: $el[0]}))
+    })
+  }
+
+
+  Validator.prototype.runValidators = function ($el) {
+    var errors   = []
+    var deferred = $.Deferred()
+    var options  = this.options
+
+    $el.data('bs.validator.deferred') && $el.data('bs.validator.deferred').reject()
+    $el.data('bs.validator.deferred', deferred)
+
+    function getErrorMessage(key) {
+      return $el.data(key + '-error')
+        || $el.data('error')
+        || key == 'native' && $el[0].validationMessage
+        || options.errors[key]
+    }
+
+    $.each(Validator.VALIDATORS, $.proxy(function (key, validator) {
+      if (($el.data(key) || key == 'native') && !validator.call(this, $el)) {
+        var error = getErrorMessage(key)
+        !~errors.indexOf(error) && errors.push(error)
+      }
+    }, this))
+
+    if (!errors.length && $el.val() && $el.data('remote')) {
+      this.defer($el, function () {
+        var data = {}
+        data[$el.attr('name')] = $el.val()
+        $.get($el.data('remote'), data)
+          .fail(function (jqXHR, textStatus, error) { errors.push(getErrorMessage('remote') || error) })
+          .always(function () { deferred.resolve(errors)})
+      })
+    } else deferred.resolve(errors)
+
+    return deferred.promise()
+  }
+
+  Validator.prototype.validate = function () {
+    var delay = this.options.delay
+
+    this.options.delay = 0
+    this.$element.find(Validator.INPUT_SELECTOR).trigger('input.bs.validator')
+    this.options.delay = delay
+
+    return this
+  }
+
+  Validator.prototype.showErrors = function ($el) {
+    var method = this.options.html ? 'html' : 'text'
+
+    this.defer($el, function () {
+      var $group = $el.closest('.form-group')
+      var $block = $group.find('.help-block.with-errors')
+      var $feedback = $group.find('.form-control-feedback')
+      var errors = $el.data('bs.validator.errors')
+
+      if (!errors.length) return
+
+      errors = $('<ul/>')
+        .addClass('list-unstyled')
+        .append($.map(errors, function (error) { return $('<li/>')[method](error) }))
+
+      $block.data('bs.validator.originalContent') === undefined && $block.data('bs.validator.originalContent', $block.html())
+      $block.empty().append(errors)
+      $group.addClass('has-error')
+
+      $feedback.length
+        && $feedback.removeClass(this.options.feedback.success)
+        && $feedback.addClass(this.options.feedback.error)
+        && $group.removeClass('has-success')
+    })
+  }
+
+  Validator.prototype.clearErrors = function ($el) {
+    var $group = $el.closest('.form-group')
+    var $block = $group.find('.help-block.with-errors')
+    var $feedback = $group.find('.form-control-feedback')
+
+    $block.html($block.data('bs.validator.originalContent'))
+    $group.removeClass('has-error')
+
+    $feedback.length
+      && $feedback.removeClass(this.options.feedback.error)
+      && $feedback.addClass(this.options.feedback.success)
+      && $group.addClass('has-success')
+  }
+
+  Validator.prototype.hasErrors = function () {
+    function fieldErrors() {
+      return !!($(this).data('bs.validator.errors') || []).length
+    }
+
+    return !!this.$element.find(Validator.INPUT_SELECTOR).filter(fieldErrors).length
+  }
+
+  Validator.prototype.isIncomplete = function () {
+    function fieldIncomplete() {
+      return this.type === 'checkbox' ? !this.checked                                   :
+             this.type === 'radio'    ? !$('[name="' + this.name + '"]:checked').length :
+                                        $.trim(this.value) === ''
+    }
+
+    return !!this.$element.find(Validator.INPUT_SELECTOR).filter('[required]').filter(fieldIncomplete).length
+  }
+
+  Validator.prototype.onSubmit = function (e) {
+    this.validate()
+    if (this.isIncomplete() || this.hasErrors()) e.preventDefault()
+  }
+
+  Validator.prototype.toggleSubmit = function () {
+    if(!this.options.disable) return
+
+    var $btn = $('button[type="submit"], input[type="submit"]')
+      .filter('[form="' + this.$element.attr('id') + '"]')
+      .add(this.$element.find('input[type="submit"], button[type="submit"]'))
+
+    $btn.toggleClass('disabled', this.isIncomplete() || this.hasErrors())
+  }
+
+  Validator.prototype.defer = function ($el, callback) {
+    callback = $.proxy(callback, this)
+    if (!this.options.delay) return callback()
+    window.clearTimeout($el.data('bs.validator.timeout'))
+    $el.data('bs.validator.timeout', window.setTimeout(callback, this.options.delay))
+  }
+
+  Validator.prototype.destroy = function () {
+    this.$element
+      .removeAttr('novalidate')
+      .removeData('bs.validator')
+      .off('.bs.validator')
+
+    this.$element.find(Validator.INPUT_SELECTOR)
+      .off('.bs.validator')
+      .removeData(['bs.validator.errors', 'bs.validator.deferred'])
+      .each(function () {
+        var $this = $(this)
+        var timeout = $this.data('bs.validator.timeout')
+        window.clearTimeout(timeout) && $this.removeData('bs.validator.timeout')
+      })
+
+    this.$element.find('.help-block.with-errors').each(function () {
+      var $this = $(this)
+      var originalContent = $this.data('bs.validator.originalContent')
+
+      $this
+        .removeData('bs.validator.originalContent')
+        .html(originalContent)
+    })
+
+    this.$element.find('input[type="submit"], button[type="submit"]').removeClass('disabled')
+
+    this.$element.find('.has-error').removeClass('has-error')
+
+    return this
+  }
+
+  // VALIDATOR PLUGIN DEFINITION
+  // ===========================
+
+
+  function Plugin(option) {
+    return this.each(function () {
+      var $this   = $(this)
+      var options = $.extend({}, Validator.DEFAULTS, $this.data(), typeof option == 'object' && option)
+      var data    = $this.data('bs.validator')
+
+      if (!data && option == 'destroy') return
+      if (!data) $this.data('bs.validator', (data = new Validator(this, options)))
+      if (typeof option == 'string') data[option]()
+    })
+  }
+
+  var old = $.fn.validator
+
+  $.fn.validator             = Plugin
+  $.fn.validator.Constructor = Validator
+
+
+  // VALIDATOR NO CONFLICT
+  // =====================
+
+  $.fn.validator.noConflict = function () {
+    $.fn.validator = old
+    return this
+  }
+
+
+  // VALIDATOR DATA-API
+  // ==================
+
+  $(window).on('load', function () {
+    $('form[data-toggle="validator"]').each(function () {
+      var $form = $(this)
+      Plugin.call($form, $form.data())
+    })
+  })
+
+}(jQuery);

+ 3 - 0
src/js/main.js

@@ -6,6 +6,9 @@ $(window).scroll(function() {
   }
 });
 
+$('#datepicker.input-daterange').datepicker({});
+$('#event-form').validator()
+
 $(function(){
     jQuery('img.svg').each(function(){
         var $img = jQuery(this);

+ 19 - 12
src/views/account/forgot.jade

@@ -1,15 +1,22 @@
 extends ../layout
 
 block content
-  .col-sm-8.col-sm-offset-2
-    form(method='POST')
-      legend Forgot Password
-      input(type='hidden', name='_csrf', value=_csrf)
-      .form-group
-        p Enter your email address below and we will send you password reset instructions.
-        label.control-label(for='email') Email
-        input.form-control(type='email', name='email', id='email', placeholder='Email', autofocus=true)
-      .form-group
-        button.btn.btn-primary(type='submit')
-          i.fa.fa-key
-          | Reset Password
+  section#partial
+    .container
+      .row
+        .col-sm-8.col-sm-offset-2.text-center
+          h3 Log In
+      hr
+      .row
+        .col-sm-8.col-sm-offset-2
+          form(method='POST')
+            legend Forgot Password
+            input(type='hidden', name='_csrf', value=_csrf)
+            .form-group
+              p Enter your email address below and we will send you password reset instructions.
+              label.control-label(for='email') Email
+              input.form-control(type='email', name='email', id='email', placeholder='Email', autofocus=true)
+            .form-group
+              button.btn.btn-primary(type='submit')
+                i.fa.fa-key
+                | Reset Password

+ 7 - 4
src/views/account/register.jade

@@ -9,20 +9,23 @@ block content
       hr
       .row
         .col-sm-8.col-sm-offset-2
-          form.form-horizontal(id='signup-form', method='POST')
+          form.form-horizontal(data-toggle='validator', id='signup-form', method='POST')
             input(type='hidden', name='_csrf', value=_csrf)
             .form-group
               label.col-sm-3.control-label(for='email') Email
               .col-sm-7
-                input.form-control(type='email', name='email', id='email', placeholder='Email', autofocus)
+                input.form-control(type='email', name='email', id='email', placeholder='Email', autofocus, required='')
+                span.glyphicon.form-control-feedback(aria-hidden='true')
             .form-group
               label.col-sm-3.control-label(for='password') Password
               .col-sm-7
-                input.form-control(type='password', name='password', id='password', placeholder='Password')
+                input.form-control(type='password', name='password', id='password', placeholder='Password', required='', data-minlength='6')
+                span.glyphicon.form-control-feedback(aria-hidden='true')
             .form-group
               label.col-sm-3.control-label(for='confirmPassword') Confirm Password
               .col-sm-7
-                input.form-control(type='password', name='confirmPassword', id='confirmPassword', placeholder='Confirm Password')
+                input.form-control(type='password', name='confirmPassword', id='confirmPassword', placeholder='Confirm Password', required='', data-match='#password', data-match-error="Passwords DO NOT match")
+                span.glyphicon.form-control-feedback(aria-hidden='true')
             .form-group
               .col-sm-offset-3.col-sm-7
                 button.btn.btn-success(type='submit')

+ 0 - 10
src/views/entry/entry.jade

@@ -7,13 +7,3 @@ block content
         .col-sm-8.col-sm-offset-2.text-center
           h2 Entry
       hr
-      .row
-        .col-sm-8.col-sm-offset-2
-          ul.nav.nav-pills
-            li(role='presentation', class=title=='event'?'active':undefined)
-              a(href='/entry/new') new entry
-            li(role='presentation', class=title=='event'?'active':undefined)
-              a(href='/entry/list') list entries
-            li(role='presentation', class=title=='event'?'active':undefined)
-              a(href='/entry/search') search entries
-      hr

+ 26 - 0
src/views/entry/entry_new.jade

@@ -0,0 +1,26 @@
+extends ../layout
+
+block content
+  section#partial
+    .container
+      .row
+        .col-sm-8.col-sm-offset-2.text-center
+          h3 Create An Entry   
+      hr
+      .row
+        .col-sm-8.col-sm-offset-2
+          form.form-horizontal(id='entry-form', method='POST')
+            input(type='hidden', name='_csrf', value=_csrf)
+            .form-group
+              label.col-sm-3.control-label(for='entryname') Entry Name
+              .col-sm-7
+                input.form-control(type='text', name='entryname', id='entryname', value='', autofocus)
+            .form-group
+              label.col-sm-3.control-label(for='entryname') Entry Description
+              .col-sm-7
+                textarea.form-control(type='textarea', rows='5', name='entrydesc', id='entrydesc', value='', autofocus)
+            .form-group
+              .col-sm-offset-3.col-sm-7
+                button.btn.btn-success(type='submit')
+                  i.fa.fa-balance-scale
+                  | Create Entry

+ 0 - 10
src/views/event/event.jade

@@ -7,13 +7,3 @@ block content
         .col-sm-8.col-sm-offset-2.text-center
           h2 Event
       hr
-      .row
-        .col-sm-8.col-sm-offset-2
-          ul.nav.nav-pills
-            li(role='presentation', class=title=='event'?'active':undefined)
-              a(href='/event/new') new event
-            li(role='presentation', class=title=='event'?'active':undefined)
-              a(href='/event/list') list events
-            li(role='presentation', class=title=='event'?'active':undefined)
-              a(href='/event/search') search events
-      hr

+ 31 - 14
src/views/event/event_new.jade

@@ -4,31 +4,48 @@ block content
   section#partial
     .container
       .row
-        .col-sm-8.col-sm-offset-2
-          ul.nav.nav-pills
-            li(role='presentation', class=title=='event'?'active':undefined)
-              a(href='/event/new') new event
-            li(role='presentation', class=title=='event'?'active':undefined)
-              a(href='/event/search') seach events
-            li(role='presentation', class=title=='event'?'active':undefined)
-              a(href='/event/list') list events
-      hr
-      .row
         .col-sm-8.col-sm-offset-2.text-center
           h3 Create An Event      
       hr
       .row
         .col-sm-8.col-sm-offset-2
-          form.form-horizontal(id='event-form', method='POST')
+          form.form-horizontal(data-toggle='validator', role='form', id='event-form', method='POST')
             input(type='hidden', name='_csrf', value=_csrf)
-            .form-group
+            .form-group.has-feedback
               label.col-sm-3.control-label(for='eventname') Event Name
               .col-sm-7
-                input.form-control(type='text', name='eventname', id='eventname', value='', autofocus)
+                input.form-control(type='text', name='eventname', id='eventname', value='', autofocus, required='')
+                span.glyphicon.form-control-feedback(aria-hidden='true')
             .form-group
               label.col-sm-3.control-label(for='eventname') Event Description
               .col-sm-7
-                textarea.form-control(type='textarea', rows='5', name='eventdesc', id='eventdesc', value='', autofocus)
+                textarea.form-control(type='textarea', rows='5', name='eventdesc', id='eventdesc', value='', autofocus, data-minlength='25', data-error='Minimum of 25 letters' required='')
+                .help-block.with-errors
+            .form-group
+              label.col-sm-3.control-label(for='eventname') Entry Dates
+              .col-sm-7
+                #datepicker.input-daterange.input-group
+                  input.input-sm.form-control(type='text', name='eventopendate', required='')
+                  span.input-group-addon to
+                  input.input-sm.form-control(type='text', name='eventenddate', required='')
+            .form-group
+              label.col-sm-3.control-label(for='registrationtype') Registration Type
+              .col-sm-7
+                label.radio.col-sm-4
+                  input(type='radio', name='registrationtype', value='open', data-toggle='radio', required='')
+                  span Open
+                label.radio.col-sm-4
+                  input(type='radio', name='registrationtype', value='invite', data-toggle='radio', required='')
+                  span Invite
+            .form-group
+              label.col-sm-3.control-label(for='jurytype') Jury Type
+              .col-sm-7
+                label.radio.col-sm-4
+                  input(type='radio', name='jurytype', value='registrant', data-toggle='radio', required='')
+                  span Registrant
+                label.radio.col-sm-4
+                  input(type='radio', name='jurytype', value='assigned', data-toggle='radio', required='')
+                  span Assigned
             .form-group
               .col-sm-offset-3.col-sm-7
                 button.btn.btn-success(type='submit')

+ 4 - 2
src/views/home.jade

@@ -57,7 +57,7 @@ header
   section#call
     .container
       .row
-        .col-sm-4.col-lg-offset-2.text-center
+        .col-sm-4.col-sm-offset-2.text-center
           h4.section-heading Connect
           hr.light
           p (Social Media Icons)
@@ -69,4 +69,6 @@ header
               .input-group
                 input#email-address.form-control(type="text", placeholder="Email Address")
                 .input-group-addon
-                  button.btn.btn-primary(type="submit") GO
+                  button.btn.btn-primary(type="submit") GO
+        .col-sm-4.text-center
+          h4.section-heading Lastly:

+ 3 - 3
src/views/pages/index.jade

@@ -1,4 +1,4 @@
-extends ../layout
+extends layout
 
 block content
 
@@ -8,7 +8,7 @@ block content
         .header-content
           .header-content-inner
             .row
-              .col-sm-8.col-sm-offset-3
+              .col-sm-8.col-sm-offset-2.text-center
                 h1 Juryd
                 h2 You be the Judge
                 h3 Juryd is an application that allows the participants to register, submit, and vote in juried competitions.
@@ -57,7 +57,7 @@ block content
   section#call
     .container
       .row
-        .col-sm-4.col-lg-offset-2.text-center
+        .col-sm-4.col-sm-offset-2.text-center
           h4.section-heading Connect
           hr.light
           p (Social Media Icons)

+ 2 - 2
src/views/layout.jade

@@ -10,9 +10,9 @@ html
     link(rel='stylesheet', href='/css/style.min.css')
   body
   
-    include partials/flash
-    
     include partials/header
+    
+    include partials/flash
                 
     block content
 

+ 32 - 7
src/views/partials/header.jade

@@ -8,14 +8,39 @@
         span.icon-bar
       a.navbar-brand(href='/')
         img.svg.icon-small(src="/img/ribbon.svg")
+    
     .collapse.navbar-collapse
-      ul.nav.navbar-nav
-        li(class=title=='event'?'active':undefined)
-          a(href='/event') event
-        li(class=title=='entry'?'active':undefined)
-          a(href='/entry') entry
-        li(class=title=='api'?'active':undefined)
-          a(href='/api') api
+      if user
+        ul.nav.navbar-nav
+          li.dropdown(class=title=='Events'?'active':undefined)
+            a.dropdown-toggle(href='#', data-toggle='dropdown')
+              | Events &nbsp;
+              i.caret
+            ul.dropdown-menu
+              li
+                a(href='/event') event
+              li
+                a(href='/event/new') New Event
+              li
+                a(href='/event/list') List Events
+              li
+                a(href='/event/search') Search Events
+                
+          li.dropdown(class=title=='Entries'?'active':undefined)
+            a.dropdown-toggle(href='#', data-toggle='dropdown')
+              | Entries &nbsp;
+              i.caret
+            ul.dropdown-menu     
+              li
+                a(href='/entry') entry
+              li
+                a(href='/entry/new') New Entry
+              li
+                a(href='/entry/list') List Entries
+              li
+                a(href='/entry/search') Search Entries
+
+      else
       ul.nav.navbar-nav.navbar-right
         if !user
           li(class=title=='Login'?'active':undefined)