Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 8 commits
  • 19 files changed
  • 0 comments
  • 1 contributor
4  README.md
Source Rendered
@@ -6,9 +6,9 @@ It's a pretty basic node/express app
6 6
 
7 7
 Getting it running should be easy:
8 8
 
9  
-1) Make sure you have mongodb installed
  9
+1) Make sure you have mongodb and redis installed
10 10
 
11  
-2) Pull it down and run:
  11
+2) Pull it down, install, run
12 12
     
13 13
     git clone git@github.com:jsla/js-la-jobs.git
14 14
     cd js-la-jobs && npm install
9  TODO.md
Source Rendered
@@ -3,12 +3,13 @@
3 3
 In no particular order
4 4
 
5 5
 * Views should be dry'd up, partials could de-dupe some markup
6  
-* Posting should have a view to accept payment
7  
-* Site should integrate with Stripe for payment
8  
-* Postings should become "active" after payment
  6
+* Postings should have "how to apply"
9 7
 * Postings should be searchable
10 8
 * Postings should have tags
11 9
 * New postings should ensure valid fields
12 10
 * Postings list should be paginated
13 11
 * Errors should be logged/counted
14  
-* Site should be integrated with analytics (Google, etc..)
  12
+* Site should be integrated with analytics (Google, etc..)
  13
+* Stripe keys should live outside codebase
  14
+* Posting should display company logo (if available)
  15
+* Flash/status messages should show successful/unsuccessful actions
9  app.js
@@ -13,6 +13,11 @@ var express = require('express')
13 13
 
14 14
 var app = express();
15 15
 
  16
+setUser = function(req, res, next) {
  17
+  app.locals.currentUser = req.session.currentUser
  18
+  next()
  19
+}
  20
