Browse Source

Merge pull request #107 from spacemunkay/brigitte-sass

Updated Sign In Page
topic-sass
Jason Denney 8 years ago
committed by GitHub
parent
commit
a7bdfd7a04
  1. 2
      .gitignore
  2. 2
      .ruby-version
  3. 45
      Gemfile
  4. 237
      Gemfile.lock
  5. BIN
      app/assets/images/velo_logo.png
  6. 4
      app/assets/javascripts/application.js
  7. 26
      app/assets/stylesheets/application.css
  8. 47
      app/assets/stylesheets/bootstrap_and_overrides.css.less
  9. 31
      app/assets/stylesheets/bootstrap_and_overrides.css.scss
  10. 4
      app/views/devise/_links.erb
  11. 86
      app/views/devise/sessions/new.html.erb
  12. 5
      config/application.rb
  13. 31
      spec/factories/bikes.rb
  14. 8
      spec/factories/users.rb

2
.gitignore

@ -10,3 +10,5 @@ public/extjs
public/assets public/assets
public/images/icons public/images/icons
config/database.yml config/database.yml
vendor/
.sass-cache/

2
.ruby-version

@ -1 +1 @@
ruby-1.9.3-p374 2.1.1

45
Gemfile

@ -1,51 +1,50 @@
source 'https://rubygems.org' source 'https://rubygems.org'
gem 'rails', '3.2.13' gem 'rails', '3.2.19'
gem 'netzke-cancan' gem 'netzke-cancan'
gem 'netzke-core', '~>0.8.0' gem 'netzke-core'
gem 'netzke-basepack', '~>0.8.0' gem 'netzke-basepack'
gem 'acts_as_loggable', :git => 'https://github.com/spacemunkay/acts_as_loggable.git' gem 'acts_as_loggable', :git => 'https://github.com/spacemunkay/acts_as_loggable.git'
gem 'bootstrap-will_paginate', '~> 0.0.6' gem 'bootstrap-will_paginate'
gem 'cancan' gem 'cancan'
gem 'decent_exposure', '~> 1.0.1' gem 'decent_exposure', '~> 1.0.1'
gem 'devise', '~> 2.0.4' gem 'devise', '~> 2.0.4'
gem 'haml-rails', '~> 0.3.4' gem 'haml-rails'
gem 'jquery-rails', '~> 2.0' gem 'jquery-rails'
gem 'pg', '~> 0.17.1' gem 'pg', '~> 0.17.1'
gem 'will_paginate', '~> 3.0.3' gem 'will_paginate'
gem 'jbuilder', '~> 2.0.3' gem 'jbuilder'
# Gems used only for assets and not required # Gems used only for assets and not required
# in production environments by default. # in production environments by default.
group :assets do group :assets do
gem 'coffee-rails', '~> 3.2.1' gem 'coffee-rails'
gem "twitter-bootstrap-rails", "~> 2.0.3" # Use SCSS for stylesheets
gem 'sass-rails'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes # Use bootstrap-sass for stylesheets
# gem 'therubyracer' gem 'bootstrap-sass'
gem 'uglifier'
gem 'uglifier', '>= 1.0.3'
end end
group :development, :test do group :development, :test do
gem 'rspec-rails', '~> 2.14.0' gem 'rspec-rails'
gem 'factory_girl_rails', '~> 1.2' gem 'factory_girl_rails'
gem 'pry', '~> 0.9.8' gem 'pry'
gem 'faker', '~> 1.2.0' gem 'faker'
end end
group :test do group :test do
gem 'shoulda-matchers', '~> 1.0.0' # gem 'shoulda-matchers', '~> 1.0.0'
gem 'capybara', '~> 2.2.1' gem 'capybara', '~> 2.2.1'
gem 'poltergeist', '~> 1.5.0' gem 'poltergeist', '~> 1.5.0'
gem 'database_cleaner', '~> 1.2.0' gem 'database_cleaner', '~> 1.2.0'
gem 'launchy', '~> 2.4.2' gem 'launchy', '~> 2.4.2'
gem 'spork', '~> 0.9.2' gem 'spork'
#guard dependency for Mac OS 10 #guard dependency for Mac OS 10
gem 'rb-fsevent', :require => false if RUBY_PLATFORM =~ /darwin/i gem 'rb-fsevent', :require => false if RUBY_PLATFORM =~ /darwin/i
gem 'guard-spork', '~> 1.5.1' gem 'guard-spork'
gem 'guard-rspec', '~> 4.2.6' gem 'guard-rspec'
end end

