Permalink
Browse files

updates'

  • Loading branch information...
lievcin committed May 24, 2012
1 parent 91e15e3 commit 98358f1b8477565bb8514775f2bdf6060fc2c299
View
@@ -20,7 +20,8 @@ gem 'twitter-bootstrap-rails'
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
- gem 'jquery-ui-rails'
+ # gem 'jquery-ui-rails'
+ gem 'jquery-ui-themes'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platform => :ruby
gem 'uglifier', '>= 1.0.3'
View
@@ -60,14 +60,16 @@ GEM
highline (1.6.11)
hike (1.2.1)
hpricot (0.8.6)
+ httparty (0.8.3)
+ multi_json (~> 1.0)
+ multi_xml
i18n (0.6.0)
journey (1.0.3)
jquery-rails (2.0.2)
railties (>= 3.2.0, < 5.0)
thor (~> 0.14)
- jquery-ui-rails (0.2.2)
- jquery-rails
- railties (>= 3.1.0)
+ jquery-ui-themes (0.0.5)
+ httparty
json (1.7.0)
kgio (2.7.4)
less (2.1.0)
@@ -83,6 +85,7 @@ GEM
treetop (~> 1.4.8)
mime-types (1.18)
multi_json (1.3.4)
+ multi_xml (0.5.1)
mysql2 (0.3.11)
net-scp (1.0.4)
net-ssh (>= 1.99.1)
@@ -174,7 +177,7 @@ DEPENDENCIES
country_select
devise
jquery-rails
- jquery-ui-rails
+ jquery-ui-themes
mysql2 (= 0.3.11)
quiet_assets
rack-pjax
@@ -2,7 +2,10 @@
//= require jquery_ujs
//= require jquery.pjax
//= require jquery-ui
-//= require jquery.ui.all
//= require twitter/bootstrap
//= require bespoke
//= require_tree .
+
+
+
+// require jquery.ui.all
@@ -11,6 +11,7 @@
*= require_self
*= bootstrap
*= bespoke
- *= require jquery.ui.all
+ *= require jquery-ui/redmond
*= require_tree .
*/
+
@@ -30,7 +30,7 @@ opacity: .8;
.jumbotron .btn-large {
font-size: 20px;
font-weight: normal;
- padding: 14px 24px;
+ padding: 14px 40px;
margin-right: 10px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
@@ -42,7 +42,7 @@ opacity: .8;
/* Masthead (docs home) */
.masthead {
- padding-top: 36px;
+ padding-top: 0px;
margin-bottom: 72px;
}
.masthead h1,
@@ -66,7 +66,7 @@ opacity: .8;
}
.marketing h1 {
margin: 36px 0 27px;
- font-size: 30px;
+ font-size: 40px;
font-weight: 300;
text-align: center;
}
@@ -9,8 +9,8 @@ def index
def new
@customer = Customer.find(session[:customer_id])
@package = @customer.packages.build
- @available_boots = Boot.available
- @available_skis = Ski.available
+ @available_boots = Boot.this_store(current_store).available
+ @available_skis = Ski.this_store(current_store).available
end
def create
View
@@ -2,9 +2,12 @@ class Boot < ActiveRecord::Base
attr_accessible :brand, :condition, :number, :size, :store_id
belongs_to :store
has_many :packages
-
- scope :available, where(:available => 't')
-
+ validates :number, :uniqueness => { :scope => :store_id }
+
+ scope :available, where(:available => '1')
+ scope :this_store, lambda { |store|
+ where("boots.store_id = ?", store.id)
+ }
before_create :allocate
private
View
@@ -2,8 +2,12 @@ class Ski < ActiveRecord::Base
attr_accessible :brand, :condition, :number, :size, :store_id
belongs_to :store
has_many :packages
+ validates :number, :uniqueness => { :scope => :store_id }
- scope :available, where(:available => 't')
+ scope :available, where(:available => '1')
+ scope :this_store, lambda { |store|
+ where("skis.store_id = ?", store.id)
+ }
before_create :allocate
View
@@ -8,6 +8,7 @@ class Store < ActiveRecord::Base
attr_accessible :email, :password, :password_confirmation, :remember_me
attr_accessible :store_name, :owner_first_name, :owner_last_name, :country, :city, :phone
# attr_accessible :title, :body
+ cattr_accessor :current_store
has_many :boots
has_many :skis

0 comments on commit 98358f1

Please sign in to comment.