+
16 21
 app.configure(function(){
17 22
   app.set('port', process.env.PORT || 3000);
18 23
   app.set('views', __dirname + '/views');
@@ -24,6 +29,7 @@ app.configure(function(){
24 29
       secret: "the joined advice reads across whatever reserved"
25 30
     , store: new RedisStore
26 31
   }))
  32
+  app.use(setUser)
27 33
   app.use(express.bodyParser());
28 34
   app.use(express.methodOverride());
29 35
   app.use(app.router);
@@ -34,6 +40,9 @@ app.configure('development', function(){
34 40
   app.use(express.errorHandler());
35 41
 });
36 42
 
  43
+
  44
+
  45
+
37 46
 var helpers = {
38 47
   auth: function(req, res, next) {
39 48
     if (req.session.currentUser) {
8  public/css/style.css
... ...
@@ -1,10 +1,16 @@
1 1
 body {
2 2
   font-size: 14px; }
3 3
 
  4
+a {
  5
+  cursor: pointer; }
  6
+
4 7
 textarea.posting_body {
5 8
   height: 300px; }
6 9
 
7  
-.new {
  10
+#header .logo a {
  11
+  text-decoration: none;
  12
+  color: #444; }
  13
+#header .user {
8 14
   float: right; }
9 15
 
10 16
 .jobs a:hover {
19  public/css/style.scss
@@ -3,12 +3,27 @@ body {
3 3
   // "Lucida Grande", Helvetica, Arial, sans-serif;
4 4
 }
5 5
 
  6
+a {
  7
+  cursor: pointer;
  8
+}
  9
+
6 10
 textarea.posting_body {
7 11
   height: 300px;
8 12
 }
9 13
 
10  
-.new {
11  
-  float: right;
  14
+#header {
  15
+
  16
+  .logo {
  17
+    a {
  18
+      text-decoration: none;
  19
+      color: #444;
  20
+    }
  21
+  }
  22
+
  23
+  .user {
  24
+    float: right;
  25
+  }
  26
+
12 27
 }
13 28
 
14 29
 .jobs {
4  routes/accounts.js
@@ -54,10 +54,6 @@ module.exports = function(app, helpers) {
54 54
     
55 55
   })
56 56
 
57  
-  app.get('/login', function(req, res) {
58  
-    res.render('accounts/login', {title: 'Account Login | LA.js Job Board'})
59  
-  })
60  
-
61 57
   app.post('/login', function(req, res) {
62 58
     var token = req.body.token
63 59
 
1  routes/jobs.js
@@ -92,6 +92,7 @@ module.exports = function(app, helpers) {
92 92
 
93 93
     Job.findOne(conditions, function(err, job) {
94 94
       if (err) {
  95
+        console.log(err)
95 96
         res.send(500)
96 97
       } else if (!job) {
97 98
         res.send(404)
15  views/accounts/jobs.jade
... ...
@@ -1,17 +1,14 @@
1 1
 extends ../layout
2 2
 
3  
-block content
4  
-  .row
5  
-    .span12
6  
-      .site
7  
-        h3 LA.js Jobs
8  
-      .back
9  
-        a(href='/jobs') Back to Jobs
  3
+append header
  4
+  .back
  5
+    a(href='/jobs') Back to All Jobs
  6
+
  7
+block content    
10 8
   
11 9
   .page-header
12 10
     h1 My Postings
13  
-    
14  
-    
  11
+
15 12
   .jobs.row
16 13
     .span12
17 14
   
9  views/accounts/login.jade
... ...
@@ -1,9 +0,0 @@
1  
-extends ../layout
2  
-
3  
-block content
4  
-  
5  
-  .page-header
6  
-    h1 LA.js Job Board
7  
-    
8  
-    .login
9  
-      img(src='/img/sign_in_blue.png')
4  views/includes/footer.jade
... ...
@@ -0,0 +1,4 @@
7  views/includes/head.jade
... ...
@@ -0,0 +1,7 @@
  1
+head
  2
+  title= title
  3
+  
  4
+  link(rel='stylesheet', href='/css/bootstrap.min.css')
  5
+  link(rel='stylesheet', href='/css/bootstrap-responsive.min.css')
  6
+
  7
+  link(rel='stylesheet', href='/css/style.css')
20  views/includes/header.jade
... ...
@@ -0,0 +1,20 @@
  1
+#header
  2
+  .user
  3
+    if currentUser
  4
+      span.my-jobs
  5
+        a(href='/my/jobs') View My Jobs 
  6
+      | or 
  7
+      span.new
  8
+        a(href='/jobs/new') Create a Job Posting 
  9
+    else
  10
+      span.login
  11
+        a Sign In 
  12
+      | or 
  13
+      span.login
  14
+        a Sign Up 
  15
+      | to create a job posting 
  16
+
  17
+  .page-header
  18
+    .logo
  19
+      a(href='/')
  20
+        h1 LA.js Job Board
11  views/includes/scripts.jade
... ...
@@ -0,0 +1,11 @@
  1
+script(src='https://login.persona.org/include.js')
  2
+script(src='http://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.2/jquery.min.js')
  3
+script(src='http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.0.4/bootstrap.min.js')
  4
+
  5
+script(src='https://js.stripe.com/v1/')
  6
+script(type='text/javascript')
  7
+  Stripe.setPublishableKey('pk_05DZzfxqFiSJFgjCtMSsaI7rt9YNE');
  8
+
  9
+script(src='/js/vendor/timeago.js')
  10
+
  11
+script(src='/js/main.js')
42  views/jobs/activate.jade
... ...
@@ -1,12 +1,10 @@
1 1
 extends ../layout
2 2
 
  3
+append header
  4
+  .back
  5
+    a(href='/my/jobs') Back to My Jobs
  6
+
3 7
 block content
4  
-  .row
5  
-    .span12
6  
-      .site
7  
-        h3 LA.js Jobs
8  
-      .back
9  
-        a(href='/jobs') Back to Jobs
10 8
 
11 9
   .job
12 10
     .summary.page-header
@@ -23,20 +21,20 @@ block content
23 21
         | posted 
24 22
         time.timeago(datetime=job.created_at.toISOString())
25 23
 
26  
-  form(action='', method='POST', class='payment-form')
27  
-    .form-row
28  
-      <label>Card Number</label>
29  
-      <input type='text' size='20' autocomplete='off' class='card-number'/>
30  
-    
31  
-    .form-row
32  
-      <label>CVC</label>
33  
-      <input type='text' size='4' autocomplete='off' class='card-cvc'/>
  24
+    form(action='', method='POST', class='payment-form')
  25
+      .form-row
  26
+        label Card Number
  27
+        input(type='text', size='20', autocomplete='off', class='card-number')
  28
+      
  29
+      .form-row
  30
+        label CVC
  31
+        input(type='text', size='4', autocomplete='off', class='card-cvc')
34 32
 
35  
-    .form-row
36  
-      label Expiration (MM/YYYY)
37  
-      input(type='text', size='2', class='card-expiry-month')
38  
-      span /
39  
-      input(type='text', size='4', class='card-expiry-year')
40  
-    
41  
-    button(type='submit', class='submit-button') Submit Payment
42  
-  
  33
+      .form-row
  34
+        label Expiration (MM/YYYY)
  35
+        input(type='text', size='2', class='card-expiry-month')
  36
+        span /
  37
+        input(type='text', size='4', class='card-expiry-year')
  38
+      
  39
+      button(type='submit', class='submit-button') Submit Payment
  40
+    
13  views/jobs/edit.jade
... ...
@@ -1,15 +1,10 @@
1 1
 extends ../layout
2 2
 
  3
+append header
  4
+  .back
  5
+    a(href='/my/jobs') Back to My Jobs
  6
+
3 7
 block content
4  
-  .row
5  
-    .span12
6  
-      .site
7  
-        h3 LA.js Jobs
8  
-      .back
9  
-        a(href='/jobs') Back to Jobs
10  
-        
11  
-  .page-header
12  
-    h2 Edit Job Posting
13 8
 
14 9
   .row
15 10
     .new-job.span12 
11  views/jobs/index.jade
... ...
@@ -1,17 +1,8 @@
1 1
 extends ../layout
2 2
 
  3
+
3 4
 block content
4 5
   
5  
-  .page-header
6  
-    h1 LA.js Job Board
7  
-
8  
-    .new
9  
-      a(href='/jobs/new') Create Job Posting
10  
-
11  
-    if currentUser
12  
-      .my-jobs
13  
-        a(href='/my/jobs') View My Jobs
14  
-
15 6
   .jobs.row
16 7
     .span12
17 8
 
11  views/jobs/new.jade
... ...
@@ -1,12 +1,11 @@
1 1
 extends ../layout
2 2
 
  3
+append header
  4
+
  5
+  .back
  6
+    a(href='/my/jobs') Back to My Jobs
  7
+
3 8
 block content
4  
-  .row
5  
-    .span12
6  
-      .site
7  
-        h3 LA.js Jobs
8  
-      .back
9  
-        a(href='/jobs') Back to Jobs
10 9
         
11 10
   .page-header
12 11
     h2 New Job Posting
12  views/jobs/show.jade
... ...
@@ -1,12 +1,10 @@
1 1
 extends ../layout
2 2
 
3  
-block content
4  
-  .row
5  
-    .span12
6  
-      .site
7  
-        h3 LA.js Jobs
8  
-      .back
9  
-        a(href='/jobs') Back to Jobs
  3
+append header
  4
+  .back
  5
+    a(href='/jobs') Back to Jobs
  6
+
  7
+block content    
10 8
 
11 9
   .job
12 10
     .summary.page-header
30  views/layout.jade
... ...
@@ -1,26 +1,18 @@
1 1
 doctype 5
2 2
 html
3  
-  head
4  
-    title= title
5  
-    
6  
-    link(rel='stylesheet', href='/css/bootstrap.min.css')
7  
-    link(rel='stylesheet', href='/css/bootstrap-responsive.min.css')
8  
-
9  
-    link(rel='stylesheet', href='/css/style.css')
  3
+  include includes/head
10 4
 
11 5
   body
12 6
     .container
13  
-        block content
  7
+      block header
  8
+        include includes/header
14 9
 
  10
+      #main
  11
+        block content
  12
+        
  13
+      
  14
+      block footer
  15
+        include includes/footer
15 16
 
16  
-    script(src='https://login.persona.org/include.js')
17  
-    script(src='http://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.2/jquery.min.js')
18  
-    script(src='http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.0.4/bootstrap.min.js')
19  
-
20  
-    script(src='https://js.stripe.com/v1/')
21  
-    script(type='text/javascript')
22  
-      Stripe.setPublishableKey('pk_05DZzfxqFiSJFgjCtMSsaI7rt9YNE');
23  
-    
24  
-    script(src='/js/vendor/timeago.js')
25  
-    
26  
-    script(src='/js/main.js')
  17
+    include includes/scripts
  18
+    

No commit comments for this range

Something went wrong with that request. Please try again.