237
Gemfile.lock

@ -9,12 +9,12 @@ GIT
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
actionmailer (3.2.13) actionmailer (3.2.19)
actionpack (= 3.2.13) actionpack (= 3.2.19)
mail (~> 2.5.3) mail (~> 2.5.4)
actionpack (3.2.13) actionpack (3.2.19)
activemodel (= 3.2.13) activemodel (= 3.2.19)
activesupport (= 3.2.13) activesupport (= 3.2.19)
builder (~> 3.0.0) builder (~> 3.0.0)
erubis (~> 2.7.0) erubis (~> 2.7.0)
journey (~> 1.0.4) journey (~> 1.0.4)
@ -22,23 +22,27 @@ GEM
rack-cache (~> 1.2) rack-cache (~> 1.2)
rack-test (~> 0.6.1) rack-test (~> 0.6.1)
sprockets (~> 2.2.1) sprockets (~> 2.2.1)
activemodel (3.2.13) activemodel (3.2.19)
activesupport (= 3.2.13) activesupport (= 3.2.19)
builder (~> 3.0.0) builder (~> 3.0.0)
activerecord (3.2.13) activerecord (3.2.19)
activemodel (= 3.2.13) activemodel (= 3.2.19)
activesupport (= 3.2.13) activesupport (= 3.2.19)
arel (~> 3.0.2) arel (~> 3.0.2)
tzinfo (~> 0.3.29) tzinfo (~> 0.3.29)
activeresource (3.2.13) activeresource (3.2.19)
activemodel (= 3.2.13) activemodel (= 3.2.19)
activesupport (= 3.2.13) activesupport (= 3.2.19)
activesupport (3.2.13) activesupport (3.2.19)
i18n (= 0.6.1) i18n (~> 0.6, >= 0.6.4)
multi_json (~> 1.0) multi_json (~> 1.0)
addressable (2.3.5) addressable (2.3.6)
arel (3.0.3) arel (3.0.3)
bcrypt-ruby (3.1.2) bcrypt (3.1.7)
bcrypt-ruby (3.1.5)
bcrypt (>= 3.1.3)
bootstrap-sass (3.2.0.0)
sass (~> 3.2)
bootstrap-will_paginate (0.0.10) bootstrap-will_paginate (0.0.10)
will_paginate will_paginate
builder (3.0.4) builder (3.0.4)
@ -51,18 +55,17 @@ GEM
xpath (~> 2.0) xpath (~> 2.0)
celluloid (0.15.2) celluloid (0.15.2)
timers (~> 1.1.0) timers (~> 1.1.0)
childprocess (0.4.0) childprocess (0.5.3)
ffi (~> 1.0, >= 1.0.11) ffi (~> 1.0, >= 1.0.11)
cliver (0.3.2) cliver (0.3.2)
coderay (1.1.0) coderay (1.1.0)
coffee-rails (3.2.2) coffee-rails (3.2.2)
coffee-script (>= 2.2.0) coffee-script (>= 2.2.0)
railties (~> 3.2.0) railties (~> 3.2.0)
coffee-script (2.2.0) coffee-script (2.3.0)
coffee-script-source coffee-script-source
execjs execjs
coffee-script-source (1.7.0) coffee-script-source (1.7.1)
commonjs (0.2.7)
database_cleaner (1.2.0) database_cleaner (1.2.0)
decent_exposure (1.0.2) decent_exposure (1.0.2)
devise (2.0.6) devise (2.0.6)
@ -72,160 +75,156 @@ GEM
warden (~> 1.1.1) warden (~> 1.1.1)
diff-lcs (1.2.5) diff-lcs (1.2.5)
erubis (2.7.0) erubis (2.7.0)
execjs (2.0.2) execjs (2.2.1)
factory_girl (2.6.4) factory_girl (4.4.0)
activesupport (>= 2.3.9) activesupport (>= 3.0.0)
factory_girl_rails (1.7.0) factory_girl_rails (4.4.1)
factory_girl (~> 2.6.0) factory_girl (~> 4.4.0)
railties (>= 3.0.0) railties (>= 3.0.0)
faker (1.2.0) faker (1.4.2)
i18n (~> 0.5) i18n (~> 0.5)
ffi (1.9.3) ffi (1.9.3)
formatador (0.2.4) formatador (0.2.5)
guard (2.4.0) guard (2.6.1)
formatador (>= 0.2.4) formatador (>= 0.2.4)
listen (~> 2.1) listen (~> 2.7)
lumberjack (~> 1.0) lumberjack (~> 1.0)
pry (>= 0.9.12) pry (>= 0.9.12)
thor (>= 0.18.1) thor (>= 0.18.1)
guard-rspec (4.2.6) guard-rspec (4.3.1)
guard (~> 2.1) guard (~> 2.1)
rspec (>= 2.14, < 4.0) rspec (>= 2.14, < 4.0)
guard-spork (1.5.1) guard-spork (1.5.1)
childprocess (>= 0.2.3) childprocess (>= 0.2.3)
guard (>= 1.1) guard (>= 1.1)
spork (>= 0.8.4) spork (>= 0.8.4)
haml (3.1.8) haml (4.0.5)
haml-rails (0.3.5) tilt
haml-rails (0.4)
actionpack (>= 3.1, < 4.1) actionpack (>= 3.1, < 4.1)
activesupport (>= 3.1, < 4.1) activesupport (>= 3.1, < 4.1)
haml (~> 3.1) haml (>= 3.1, < 4.1)
railties (>= 3.1, < 4.1) railties (>= 3.1, < 4.1)
hike (1.2.3) hike (1.2.3)
i18n (0.6.1) i18n (0.6.11)
jbuilder (2.0.3) jbuilder (2.1.3)
activesupport (>= 3.0.0) activesupport (>= 3.0.0, < 5)
multi_json (>= 1.2.0) multi_json (~> 1.2)
journey (1.0.4) journey (1.0.4)
jquery-rails (2.3.0) jquery-rails (3.1.1)
railties (>= 3.0, < 5.0) railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0) thor (>= 0.14, < 2.0)
json (1.8.1) json (1.8.1)
launchy (2.4.2) launchy (2.4.2)
addressable (~> 2.3) addressable (~> 2.3)
less (2.2.2) listen (2.7.9)
commonjs (~> 0.2.6)
less-rails (2.2.6)
actionpack (>= 3.1)
less (~> 2.2.0)
libv8 (3.3.10.4)
listen (2.4.1)
celluloid (>= 0.15.2) celluloid (>= 0.15.2)
rb-fsevent (>= 0.9.3) rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9) rb-inotify (>= 0.9)
lumberjack (1.0.4) lumberjack (1.0.9)
mail (2.5.4) mail (2.5.4)
mime-types (~> 1.16) mime-types (~> 1.16)
treetop (~> 1.4.8) treetop (~> 1.4.8)
method_source (0.8.2) method_source (0.8.2)
mime-types (1.25.1) mime-types (1.25.1)
mini_portile (0.5.2) mini_portile (0.6.0)
multi_json (1.8.4) multi_json (1.10.1)
netzke-basepack (0.8.4) netzke-basepack (0.10.1)
netzke-core (~> 0.8.2) netzke-core (~> 0.10.0)
netzke-cancan (0.8.2) netzke-cancan (0.8.2)
cancan cancan
netzke-core netzke-core
netzke-core (0.8.4) netzke-core (0.10.1)
execjs execjs
uglifier uglifier
nokogiri (1.6.1) nokogiri (1.6.3.1)
mini_portile (~> 0.5.0) mini_portile (= 0.6.0)
orm_adapter (0.0.7) orm_adapter (0.0.7)
pg (0.17.1) pg (0.17.1)
poltergeist (1.5.0) poltergeist (1.5.1)
capybara (~> 2.1) capybara (~> 2.1)
cliver (~> 0.3.1) cliver (~> 0.3.1)
multi_json (~> 1.0) multi_json (~> 1.0)
websocket-driver (>= 0.2.0) websocket-driver (>= 0.2.0)
polyglot (0.3.3) polyglot (0.3.5)
pry (0.9.12.6) pry (0.10.0)
coderay (~> 1.0) coderay (~> 1.1.0)
method_source (~> 0.8) method_source (~> 0.8.1)
slop (~> 3.4) slop (~> 3.4)
rack (1.4.5) rack (1.4.5)
rack-cache (1.2) rack-cache (1.2)
rack (>= 0.4) rack (>= 0.4)
rack-ssl (1.3.3) rack-ssl (1.3.4)
rack rack
rack-test (0.6.2) rack-test (0.6.2)
rack (>= 1.0) rack (>= 1.0)
rails (3.2.13) rails (3.2.19)
actionmailer (= 3.2.13) actionmailer (= 3.2.19)
actionpack (= 3.2.13) actionpack (= 3.2.19)
activerecord (= 3.2.13) activerecord (= 3.2.19)
activeresource (= 3.2.13) activeresource (= 3.2.19)
activesupport (= 3.2.13) activesupport (= 3.2.19)
bundler (~> 1.0) bundler (~> 1.0)
railties (= 3.2.13) railties (= 3.2.19)
railties (3.2.13) railties (3.2.19)
actionpack (= 3.2.13) actionpack (= 3.2.19)
activesupport (= 3.2.13) activesupport (= 3.2.19)
rack-ssl (~> 1.3.2) rack-ssl (~> 1.3.2)
rake (>= 0.8.7) rake (>= 0.8.7)
rdoc (~> 3.4) rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0) thor (>= 0.14.6, < 2.0)
rake (10.1.1) rake (10.3.2)
rb-fsevent (0.9.4) rb-fsevent (0.9.4)
rb-inotify (0.9.3) rb-inotify (0.9.5)
ffi (>= 0.5.0) ffi (>= 0.5.0)
rdoc (3.12.2) rdoc (3.12.2)
json (~> 1.4) json (~> 1.4)
rspec (2.14.1) rspec (3.0.0)
rspec-core (~> 2.14.0) rspec-core (~> 3.0.0)
rspec-expectations (~> 2.14.0) rspec-expectations (~> 3.0.0)
rspec-mocks (~> 2.14.0) rspec-mocks (~> 3.0.0)
rspec-core (2.14.7) rspec-core (3.0.3)
rspec-expectations (2.14.5) rspec-support (~> 3.0.0)
diff-lcs (>= 1.1.3, < 2.0) rspec-expectations (3.0.3)
rspec-mocks (2.14.5) diff-lcs (>= 1.2.0, < 2.0)
rspec-rails (2.14.1) rspec-support (~> 3.0.0)
rspec-mocks (3.0.3)
rspec-support (~> 3.0.0)
rspec-rails (3.0.2)
actionpack (>= 3.0) actionpack (>= 3.0)
activemodel (>= 3.0)
activesupport (>= 3.0) activesupport (>= 3.0)
railties (>= 3.0) railties (>= 3.0)
rspec-core (~> 2.14.0) rspec-core (~> 3.0.0)
rspec-expectations (~> 2.14.0) rspec-expectations (~> 3.0.0)
rspec-mocks (~> 2.14.0) rspec-mocks (~> 3.0.0)
shoulda-matchers (1.0.0) rspec-support (~> 3.0.0)
slop (3.4.7) rspec-support (3.0.3)
sass (3.3.10)
sass-rails (3.2.6)
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
slop (3.6.0)
spork (0.9.2) spork (0.9.2)
sprockets (2.2.2) sprockets (2.2.2)
hike (~> 1.2) hike (~> 1.2)
multi_json (~> 1.0) multi_json (~> 1.0)
rack (~> 1.0) rack (~> 1.0)
tilt (~> 1.1, != 1.3.0) tilt (~> 1.1, != 1.3.0)
therubyracer (0.10.2) thor (0.19.1)
libv8 (~> 3.3.10)
thor (0.18.1)
tilt (1.4.1) tilt (1.4.1)
timers (1.1.0) timers (1.1.0)
treetop (1.4.15) treetop (1.4.15)
polyglot polyglot
polyglot (>= 0.3.1) polyglot (>= 0.3.1)
twitter-bootstrap-rails (2.0.9) tzinfo (0.3.40)
actionpack (>= 3.1) uglifier (2.5.3)
less-rails (~> 2.2.2)
railties (>= 3.1)
therubyracer (~> 0.10.1)
tzinfo (0.3.38)
uglifier (2.4.0)
execjs (>= 0.3.0) execjs (>= 0.3.0)
json (>= 1.8.0) json (>= 1.8.0)
warden (1.1.1) warden (1.1.1)
rack (>= 1.0) rack (>= 1.0)
websocket-driver (0.3.2) websocket-driver (0.3.4)
will_paginate (3.0.5) will_paginate (3.0.7)
xpath (2.0.0) xpath (2.0.0)
nokogiri (~> 1.3) nokogiri (~> 1.3)
@ -234,32 +233,32 @@ PLATFORMS
DEPENDENCIES DEPENDENCIES
acts_as_loggable! acts_as_loggable!
bootstrap-will_paginate (~> 0.0.6) bootstrap-sass
bootstrap-will_paginate
cancan cancan
capybara (~> 2.2.1) capybara (~> 2.2.1)
coffee-rails (~> 3.2.1) coffee-rails
database_cleaner (~> 1.2.0) database_cleaner (~> 1.2.0)
decent_exposure (~> 1.0.1) decent_exposure (~> 1.0.1)
devise (~> 2.0.4) devise (~> 2.0.4)
factory_girl_rails (~> 1.2) factory_girl_rails
faker (~> 1.2.0) faker
guard-rspec (~> 4.2.6) guard-rspec
guard-spork (~> 1.5.1) guard-spork
haml-rails (~> 0.3.4) haml-rails
jbuilder (~> 2.0.3) jbuilder
jquery-rails (~> 2.0) jquery-rails
launchy (~> 2.4.2) launchy (~> 2.4.2)
netzke-basepack (~> 0.8.0) netzke-basepack
netzke-cancan netzke-cancan
netzke-core (~> 0.8.0) netzke-core
pg (~> 0.17.1) pg (~> 0.17.1)
poltergeist (~> 1.5.0) poltergeist (~> 1.5.0)
pry (~> 0.9.8) pry
rails (= 3.2.13) rails (= 3.2.19)
rb-fsevent rb-fsevent
rspec-rails (~> 2.14.0) rspec-rails
shoulda-matchers (~> 1.0.0) sass-rails
spork (~> 0.9.2) spork
twitter-bootstrap-rails (~> 2.0.3) uglifier
uglifier (>= 1.0.3) will_paginate
will_paginate (~> 3.0.3)

