Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add user interface for Bands, Tours and Shows #1

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
db/*.sqlite3
log/*.log
tmp/
.sass-cache/
12 changes: 10 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ gem "bundler"
gem "carrierwave"
gem "carrierwave-mongoid", require: "carrierwave/mongoid"
gem "decent_exposure"
gem "haml"
gem "haml-rails"
gem "jquery-rails"
gem "mongoid", git: "git://github.com/mongoid/mongoid.git"
gem "mongoid"
gem "unicorn"
gem "simple_form"
gem "inherited_resources"

group :assets do
gem "sass-rails", "~> 3.1"
Expand All @@ -25,3 +27,9 @@ group :development, :test do
gem "spork", "~> 0.9.0.rc"
gem "watchr"
end

group :test do
gem "database_cleaner"
gem "capybara"
gem "launchy"
end
171 changes: 103 additions & 68 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,86 +1,105 @@
GIT
remote: git://github.com/mongoid/mongoid.git
revision: f475489dd50c68b82570f3dafd4b1af8e9dc153a
specs:
mongoid (2.4.0)
activemodel (~> 3.1)
mongo (~> 1.4)
tzinfo (~> 0.3.22)

GEM
remote: http://rubygems.org/
specs:
actionmailer (3.1.1)
actionpack (= 3.1.1)
actionmailer (3.1.3)
actionpack (= 3.1.3)
mail (~> 2.3.0)
actionpack (3.1.1)
activemodel (= 3.1.1)
activesupport (= 3.1.1)
actionpack (3.1.3)
activemodel (= 3.1.3)
activesupport (= 3.1.3)
builder (~> 3.0.0)
erubis (~> 2.7.0)
i18n (~> 0.6)
rack (~> 1.3.2)
rack (~> 1.3.5)
rack-cache (~> 1.1)
rack-mount (~> 0.8.2)
rack-test (~> 0.6.1)
sprockets (~> 2.0.2)
activemodel (3.1.1)
activesupport (= 3.1.1)
sprockets (~> 2.0.3)
activemodel (3.1.3)
activesupport (= 3.1.3)
builder (~> 3.0.0)
i18n (~> 0.6)
activerecord (3.1.1)
activemodel (= 3.1.1)
activesupport (= 3.1.1)
activerecord (3.1.3)
activemodel (= 3.1.3)
activesupport (= 3.1.3)
arel (~> 2.2.1)
tzinfo (~> 0.3.29)
activeresource (3.1.1)
activemodel (= 3.1.1)
activesupport (= 3.1.1)
activesupport (3.1.1)
activeresource (3.1.3)
activemodel (= 3.1.3)
activesupport (= 3.1.3)
activesupport (3.1.3)
multi_json (~> 1.0)
addressable (2.2.6)
arel (2.2.1)
bson (1.4.0)
bson_ext (1.4.0)
bson (1.5.0)
bson_ext (1.5.0)
builder (3.0.0)
carrierwave (0.5.7)
capybara (1.1.2)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
selenium-webdriver (~> 2.0)
xpath (~> 0.1.4)
carrierwave (0.5.8)
activesupport (~> 3.0)
carrierwave-mongoid (0.1.3)
carrierwave (>= 0.5.6)
mongoid (~> 2.1)
childprocess (0.2.3)
ffi (~> 1.0.6)
coffee-rails (3.1.1)
coffee-script (>= 2.2.0)
railties (~> 3.1.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.1.2)
coffee-script-source (1.1.3)
database_cleaner (0.7.0)
decent_exposure (1.0.1)
diff-lcs (1.1.3)
erubis (2.7.0)
execjs (1.2.9)
multi_json (~> 1.0)
fabrication (1.2.0)
haml (3.1.3)
ffi (1.0.11)
haml (3.1.4)
haml-rails (0.3.4)
actionpack (~> 3.0)
activesupport (~> 3.0)
haml (~> 3.0)
railties (~> 3.0)
has_scope (0.5.1)
hike (1.2.1)
i18n (0.6.0)
jquery-rails (1.0.16)
inherited_resources (1.3.0)
has_scope (~> 0.5.0)
responders (~> 0.6.0)
jquery-rails (1.0.19)
railties (~> 3.0)
thor (~> 0.14)
json (1.6.1)
json (1.6.2)
kgio (2.6.0)
launchy (2.0.5)
addressable (~> 2.2.6)
mail (2.3.0)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
metaclass (0.0.1)
mime-types (1.16)
mime-types (1.17.2)
mocha (0.10.0)
metaclass (~> 0.0.1)
mongo (1.4.0)
bson (= 1.4.0)
multi_json (1.0.3)
polyglot (0.3.2)
rack (1.3.4)
mongo (1.5.0)
bson (= 1.5.0)
mongoid (2.3.4)
activemodel (~> 3.1)
mongo (~> 1.3)
tzinfo (~> 0.3.22)
multi_json (1.0.4)
nokogiri (1.5.0)
polyglot (0.3.3)
rack (1.3.5)
rack-cache (1.1)
rack (>= 0.4)
rack-mount (0.8.3)
Expand All @@ -89,47 +108,56 @@ GEM
rack
rack-test (0.6.1)
rack (>= 1.0)
rails (3.1.1)
actionmailer (= 3.1.1)
actionpack (= 3.1.1)
activerecord (= 3.1.1)
activeresource (= 3.1.1)
activesupport (= 3.1.1)
rails (3.1.3)
actionmailer (= 3.1.3)
actionpack (= 3.1.3)
activerecord (= 3.1.3)
activeresource (= 3.1.3)
activesupport (= 3.1.3)
bundler (~> 1.0)
railties (= 3.1.1)
railties (3.1.1)
actionpack (= 3.1.1)
activesupport (= 3.1.1)
railties (= 3.1.3)
railties (3.1.3)
actionpack (= 3.1.3)
activesupport (= 3.1.3)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
raindrops (0.8.0)
rake (0.9.2)
rdoc (3.10)
rake (0.9.2.2)
rdoc (3.11)
json (~> 1.4)
rspec (2.6.0)
rspec-core (~> 2.6.0)
rspec-expectations (~> 2.6.0)
rspec-mocks (~> 2.6.0)
rspec-core (2.6.4)
rspec-expectations (2.6.0)
responders (0.6.4)
rspec (2.7.0)
rspec-core (~> 2.7.0)
rspec-expectations (~> 2.7.0)
rspec-mocks (~> 2.7.0)
rspec-core (2.7.1)
rspec-expectations (2.7.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.6.0)
rspec-rails (2.6.1)
rspec-mocks (2.7.0)
rspec-rails (2.7.0)
actionpack (~> 3.0)
activesupport (~> 3.0)
railties (~> 3.0)
rspec (~> 2.6.0)
sass (3.1.10)
sass-rails (3.1.4)
rspec (~> 2.7.0)
rubyzip (0.9.5)
sass (3.1.11)
sass-rails (3.1.5)
actionpack (~> 3.1.0)
railties (~> 3.1.0)
sass (>= 3.1.4)
sprockets (~> 2.0.0)
sass (~> 3.1.10)
tilt (~> 1.3.2)
selenium-webdriver (2.14.0)
childprocess (>= 0.2.1)
ffi (~> 1.0.9)
multi_json (~> 1.0.4)
rubyzip
simple_form (1.5.2)
actionpack (~> 3.0)
activemodel (~> 3.0)
spork (0.9.0.rc9)
sprockets (2.0.2)
sprockets (2.0.3)
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
Expand All @@ -138,34 +166,41 @@ GEM
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.30)
uglifier (1.0.3)
tzinfo (0.3.31)
uglifier (1.1.0)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
unicorn (4.1.1)
kgio (~> 2.4)
rack
raindrops (~> 0.6)
watchr (0.7)
xpath (0.1.4)
nokogiri (~> 1.3)

PLATFORMS
ruby

DEPENDENCIES
bson_ext
bundler
capybara
carrierwave
carrierwave-mongoid
coffee-rails (~> 3.1)
database_cleaner
decent_exposure
fabrication
haml
haml-rails
inherited_resources
jquery-rails
launchy
mocha
mongoid!
mongoid
rails (~> 3.1)
rspec-rails
sass-rails (~> 3.1)
simple_form
spork (~> 0.9.0.rc)
uglifier
unicorn
Expand Down
4 changes: 4 additions & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
//= require jquery
//= require jquery_ujs
//= require_self
//= require_tree .
2 changes: 0 additions & 2 deletions app/assets/javascripts/start.js

This file was deleted.

4 changes: 4 additions & 0 deletions app/assets/stylesheets/application.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/*
= require_self
= require_tree .
*/
5 changes: 0 additions & 5 deletions app/assets/stylesheets/start.css.scss

