windhamdavid 3 years ago
parent
commit
977ee820c4

+ 21 - 3
app.js

@@ -93,11 +93,14 @@ app.use(function(req, res, next) {
 
 
 
-/********** app controllers **************/
+/********** routes controllers **************/
+
+require('./routes/routes')(app);
 
 var homeController = require('./controllers/home');
 var userController = require('./controllers/user');
 var contactController = require('./controllers/contact');
+var apiController = require('./controllers/api');
 
 app.get('/', homeController.index);
 app.get('/login', userController.getLogin);
@@ -117,8 +120,23 @@ app.post('/account/password', passportConf.isAuthenticated, userController.postU
 app.post('/account/delete', passportConf.isAuthenticated, userController.postDeleteAccount);
 app.get('/account/unlink/:provider', passportConf.isAuthenticated, userController.getOauthUnlink);
 
-//app.get('/contact', contactController.getContact);
-//app.post('/contact', contactController.postContact);
+
+/********** static routes controllers **************/
+
+var staticController = require('./controllers/static');
+
+app.get('/terms', staticController.static);
+app.get('/privacy', function(req, res) {
+  res.render('pages/privacy', {
+    title: 'Privacy Policy'
+  });
+});
+
+
+/********** oauth routes controllers **************/
+
+
+
 
 /************* log **************/
 

+ 0 - 0
controllers/api.js


+ 5 - 0
controllers/static.js

@@ -0,0 +1,5 @@
+exports.static = function(req, res) {
+  res.render('pages/terms', {
+    title: 'Terms & Conditions'
+  });
+};

+ 10 - 8
gulpfile.js

@@ -38,10 +38,11 @@ gulp.task('clean', function() {
 
 
 var buildTask = function() {
-  gulp.src('./src/index.html')
-    .pipe(minifyHTML())
-    .pipe(gulp.dest('./app'));
-  gulp.src(['./src/css/bootstrap.css','./src/css/main.css'])
+  gulp.src([
+    './src/css/bootstrap.css',
+    './src/css/font-awesome.css',
+    './src/css/main.css'
+  ])
     .pipe(concat('style.min.css'))
     .pipe(minifycss())
     .pipe(gulp.dest('./app/css'));
@@ -72,10 +73,11 @@ gulp.task('build', function() {
 
 
 var watchTask = function() {
-  gulp.src('./src/index.html')
-    .pipe(minifyHTML())
-    .pipe(gulp.dest('./app'));
-  gulp.src(['./src/css/bootstrap.css', './src/css/main.css'])
+  gulp.src([
+    './src/css/bootstrap.css',
+    './src/css/font-awesome.css',
+    './src/css/main.css'
+  ])
     .pipe(concat('style.min.css'))
     .pipe(minifycss())
     .pipe(gulp.dest('./app/css'));

+ 2 - 0
models/user.js

@@ -9,6 +9,8 @@ var userSchema = new mongoose.Schema({
 
   profile: {
     name: { type: String, default: '' },
+    gender: { type: String, default: '' },
+    location: { type: String, default: '' },
     website: { type: String, default: '' },
     picture: { type: String, default: '' }
   },

File diff suppressed because it is too large
+ 2086 - 0
src/css/font-awesome.css


+ 19 - 0
src/css/main.css

@@ -156,6 +156,25 @@ header .header-content .header-content-inner p {
   }
 }
 
+.skew:before {
+  content: '';
+  position: absolute;
+  left: 0;
+  top: 106px;
+  width: 100%;
+  height: 60px;
+  background: #fff;
+  -webkit-transform: skewY(-20deg);
+  -moz-transform: skewY(-20deg);
+  -ms-transform: skewY(-20deg);
+  -o-transform: skewY(-20deg);
+  transform: skewY(-20deg);
+  -webkit-backface-visibility: hidden;
+}
+.skew {
+  background:#fff;
+}
+
 
 
 /* =================================================

BIN
src/fonts/FontAwesome.otf


BIN
src/fonts/fontawesome-webfont.eot


File diff suppressed because it is too large
+ 640 - 0
src/fonts/fontawesome-webfont.svg


BIN
src/fonts/fontawesome-webfont.ttf


BIN
src/fonts/fontawesome-webfont.woff


BIN
src/fonts/fontawesome-webfont.woff2


BIN
src/img/favicon.png


+ 23 - 19
src/views/account/login.jade

@@ -2,22 +2,26 @@ extends ../layout
 
 block content
   section#partial
-        .container
-          .row
-            .col-sm-8.col-sm-offset-2
-              form.form-horizontal(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=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')
-                .form-group
-                  .col-sm-offset-3.col-sm-7
-                    button.col-sm-3.btn.btn-primary(type='submit')
-                      i.fa.fa-user
-                      | Login
-                    a.btn.btn-link(href='/forgot') Forgot your password?
+    .container
+      .row
+        .col-sm-8.col-sm-offset-2.text-center
+          h3 Log In
+      hr
+      .row
+        .col-sm-8.col-sm-offset-2
+          form.form-horizontal(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=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')
+            .form-group
+              .col-sm-offset-3.col-sm-7
+                button.col-sm-3.btn.btn-primary(type='submit')
+                  i.fa.fa-user
+                  | Login
+                a.btn.btn-link(href='/forgot') Forgot your password?

+ 104 - 102
src/views/account/profile.jade

@@ -1,110 +1,112 @@
 extends ../layout
 
 block content
+  section#partial
+    .container
+      .row
+        .col-sm-8.col-sm-offset-2.text-center
+          h3 Profile
+      hr
+      .row
+        form.form-horizontal(action='/account/profile', 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', value='#{user.email}')
+          .form-group
+            label.col-sm-3.control-label(for='name') Name
+            .col-sm-7
+              input.form-control(type='text', name='name', id='name', value='#{user.profile.name}')
+          .form-group
+            label.col-sm-3.control-label(for='gender') Gender
+            .col-sm-4
+              label.radio.col-sm-4
+                input(type='radio', checked=user.profile.gender=='male', name='gender', value='male', data-toggle='radio')
+                span Male
+              label.radio.col-sm-4
+                input(type='radio', checked=user.profile.gender=='female', name='gender', value='female', data-toggle='radio')
+                span Female
+          .form-group
+            label.col-sm-3.control-label(for='location') Location
+            .col-sm-7
+              input.form-control(type='text', name='location', id='location', value='#{user.profile.location}')
+          .form-group
+            label.col-sm-3.control-label(for='website') Website
+            .col-sm-7
+              input.form-control(type='text', name='website', id='website', value='#{user.profile.website}')
+          .form-group
+            label.col-sm-3.control-label(for='gravatar') Gravatar
+            .col-sm-4
+              img(src="#{user.gravatar()}", class='profile', width='100', height='100')
+          .form-group
+            .col-sm-offset-3.col-sm-4
+              button.btn.btn.btn-primary(type='submit')
+                i.fa.fa-pencilr
+                | Update Profile
 
-  .container
-  .page-header
-    h3 Profile Information
+        .page-header
+          h3 Change Password
 
-  form.form-horizontal(action='/account/profile', 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', value='#{user.email}')
-    .form-group
-      label.col-sm-3.control-label(for='name') Name
-      .col-sm-7
-        input.form-control(type='text', name='name', id='name', value='#{user.profile.name}')
-    .form-group
-      label.col-sm-3.control-label(for='gender') Gender
-      .col-sm-4
-        label.radio.col-sm-4
-          input(type='radio', checked=user.profile.gender=='male', name='gender', value='male', data-toggle='radio')
-          span Male
-        label.radio.col-sm-4
-          input(type='radio', checked=user.profile.gender=='female', name='gender', value='female', data-toggle='radio')
-          span Female
-    .form-group
-      label.col-sm-3.control-label(for='location') Location
-      .col-sm-7
-        input.form-control(type='text', name='location', id='location', value='#{user.profile.location}')
-    .form-group
-      label.col-sm-3.control-label(for='website') Website
-      .col-sm-7
-        input.form-control(type='text', name='website', id='website', value='#{user.profile.website}')
-    .form-group
-      label.col-sm-3.control-label(for='gravatar') Gravatar
-      .col-sm-4
-        img(src="#{user.gravatar()}", class='profile', width='100', height='100')
-    .form-group
-      .col-sm-offset-3.col-sm-4
-        button.btn.btn.btn-primary(type='submit')
-          i.fa.fa-pencilr
-          | Update Profile
+        form.form-horizontal(action='/account/password', method='POST')
+          input(type='hidden', name='_csrf', value=_csrf)
+          .form-group
+            label.col-sm-3.control-label(for='password') New Password
+            .col-sm-7
+              input.form-control(type='password', name='password', id='password')
+          .form-group
+            label.col-sm-3.control-label(for='confirmPassword') Confirm Password
+            .col-sm-7
+              input.form-control(type='password', name='confirmPassword', id='confirmPassword')
+          .form-group
+            .col-sm-offset-3.col-sm-4
+              button.btn.btn-primary(type='submit')
+                i.fa.fa-lock
+                | Change Password
 
-  .page-header
-    h3 Change Password
+        .page-header
+          h3 Delete Account
 
-  form.form-horizontal(action='/account/password', method='POST')
-    input(type='hidden', name='_csrf', value=_csrf)
-    .form-group
-      label.col-sm-3.control-label(for='password') New Password
-      .col-sm-7
-        input.form-control(type='password', name='password', id='password')
-    .form-group
-      label.col-sm-3.control-label(for='confirmPassword') Confirm Password
-      .col-sm-7
-        input.form-control(type='password', name='confirmPassword', id='confirmPassword')
-    .form-group
-      .col-sm-offset-3.col-sm-4
-        button.btn.btn-primary(type='submit')
-          i.fa.fa-lock
-          | Change Password
+        form.form-horizontal(action='/account/delete', method='POST')
+          .form-group
+            p.col-sm-offset-3.col-sm-4 You can delete your account, but keep in mind this action is irreversible.
+            input(type='hidden', name='_csrf', value=_csrf)
+            .col-sm-offset-3.col-sm-4
+              button.btn.btn-danger(type='submit')
+                i.fa.fa-trash
+                | Delete my account
 
-  .page-header
-    h3 Delete Account
-
-  form.form-horizontal(action='/account/delete', method='POST')
-    .form-group
-      p.col-sm-offset-3.col-sm-4 You can delete your account, but keep in mind this action is irreversible.
-      input(type='hidden', name='_csrf', value=_csrf)
-      .col-sm-offset-3.col-sm-4
-        button.btn.btn-danger(type='submit')
-          i.fa.fa-trash
-          | Delete my account
-
-  .page-header
-    h3 Linked Accounts
-  .form-horizontal
-    .form-group
-      .col-sm-offset-3.col-sm-4
-        if user.instagram
-          p: a.text-danger(href='/account/unlink/instagram') Unlink your Instagram account
-        else
-          p: a(href='/auth/instagram') Link your Instagram account
-      .col-sm-offset-3.col-sm-4
-        if user.google
-          p: a.text-danger(href='/account/unlink/google') Unlink your Google account
-        else
-          p: a(href='/auth/google') Link your Google account
-      .col-sm-offset-3.col-sm-4
-        if user.facebook
-          p: a.text-danger(href='/account/unlink/facebook') Unlink your Facebook account
-        else
-          p: a(href='/auth/facebook') Link your Facebook account
-      .col-sm-offset-3.col-sm-4
-        if user.twitter
-          p: a.text-danger(href='/account/unlink/twitter') Unlink your Twitter account
-        else
-          p: a(href='/auth/twitter') Link your Twitter account
-      .col-sm-offset-3.col-sm-4
-        if user.github
-          p: a.text-danger(href='/account/unlink/github') Unlink your GitHub account
-        else
-          p: a(href='/auth/github') Link your GitHub account
-      .col-sm-offset-3.col-sm-4
-        if user.linkedin
-          p: a.text-danger(href='/account/unlink/linkedin') Unlink your LinkedIn account
-        else
-          p: a(href='/auth/linkedin') Link your LinkedIn account
+        .page-header
+          h3 Linked Accounts
+        .form-horizontal
+          .form-group
+            .col-sm-offset-3.col-sm-4
+              if user.instagram
+                p: a.text-danger(href='/account/unlink/instagram') Unlink your Instagram account
+              else
+                p: a(href='/auth/instagram') Link your Instagram account
+            .col-sm-offset-3.col-sm-4
+              if user.google
+                p: a.text-danger(href='/account/unlink/google') Unlink your Google account
+              else
+                p: a(href='/auth/google') Link your Google account
+            .col-sm-offset-3.col-sm-4
+              if user.facebook
+                p: a.text-danger(href='/account/unlink/facebook') Unlink your Facebook account
+              else
+                p: a(href='/auth/facebook') Link your Facebook account
+            .col-sm-offset-3.col-sm-4
+              if user.twitter
+                p: a.text-danger(href='/account/unlink/twitter') Unlink your Twitter account
+              else
+                p: a(href='/auth/twitter') Link your Twitter account
+            .col-sm-offset-3.col-sm-4
+              if user.github
+                p: a.text-danger(href='/account/unlink/github') Unlink your GitHub account
+              else
+                p: a(href='/auth/github') Link your GitHub account
+            .col-sm-offset-3.col-sm-4
+              if user.linkedin
+                p: a.text-danger(href='/account/unlink/linkedin') Unlink your LinkedIn account
+              else
+                p: a(href='/auth/linkedin') Link your LinkedIn account

+ 27 - 23
src/views/account/register.jade

@@ -1,26 +1,30 @@
 extends ../layout
 
 block content
-    section#partial
-          .container
-            .row
-              .col-sm-8.col-sm-offset-2
-                form.form-horizontal(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)
-                  .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')
-                  .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')
-                  .form-group
-                    .col-sm-offset-3.col-sm-7
-                      button.btn.btn-success(type='submit')
-                        i.fa.fa-user-plus
-                        | Signup
+  section#partial
+    .container
+      .row
+        .col-sm-8.col-sm-offset-2.text-center
+          h3 Register For an Account
+      hr
+      .row
+        .col-sm-8.col-sm-offset-2
+          form.form-horizontal(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)
+            .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')
+            .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')
+            .form-group
+              .col-sm-offset-3.col-sm-7
+                button.btn.btn-success(type='submit')
+                  i.fa.fa-user-plus
+                  | Signup

+ 27 - 22
src/views/contact.jade

@@ -1,25 +1,30 @@
 extends layout
 
 block content
-  .page-header
-    h3 Contact Form
-
-  form.form-horizontal(role='form', method='POST')
-    input(type='hidden', name='_csrf', value=_csrf)
-    .form-group
-      label(class='col-sm-2 control-label', for='name') Name
-      .col-sm-8
-        input.form-control(type='text', name='name', id='name', autofocus=true)
-    .form-group
-      label(class='col-sm-2 control-label', for='email') Email
-      .col-sm-8
-        input.form-control(type='text', name='email', id='email')
-    .form-group
-      label(class='col-sm-2 control-label', for='message') Body
-      .col-sm-8
-        textarea.form-control(type='text', name='message', id='message', rows='7')
-    .form-group
-      .col-sm-offset-2.col-sm-8
-        button.btn.btn-primary(type='submit')
-          i.fa.fa-envelope
-          | Send
+  section#partial
+    .container
+      .row
+        .col-sm-8.col-sm-offset-2.text-center
+          h3 Contact Us
+      hr
+      .row
+        .col-sm-8.col-sm-offset-2
+          form.form-horizontal(role='form', method='POST')
+            input(type='hidden', name='_csrf', value=_csrf)
+            .form-group
+              label(class='col-sm-2 control-label', for='name') Name
+              .col-sm-8
+                input.form-control(type='text', name='name', id='name', autofocus=true)
+            .form-group
+              label(class='col-sm-2 control-label', for='email') Email
+              .col-sm-8
+                input.form-control(type='text', name='email', id='email')
+            .form-group
+              label(class='col-sm-2 control-label', for='message') Body
+              .col-sm-8
+                textarea.form-control(type='text', name='message', id='message', rows='7')
+            .form-group
+              .col-sm-offset-2.col-sm-8
+                button.btn.btn-primary(type='submit')
+                  i.fa.fa-envelope
+                  | Send

+ 9 - 10
src/views/index.jade

@@ -4,16 +4,15 @@ block content
 
   header
     .container-fluid
-      .header-content
-        .header-content-inner
-          .row
-            .col-sm-8
-              h1 Juryd
-              h2 You be the Judge
-              hr
-              h4 Juryd is an application that allows the participants to register and vote.
-            .col-sm-4
-              img.svg(src="img/ribbon.svg")
+      .skew
+        .header-content
+          .header-content-inner
+            .row
+              .col-sm-8.col-sm-offset-3
+                h1 Juryd
+                h2 You be the Judge
+                h3 Juryd is an application that allows the participants to register, submit, and vote in juried competitions.
+         
   section#about
     .container
       .row

src/views/about.jade → src/views/pages/about.jade


src/views/home.jade → src/views/pages/home.jade


File diff suppressed because it is too large
+ 16 - 0
src/views/pages/privacy.jade


File diff suppressed because it is too large
+ 16 - 0
src/views/pages/terms.jade


+ 7 - 4
src/views/partials/footer.jade

@@ -3,7 +3,7 @@ footer.bg-dark
     .row
       .col-sm-3.col-sm-offset-2
         h5 About
-        p Documentation
+        p Docs
         p History
         p About Us
       .col-sm-3
@@ -13,6 +13,9 @@ footer.bg-dark
         p Account Preferences
       .col-sm-3
         h5 About
-        p Contact
-        p Privacy Policy
-        p Terms of Use
+        p
+          a(href='/contact') Contact
+        p 
+          a(href='/privacy') Privacy Policy
+        p 
+          a(href='/terms') Terms of Use

+ 1 - 2
src/views/partials/header.jade

@@ -7,8 +7,7 @@ nav#mainNav.navbar.navbar-default.navbar-fixed-top
         span.icon-bar
         span.icon-bar
       a.navbar-brand(href='/')
-        i.fa.fa-cube
-        | Juryd
+        img.svg.icon-small(src="img/ribbon.svg")
     .collapse.navbar-collapse
       ul.nav.navbar-nav