BIN
app/assets/images/velo_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

4
app/assets/javascripts/application.js

@ -12,8 +12,8 @@
// //
//= require jquery //= require jquery
//= require jquery_ujs //= require jquery_ujs
//= require twitter/bootstrap/bootstrap-button // require twitter/bootstrap/bootstrap-button
//= require twitter/bootstrap/bootstrap-modal // require twitter/bootstrap/bootstrap-modal
//= require utils //= require utils
//= require bootstrap-datepicker //= require bootstrap-datepicker
//= require bootstrap-timepicker //= require bootstrap-timepicker

26
app/assets/stylesheets/application.css

@ -10,6 +10,32 @@
* *
*= require_self *= require_self
*= require datepicker *= require datepicker
*= require bootstrap
*= require bootstrap-timepicker *= require bootstrap-timepicker
*= require bootstrap_and_overrides *= require bootstrap_and_overrides
*/ */
.container {
max-width: 940px;
margin: 0 auto;
}
.container img {
display: block;
margin: 0 auto;
}
p {
text-align: center;
padding: 20px 0;
}
.check_box {
width: 30px;
height: 30px;
background-color: white;
}
label {
font-size: x-large;
}

47
app/assets/stylesheets/bootstrap_and_overrides.css.less

@ -1,47 +0,0 @@
@import "twitter/bootstrap/bootstrap";
body {
padding-top: 60px;
padding-left: 20px;
}
@import "twitter/bootstrap/responsive";
// Set the correct sprite paths
@iconSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings.png');
@iconWhiteSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings-white.png');
// Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines)
// Note: If you use asset_path() here, your compiled boostrap_and_overrides.css will not
// have the proper paths. So for now we use the absolute path.
@fontAwesomeEotPath: '/assets/fontawesome-webfont.eot';
@fontAwesomeWoffPath: '/assets/fontawesome-webfont.woff';
@fontAwesomeTtfPath: '/assets/fontawesome-webfont.ttf';
@fontAwesomeSvgPath: '/assets/fontawesome-webfont.svg';
// Font Awesome
@import "fontawesome";
// Your custom LESS stylesheets goes here
//
// Since bootstrap was imported above you have access to its mixins which
// you may use and inherit here
//
// If you'd like to override bootstrap's own variables, you can do so here as well
// See http://twitter.github.com/bootstrap/less.html for their names and documentation
//
// Example:
// @linkColor: #ff0000;
[data-toggle="buttons-radio"] > .btn > input[type="radio"],
[data-toggle="buttons"] > .btn > input[type="checkbox"] {
display: none;
}
.inline-block {
display: inline-block;
}
.control-group.error .btn-group > .btn {
color: #b94a48;
border-color: #b94a48;
}

