From 5b6a12754930a5d52ce762d9d35bee2c3bda0ec2 Mon Sep 17 00:00:00 2001 From: Jacob Cody Wimer Date: Thu, 26 Dec 2013 14:39:20 -0500 Subject: [PATCH] Added styling --- Gemfile | 6 + Gemfile.lock | 16 ++ app/assets/javascripts/application.js | 1 + app/assets/javascripts/static_pages.js.coffee | 3 + app/assets/stylesheets/application.css.scss | 13 ++ app/assets/stylesheets/custom.css.scss | 151 ++++++++++++++++++ app/assets/stylesheets/static_pages.css.scss | 3 + app/controllers/static_pages_controller.rb | 6 + app/helpers/static_pages_helper.rb | 2 + app/views/layouts/_footer.html.erb | 12 ++ app/views/layouts/_header.html.erb | 13 ++ app/views/layouts/_shim.html.erb | 3 + app/views/layouts/application.html.erb | 31 ++-- app/views/static_pages/index.html.erb | 2 + config/routes.rb | 2 +- .../static_pages_controller_test.rb | 7 + test/helpers/static_pages_helper_test.rb | 4 + 17 files changed, 262 insertions(+), 13 deletions(-) create mode 100644 app/assets/javascripts/static_pages.js.coffee create mode 100644 app/assets/stylesheets/application.css.scss create mode 100644 app/assets/stylesheets/custom.css.scss create mode 100644 app/assets/stylesheets/static_pages.css.scss create mode 100644 app/controllers/static_pages_controller.rb create mode 100644 app/helpers/static_pages_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/index.html.erb create mode 100644 test/controllers/static_pages_controller_test.rb create mode 100644 test/helpers/static_pages_helper_test.rb diff --git a/Gemfile b/Gemfile index 8653a51..f84a6c8 100644 --- a/Gemfile +++ b/Gemfile @@ -38,6 +38,12 @@ group :doc do gem 'sdoc', require: false end +#MY GEMS +gem 'devise' +gem 'cancan' +gem 'bootstrap-sass', '2.3.2.0' + + # Use ActiveModel has_secure_password # gem 'bcrypt-ruby', '~> 3.1.2' diff --git a/Gemfile.lock b/Gemfile.lock index 0fc9d53..6739bde 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -27,7 +27,11 @@ GEM tzinfo (~> 0.3.37) arel (4.0.1) atomic (1.1.14) + bcrypt-ruby (3.1.2) + bootstrap-sass (2.3.2.0) + sass (~> 3.2) builder (3.1.4) + cancan (1.6.10) coffee-rails (4.0.1) coffee-script (>= 2.2.0) railties (>= 4.0.0, < 5.0) @@ -35,6 +39,12 @@ GEM coffee-script-source execjs coffee-script-source (1.6.3) + devise (3.2.2) + bcrypt-ruby (~> 3.0) + orm_adapter (~> 0.1) + railties (>= 3.2.6, < 5) + thread_safe (~> 0.1) + warden (~> 1.2.3) erubis (2.7.0) execjs (2.0.2) hike (1.2.3) @@ -52,6 +62,7 @@ GEM mime-types (1.25.1) minitest (4.7.5) multi_json (1.8.2) + orm_adapter (0.5.0) pg (0.15.1) polyglot (0.3.3) rack (1.5.2) @@ -104,12 +115,17 @@ GEM uglifier (2.4.0) execjs (>= 0.3.0) json (>= 1.8.0) + warden (1.2.3) + rack (>= 1.0) PLATFORMS ruby DEPENDENCIES + bootstrap-sass (= 2.3.2.0) + cancan coffee-rails (~> 4.0.0) + devise jbuilder (~> 1.2) jquery-rails pg (= 0.15.1) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index d6925fa..7743176 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -14,3 +14,4 @@ //= require jquery_ujs //= require turbolinks //= require_tree . +//= require bootstrap diff --git a/app/assets/javascripts/static_pages.js.coffee b/app/assets/javascripts/static_pages.js.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/static_pages.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://coffeescript.org/ diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss new file mode 100644 index 0000000..3192ec8 --- /dev/null +++ b/app/assets/stylesheets/application.css.scss @@ -0,0 +1,13 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, + * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the top of the + * compiled file, but it's generally better to create a new file per style scope. + * + *= require_self + *= require_tree . + */ diff --git a/app/assets/stylesheets/custom.css.scss b/app/assets/stylesheets/custom.css.scss new file mode 100644 index 0000000..989267f --- /dev/null +++ b/app/assets/stylesheets/custom.css.scss @@ -0,0 +1,151 @@ +@import "bootstrap"; + +/* mixins, variables, etc. */ + +$grayMediumLight: #eaeaea; +$lightGray: #999; +$grayLight: #999; +$grayDarker: #2F4F4F; +$grayLighter: #A8A8A8; +$blue: #0000FF; + +@mixin box_sizing { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; +} + +/* universal */ + +html { + overflow-y: scroll; +} + +body { + padding-top: 60px; +} + +section { + overflow: auto; +} + +textarea { + resize: vertical; +} + +.center { + text-align: 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.2em; + 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; + &: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; + } + } +} + +/* miscellaneous */ + +.debug_dump { + clear: both; + float: left; + width: 100%; + margin-top: 45px; + @include box_sizing; +} + + +/* forms */ + +input, textarea, select, .uneditable-input { + border: 1px solid #bbb; + width: 100%; + margin-bottom: 15px; + @include box_sizing; +} + +input { + height: auto !important; +} + +#error_explanation { + color: #f00; + ul { + list-style: none; + margin: 0 0 18px 0; + } +} + +.field_with_errors { + @extend .control-group; + @extend .error; +} + diff --git a/app/assets/stylesheets/static_pages.css.scss b/app/assets/stylesheets/static_pages.css.scss new file mode 100644 index 0000000..d55836c --- /dev/null +++ b/app/assets/stylesheets/static_pages.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the StaticPages 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 new file mode 100644 index 0000000..ef48a24 --- /dev/null +++ b/app/controllers/static_pages_controller.rb @@ -0,0 +1,6 @@ +class StaticPagesController < ApplicationController + + def index + end + +end diff --git a/app/helpers/static_pages_helper.rb b/app/helpers/static_pages_helper.rb new file mode 100644 index 0000000..2d63e79 --- /dev/null +++ b/app/helpers/static_pages_helper.rb @@ -0,0 +1,2 @@ +module StaticPagesHelper +end diff --git a/app/views/layouts/_footer.html.erb b/app/views/layouts/_footer.html.erb new file mode 100644 index 0000000..fdbf9d5 --- /dev/null +++ b/app/views/layouts/_footer.html.erb @@ -0,0 +1,12 @@ + \ No newline at end of file diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb new file mode 100644 index 0000000..3b09e86 --- /dev/null +++ b/app/views/layouts/_header.html.erb @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/app/views/layouts/_shim.html.erb b/app/views/layouts/_shim.html.erb new file mode 100644 index 0000000..efa9707 --- /dev/null +++ b/app/views/layouts/_shim.html.erb @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 2b6c22f..9bf2cae 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,14 +1,21 @@ - - Wrestling - <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %> - <%= javascript_include_tag "application", "data-turbolinks-track" => true %> - <%= csrf_meta_tags %> - - - -<%= yield %> - - - + + Comet Wrestling + <%= stylesheet_link_tag "application", media: "all" %> + <%= javascript_include_tag "application" %> + <%= csrf_meta_tags %> + <%= render 'layouts/shim' %> + + + <%= render 'layouts/header' %> +
+ <% flash.each do |key, value| %> +
<%= value %>
+ <% end %> + <%= yield %> + <%= render 'layouts/footer' %> + <%= debug(params) if Rails.env.development? %> +
+ + \ No newline at end of file diff --git a/app/views/static_pages/index.html.erb b/app/views/static_pages/index.html.erb new file mode 100644 index 0000000..e4afd2e --- /dev/null +++ b/app/views/static_pages/index.html.erb @@ -0,0 +1,2 @@ +

CCHS Wrestling

+

1st Annual Comet Classic

diff --git a/config/routes.rb b/config/routes.rb index 29a6c60..e79fea3 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -3,7 +3,7 @@ Wrestling::Application.routes.draw do # See how all your routes lay out with "rake routes". # You can have the root of your site routed with "root" - # root 'welcome#index' + root 'static_pages#index' # Example of regular route: # get 'products/:id' => 'catalog#view' diff --git a/test/controllers/static_pages_controller_test.rb b/test/controllers/static_pages_controller_test.rb new file mode 100644 index 0000000..f5a43b4 --- /dev/null +++ b/test/controllers/static_pages_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class StaticPagesControllerTest < ActionController::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/helpers/static_pages_helper_test.rb b/test/helpers/static_pages_helper_test.rb new file mode 100644 index 0000000..a1f06a2 --- /dev/null +++ b/test/helpers/static_pages_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class StaticPagesHelperTest < ActionView::TestCase +end