From 11d947206f17722f3ce50b883bf5256ba5954358 Mon Sep 17 00:00:00 2001 From: Hugo Leeney Date: Fri, 1 Feb 2013 17:32:13 +0000 Subject: [PATCH] Finish layout and routes --- Gemfile | 1 + Gemfile.lock | 2 + app/assets/javascripts/users.js.coffee | 3 + app/assets/stylesheets/custom.css.scss | 108 +++++++++ app/assets/stylesheets/users.css.scss | 3 + app/controllers/static_pages_controller.rb | 3 + app/controllers/users_controller.rb | 4 + app/helpers/application_helper.rb | 9 + app/helpers/users_helper.rb | 2 + app/views/layouts/_footer.html.erb | 13 ++ app/views/layouts/_header.html.erb | 15 ++ app/views/layouts/_shim.html.erb | 3 + app/views/layouts/application.html.erb | 25 ++- app/views/static_pages/contact.html.erb | 3 + app/views/static_pages/home.html.erb | 14 +- app/views/users/new.html.erb | 3 + config/routes.rb | 10 +- public/index.html | 241 --------------------- spec/requests/static_pages_spec.rb | 45 ++-- spec/requests/user_pages_spec.rb | 10 + spec/support/utilities.rb | 9 + 21 files changed, 240 insertions(+), 286 deletions(-) create mode 100644 app/assets/javascripts/users.js.coffee create mode 100644 app/assets/stylesheets/custom.css.scss create mode 100644 app/assets/stylesheets/users.css.scss create mode 100644 app/controllers/users_controller.rb create mode 100644 app/helpers/users_helper.rb create mode 100644 app/views/layouts/_footer.html.erb create mode 100644 app/views/layouts/_header.html.erb create mode 100644 app/views/layouts/_shim.html.erb create mode 100644 app/views/static_pages/contact.html.erb create mode 100644 app/views/users/new.html.erb delete mode 100644 public/index.html create mode 100644 spec/requests/user_pages_spec.rb create mode 100644 spec/support/utilities.rb diff --git a/Gemfile b/Gemfile index 6be90ac..e157094 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,7 @@ source 'https://rubygems.org' gem 'rails', '3.2.11' +gem 'bootstrap-sass', '2.1' # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' diff --git a/Gemfile.lock b/Gemfile.lock index 7deb826..11a4c22 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -29,6 +29,7 @@ GEM i18n (~> 0.6) multi_json (~> 1.0) arel (3.0.2) + bootstrap-sass (2.1.0.0) builder (3.0.4) capybara (1.1.2) mime-types (>= 1.16) @@ -139,6 +140,7 @@ PLATFORMS ruby DEPENDENCIES + bootstrap-sass (= 2.1) capybara (= 1.1.2) coffee-rails (= 3.2.2) jquery-rails (= 2.0.2) diff --git a/app/assets/javascripts/users.js.coffee b/app/assets/javascripts/users.js.coffee new file mode 100644 index 0000000..7615679 --- /dev/null +++ b/app/assets/javascripts/users.js.coffee @@ -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/ diff --git a/app/assets/stylesheets/custom.css.scss b/app/assets/stylesheets/custom.css.scss new file mode 100644 index 0000000..f0cfa33 --- /dev/null +++ b/app/assets/stylesheets/custom.css.scss @@ -0,0 +1,108 @@ +@import "bootstrap"; + +/* mixins, variables, etc. */ + +$grayMediumLight: #eaeaea; + + + +/* universal */ + +html { + overflow-y: scroll; +} + +body { + padding-top: 60px; +} + +section { + overflow: auto; +} + +textarea { + resize: vertical; +} + +.center { + text-align: center; +} + +.center h1 { + margin-bottom: 10px; +} + +/* typography */ + +h1, h2, h3, h4, h5, h6 { + line-height: 1; +} + +h1 { + font-size: 3em; + letter-spacing: -2px; + margin-bottom: 30px; + text-align: center; +} + +h2 { + font-size: 1.7em; + letter-spacing: -1px; + margin-bottom: 30px; + text-align: center; + font-weight: normal; + color: $grayLight; +} + +p { + font-size: 1.1em; + line-height:1.7em; +} + + +/* header */ + +#logo { + float: left; + margin-right: 10px; + font-size: 1.7em; + color: $white; + text-transform: uppercase; + letter-spacing: -1px; + padding-top: 9px; + font-weight: bold; + line-height: 1; +} + +#logo:hover { + color: $white; + text-decoration: none; +} + + + +/* footer */ +footer { + margin-top: 45px; + padding-top: 5px; + border-top: 1px solid $grayMediumLight; + color: $grayLight; + a { + color: $gray; + &:hover { + color: $grayDarker; + } + } + small { + float: left; + } + ul { + float: right; + list-style: none; + li { + float: left; + margin-left: 10px; + } + } +} + diff --git a/app/assets/stylesheets/users.css.scss b/app/assets/stylesheets/users.css.scss new file mode 100644 index 0000000..31a2eac --- /dev/null +++ b/app/assets/stylesheets/users.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the Users controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/static_pages_controller.rb b/app/controllers/static_pages_controller.rb index 19f79a9..0ef8363 100644 --- a/app/controllers/static_pages_controller.rb +++ b/app/controllers/static_pages_controller.rb @@ -7,4 +7,7 @@ def help def about end + + def contact + end end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb new file mode 100644 index 0000000..2ec9ecc --- /dev/null +++ b/app/controllers/users_controller.rb @@ -0,0 +1,4 @@ +class UsersController < ApplicationController + def new + end +end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index de6be79..f72336c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,2 +1,11 @@ module ApplicationHelper + def full_title(page_title) + base_title = "Ruby on Rails Tutorial Sample App" + if page_title.empty? + base_title + else + "#{base_title} | #{page_title}" + end + end end + diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb new file mode 100644 index 0000000..2310a24 --- /dev/null +++ b/app/helpers/users_helper.rb @@ -0,0 +1,2 @@ +module UsersHelper +end diff --git a/app/views/layouts/_footer.html.erb b/app/views/layouts/_footer.html.erb new file mode 100644 index 0000000..5c286bf --- /dev/null +++ b/app/views/layouts/_footer.html.erb @@ -0,0 +1,13 @@ + diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb new file mode 100644 index 0000000..f91a7c1 --- /dev/null +++ b/app/views/layouts/_header.html.erb @@ -0,0 +1,15 @@ +