31
app/assets/stylesheets/bootstrap_and_overrides.css.scss

@ -0,0 +1,31 @@
body {
padding-top: 60px;
padding-left: 20px;
}
// Set the correct sprite paths
$iconSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings.png');
$iconWhiteSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings-white.png');
// Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines)
// Note: If you use asset_path() here, your compiled boostrap_and_overrides.css will not
// have the proper paths. So for now we use the absolute path.
$fontAwesomeEotPath: '/assets/fontawesome-webfont.eot';
$fontAwesomeWoffPath: '/assets/fontawesome-webfont.woff';
$fontAwesomeTtfPath: '/assets/fontawesome-webfont.ttf';
$fontAwesomeSvgPath: '/assets/fontawesome-webfont.svg';
[data-toggle="buttons-radio"] > .btn > input[type="radio"],
[data-toggle="buttons"] > .btn > input[type="checkbox"] {
display: none;
}
.inline-block {
display: inline-block;
}
.control-group.error .btn-group > .btn {
color: #b94a48;
border-color: #b94a48;
}

4
app/views/devise/_links.erb

@ -6,13 +6,13 @@
<%- if devise_mapping.registerable? && controller_name != 'registrations' %> <%- if devise_mapping.registerable? && controller_name != 'registrations' %>
<p> <p>
<%= link_to "Sign up", new_registration_path(resource_name), class: "btn btn-block btn-default" %><br /> <%= link_to "Sign up", new_registration_path(resource_name), class: "btn btn-block btn-default btn-lg" %><br />
</p> </p>
<% end -%> <% end -%>
<%- if devise_mapping.recoverable? && controller_name != 'passwords' %> <%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
<p> <p>
<%= link_to "Forgot your password?", new_password_path(resource_name), class: "btn btn-block btn-default" %><br /> <%= link_to "Forgot your password?", new_password_path(resource_name), class: "btn btn-block btn-default btn-lg" %><br />
</p> </p>
<% end -%> <% end -%>