This file was deleted.

2 changes: 2 additions & 0 deletions app/controllers/bands_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class BandsController < InheritedResources::Base
end
3 changes: 3 additions & 0 deletions app/controllers/shows_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class ShowsController < InheritedResources::Base
nested_belongs_to :band, :tour
end
3 changes: 3 additions & 0 deletions app/controllers/tours_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class ToursController < InheritedResources::Base
belongs_to :band
end
1 change: 1 addition & 0 deletions app/models/show.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class Show

embedded_in :tour
embeds_one :venue, validate: false
accepts_nested_attributes_for :venue

# Shows must be on a specific date, which includes a time.
validates :date, presence: true
Expand Down
13 changes: 13 additions & 0 deletions app/views/bands/_form.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
= simple_form_for(@band) do |f|
= f.error_notification

.inputs
= f.input :name

= f.input :description
= f.input :formed_on
= f.input :location
= f.input :website

.actions
= f.button :submit
8 changes: 8 additions & 0 deletions app/views/bands/edit.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- content_for(:title) do
Editing band

= render 'form'

= link_to 'Show', @band
\|
= link_to 'Back', bands_path
22 changes: 22 additions & 0 deletions app/views/bands/index.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
- content_for(:title) do
Listing bands

%table
%tr
%th Name
%th Location
%th
%th
%th

- @bands.each do |band|
%tr
%td= link_to band.name, band
%td= band.location
%td= link_to 'Show', band
%td= link_to 'Edit', edit_band_path(band)
%td= link_to 'Destroy', band, :confirm => 'Are you sure?', :method => :delete

%br

= link_to 'New Band', new_band_path
6 changes: 6 additions & 0 deletions app/views/bands/new.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- content_for(:title) do
New band

= render 'form'

= link_to 'Back', bands_path
Loading