Permalink
Browse files

Add home page with a brief intro and overview of jobs and schools.

  • Loading branch information...
1 parent b718690 commit d2eaf76fe0bfb5bdea91fe13feaef40bab0afdfd @ahorner committed Apr 2, 2012
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
@@ -0,0 +1,49 @@
+@import mixins
+
+.pod
+ :width 306px
+ :margin-right 20px
+ :float left
+ &.last
+ :margin-right 0px
+ h2
+ :display block
+ :border-top 1px solid #222
+ :padding 10px 0 8px
+ :border-bottom 1px dotted #222
+ :text-transform uppercase
+ :font-size 12px
+ .text
+ :text-align justify
+ p
+ :padding 0 15px 0 5px
+ .item
+ :height 85px
+ :margin 5px 0
+ .icon
+ :padding 4px
+ :float left
+ :background #333
+ :line-height 0
+ @include border-radius(4px)
+ img
+ :width 93px
+ :height 65px
+ :margin 0
+ .summary
+ :float left
+ :margin-top 3px
+ :margin-left 10px
+ > a
+ :font-size 12px
+ :font-weight bold
+ .tags
+ :margin 5px 0
+ .description
+ :display inline-block
+ :width 195px
+ :line-height 15px
+ :height 30px
+ :overflow hidden
+ :white-space nowrap
+ :text-overflow ellipsis
@@ -209,16 +209,17 @@
:display inline
p
:display inline
- .tags
- h2
- :display inline
- :line-height 13px
- a
- :font-weight normal
- :display inline-block
- :padding 1px 4px
- :font-size 11px
- :color #222
- :background-color #dedede
- :text-decoration none
- :text-transform uppercase
+
+.tags
+ .tag
+ :display inline
+ :line-height 13px
+ a
+ :font-weight normal
+ :display inline-block
+ :padding 1px 4px
+ :font-size 11px
+ :color #222
+ :background-color #dedede
+ :text-decoration none
+ :text-transform uppercase
@@ -0,0 +1,7 @@
+class MainController < ApplicationController
+
+ def welcome
+ @jobs = Job.order('end_date DESC').limit(3)
+ @schools = School.order('graduation_date DESC').limit(3)
+ end
+end
@@ -20,4 +20,4 @@
.tags
- item.tags.each do |tag|
= ', ' unless tag == item.tags.first
- %h2= link_to tag.category.name, category_jobs_path(tag.category)
+ %h2.tag= link_to tag.category.name, category_jobs_path(tag.category)
@@ -0,0 +1,27 @@
+.pod#welcome_pod
+ %h2== Welcome
+ .text
+ :textile
+ #{t('copy.welcome')}
+.pod#job_pod
+ %h2== Work
+ - @jobs.each do |job|
+ .item
+ .icon= image_tag job.icon.url
+ .summary
+ = link_to job.name, job
+ .tags
+ - job.tags.each do |tag|
+ .tag= link_to tag.category.name, category_jobs_path(tag.category)
+ %span.description= job.description
+.pod.last#education_pod
+ %h2== Education
+ - @schools.each do |school|
+ .item
+ .icon= image_tag school.icon.url
+ .summary
+ = link_to school.name, school
+ .tags
+ - school.tags.each do |tag|
+ .tag= link_to tag.category.name, category_schools_path(tag.category)
+ %span.description= school.details
@@ -14,4 +14,12 @@ en:
You aren't permitted to access this page. If you reached this page by following a link, please use the contact information in the footer to let me know so I can fix the problem.
- If, however, you reached this page because you're one of those know-it-alls who happens to understand RESTful routes, mission accomplished! Now stop digging around, would you kindly?
+ If, however, you reached this page because you're one of those know-it-alls who happens to understand RESTful routes, mission accomplished! Now stop digging around, would you kindly?
+ welcome: |
+ h3. I'm Andrew Horner.
+
+ I imagine, write, design, and develop -- not in any particular order, and often all at once.
+
+ I believe that showing is always better than telling, and I believe that good code and good design should speak for themselves.
+
+ That's why I've published the source for this r&eacute;sum&eacute; (there's a link in the footer).
View
@@ -13,5 +13,5 @@
match 'login' => 'user_sessions#create', as: :login
match 'logout' => 'user_sessions#destroy', as: :logout
- root to: 'jobs#index'
+ root to: 'main#welcome'
end
@@ -0,0 +1,25 @@
+require 'spec_helper'
+
+describe MainController do
+
+ describe "given at least one job and school" do
+ before(:each) do
+ @job = create(:job)
+ @school = create(:school)
+ end
+
+ describe "GET welcome" do
+ before(:each) do
+ get :welcome
+ end
+
+ it "should assign all jobs to @jobs" do
+ assigns(:jobs).should eq([@job])
+ end
+
+ it "should assign all schools to @schools" do
+ assigns(:schools).should eq([@school])
+ end
+ end
+ end
+end
@@ -0,0 +1,11 @@
+require 'spec_helper'
+
+describe MainController do
+
+ describe "routing" do
+
+ it "routes to #welcome" do
+ get('/').should route_to('main#welcome')
+ end
+ end
+end

0 comments on commit d2eaf76

Please sign in to comment.