86
app/views/devise/sessions/new.html.erb

@ -1,48 +1,52 @@
<%= stylesheet_link_tag "bootstrap_and_overrides", :media => "all" %> <%= stylesheet_link_tag "bootstrap", :media => "all" %>
<%= stylesheet_link_tag "application", :media => "all" %>
<div class="container">
<%= image_tag 'velo_logo.png' %>
<p><a href="http://madewithloveinbaltimore.org" class="made">Made with &hearts; in Baltimore</a></p>
<br>
<br>
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12">
<div class="form-group">
<%= f.text_field :username, placeholder: "Username", class: "form-control input-lg", autofocus: true %>
</div>
<h2>Velocipede</h2> <div class="form-group">
<a href="http://madewithloveinbaltimore.org">Made with &hearts; in Baltimore</a> <%= f.password_field :password, placeholder: "Password", class: "form-control input-lg" %>
<br> </div>
<br>
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
<div class="form-group">
<%= f.text_field :username, placeholder: "Username", class: "form-control input-lg"%>
</div>
<div class="form-group"> <div class="form-group remember">
<%= f.password_field :password, placeholder: "Password", class: "form-control input-lg" %> <% if devise_mapping.rememberable? -%>
</div> <label>
<%= f.check_box :remember_me, class: 'check_box' %> Remember Me
</label>
<% end -%>
</div>
</div> <!-- end column -->
</div> <!-- end row -->
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12">
<div class="form-group">
<p>
<%= f.submit "Sign in", class:"btn btn-lg btn-primary col-xs-12 col-sm-12 col-md-12" %>
</p>
</div>
</div> <!-- end column -->
</div> <!-- end row -->
<% end %>
<div class="form-group"> <%= render "links" %>
<% if devise_mapping.rememberable? -%>
<label>
<%= f.check_box :remember_me %> Remember Me
</label>
<% end -%>
</div>
<div class="form-group"> <% if Rails.env.development? %>
<p> <p>
<%= f.submit "Sign in", class:"btn btn-lg btn-primary" %> <% User.all.each do |user| %>
</p> <%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
<p> Or quickly... </p> <%= f.hidden_field :username, :value => user.username%>
<div class="btn-group"> <%= f.hidden_field :password, :value => 'password' %>
<input id="checkin" name="checkin" type="button" value="CHECK IN" class="btn btn-lg btn-success"> <%= f.submit "Sign in as #{user.username}", class:"btn btn-info" %>
<input id="checkout" name="checkout" type="button" value="CHECK OUT" class="btn btn-lg btn-danger"> <% end %>
</div>
</div>
<% end %>
<%= render "links" %>
<% if Rails.env.development? %>
<p>
<% User.all.each do |user| %>
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
<%= f.hidden_field :username, :value => user.username%>
<%= f.hidden_field :password, :value => 'password' %>
<%= f.submit "Sign in as #{user.username}", class:"btn btn-info" %>
<% end %> <% end %>
</p>
<% end %> <% end %>
</p> </div>
<% end %>

5
config/application.rb

@ -3,10 +3,7 @@ require File.expand_path('../boot', __FILE__)
require 'rails/all' require 'rails/all'
if defined?(Bundler) if defined?(Bundler)
# If you precompile assets before deploying to production, use this line Bundler.require(*Rails.groups)
Bundler.require(*Rails.groups(:assets => %w(development test)))
# If you want your assets lazily compiled in production, use this line
# Bundler.require(:default, :assets, Rails.env)
end end
module Velocipede module Velocipede

31
spec/factories/bikes.rb

@ -16,22 +16,21 @@ FactoryGirl.define do
value 200 value 200
bike_condition { FactoryGirl.create(:bike_condition) } bike_condition { FactoryGirl.create(:bike_condition) }
bike_purpose { FactoryGirl.create(:bike_purpose) } bike_purpose { FactoryGirl.create(:bike_purpose) }
end factory :seed_bike do
sequence(:shop_id) {|n| n}
factory :seed_bike do sequence :serial_number do |n|
sequence(:shop_id) {|n| n} "#{Faker::Code.isbn}-#{n}"
sequence :serial_number do |n| end
"#{Faker::Code.isbn}-#{n}" bike_brand_id { BikeBrand.all.sample.id }
model { Faker::Commerce.product_name }
color { sprintf("%06X", Random.rand(16777215) ) }
bike_style_id { BikeStyle.all.sample.id }
seat_tube_height { Random.rand(25) }
top_tube_length { Random.rand(25) }
bike_wheel_size_id { BikeWheelSize.all.sample.id }
value { Random.rand(200) }
bike_condition_id { BikeCondition.all.sample.id }
bike_purpose_id { BikePurpose.all.sample.id }
end end
bike_brand_id { BikeBrand.all.sample.id }
model { Faker::Commerce.product_name }
color { sprintf("%06X", Random.rand(16777215) ) }
bike_style_id { BikeStyle.all.sample.id }
seat_tube_height { Random.rand(25) }
top_tube_length { Random.rand(25) }
bike_wheel_size_id { BikeWheelSize.all.sample.id }
value { Random.rand(200) }
bike_condition_id { BikeCondition.all.sample.id }
bike_purpose_id { BikePurpose.all.sample.id }
end end
end end

8
spec/factories/users.rb

@ -8,14 +8,14 @@ FactoryGirl.define do
first_name 'Michael' first_name 'Michael'
last_name 'Scott' last_name 'Scott'
sequence(:bike_id) { |n| n } sequence(:bike_id) { |n| n }
after_build do |r| after(:build) do |r|
r.roles << (Role.find_by_role("user") || FactoryGirl.create(:role_user)) r.roles << (Role.find_by_role("user") || FactoryGirl.create(:role_user))
end end
factory :staff do factory :staff do
username "staff" username "staff"
first_name 'Staff' first_name 'Staff'
after_build do |r| after(:build) do |r|
r.roles << (Role.find_by_role("staff") || FactoryGirl.create(:role_staff)) r.roles << (Role.find_by_role("staff") || FactoryGirl.create(:role_staff))
end end
end end
@ -23,7 +23,7 @@ FactoryGirl.define do
factory :admin do factory :admin do
username "admin" username "admin"
first_name 'Admin' first_name 'Admin'
after_build do |r| after(:build) do |r|
r.roles << (Role.find_by_role("admin") || FactoryGirl.create(:role_admin)) r.roles << (Role.find_by_role("admin") || FactoryGirl.create(:role_admin))
end end
end end
@ -31,7 +31,7 @@ FactoryGirl.define do
factory :bike_admin do factory :bike_admin do
username "bike_admin" username "bike_admin"
first_name 'BikeAdmin' first_name 'BikeAdmin'
after_build do |r| after(:build) do |r|
r.roles << (Role.find_by_role("bike_admin") || FactoryGirl.create(:role_bike_admin)) r.roles << (Role.find_by_role("bike_admin") || FactoryGirl.create(:role_bike_admin))
end end
end end

Loading…
Cancel
Save