refinerycms-stores 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -8,7 +8,7 @@ GIT
8
8
  PATH
9
9
  remote: .
10
10
  specs:
11
- refinerycms-stores (0.0.4)
11
+ refinerycms-stores (0.0.5)
12
12
  aasm (> 3.0)
13
13
  haml-rails
14
14
  hpricot
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.5
1
+ 0.0.6
@@ -1,6 +1,7 @@
1
1
  module Refinery
2
2
  module Products
3
- class ProductsController < ::ApplicationController
3
+ class ProductsController < ::Refinery::StoresApplicationController
4
+ before_filter :find_cart
4
5
 
5
6
  def show
6
7
  @product = Product.find(params[:id])
@@ -1,6 +1,6 @@
1
1
  module Refinery
2
2
  module Stores
3
- class StoresController < ::ApplicationController
3
+ class StoresController < ::Refinery::StoresApplicationController
4
4
 
5
5
  before_filter :find_all_stores, :only => :index
6
6
  before_filter :find_page, :except => [:index, :add_to_cart, :empty_cart, :checkout]
@@ -55,11 +55,7 @@ module Refinery
55
55
  redirect_to refinery.stores_store_path( find_first_store )
56
56
  end
57
57
 
58
-
59
- def find_cart
60
- @cart = (session[:cart] ||= Cart.new)
61
- end
62
-
58
+
63
59
  protected
64
60
 
65
61
  def find_first_store
@@ -0,0 +1,12 @@
1
+ module Refinery
2
+ class StoresApplicationController < ::ApplicationController
3
+
4
+
5
+ protected
6
+
7
+ def find_cart
8
+ @cart = (session[:cart] ||= Cart.new)
9
+ end
10
+
11
+ end # class
12
+ end # mod
@@ -3,103 +3,74 @@
3
3
  <% end %>
4
4
 
5
5
  <% content_for :body_content_left do %>
6
- <section>
7
- <h1>Store</h1>
8
- <p>
9
- <%=raw @product.store %>
10
- </p>
11
- </section>
12
- <section>
13
- <h1>Name</h1>
14
- <p>
15
- <%=raw @product.name %>
16
- </p>
17
- </section>
18
- <section>
19
- <h1>Code</h1>
20
- <p>
21
- <%=raw @product.code %>
22
- </p>
23
- </section>
24
- <section>
25
- <h1>Description</h1>
26
- <p>
27
- <%=raw @product.description %>
28
- </p>
29
- </section>
30
- <section>
31
- <h1>Date Available</h1>
32
- <p>
33
- <%=raw @product.date_available %>
34
- </p>
35
- </section>
36
- <section>
37
- <h1>Price</h1>
38
- <p>
39
- <%=raw @product.price %>
40
- </p>
41
- </section>
42
- <section>
43
- <h1>Size Width</h1>
44
- <p>
45
- <%=raw @product.size_width %>
46
- </p>
47
- </section>
48
- <section>
49
- <h1>Size Height</h1>
50
- <p>
51
- <%=raw @product.size_height %>
52
- </p>
53
- </section>
54
- <section>
55
- <h1>Size Depth</h1>
56
- <p>
57
- <%=raw @product.size_depth %>
58
- </p>
59
- </section>
60
- <section>
61
- <h1>Weight</h1>
62
- <p>
63
- <%=raw @product.weight %>
64
- </p>
65
- </section>
66
- <section>
67
- <h1>Tax Type</h1>
68
- <p>
69
- <%=raw @product.tax_type %>
70
- </p>
71
- </section>
72
- <section>
73
- <h1>Digital Download</h1>
74
- <p>
75
- <%=raw @product.digital_download %>
76
- </p>
77
- </section>
78
- <section>
79
- <h1>Main Pic</h1>
80
- <p>
81
- <%=raw @product.main_pic %>
82
- </p>
83
- </section>
84
- <section>
85
- <h1>Inactive</h1>
86
- <p>
87
- <%=raw @product.inactive %>
88
- </p>
6
+ <section id="product">
7
+
8
+ <div class="product_show">
9
+
10
+ <div class="product_photo">
11
+
12
+ <% if @product.main_pic_id -%>
13
+ <%= image_fu @product.main_pic, Refinery::Images.user_image_sizes[:large], :class => "product-pic", :alt => @product.name %>
14
+ <% else -%>
15
+ &nbsp;
16
+ <% end %>
17
+
18
+ </div>
19
+
20
+ <div class="product_text">
21
+
22
+ <h2> <%= @product.name %> </h2>
23
+ <p>
24
+ <%= raw @product.description %>
25
+ </p>
26
+
27
+ </div>
28
+
29
+ </div>
30
+
31
+ <div class="product_spec">
32
+
33
+ <div class="product_code">
34
+
35
+ <p>
36
+ code: <%= @product.code %> <br/>
37
+ size:
38
+ <%= number_with_precision(@product.size_width, :precision => 1) %> x
39
+ <%= number_with_precision(@product.size_height, :precision => 1) %> x
40
+ <%= number_with_precision(@product.size_depth, :precision => 1) %> <br/>
41
+ weight:
42
+ <%= number_with_precision(@product.weight, :precision => 1) %> lbs
43
+
44
+ <% unless @product.digital_download_id.blank? %>
45
+ <i>digital download</i>
46
+ <% end -%>
47
+ </p>
48
+
49
+ </div>
50
+
51
+ <div class="product_pricebuy">
52
+
53
+ <p>
54
+ <%= number_to_currency(@product.price) %>
55
+ </p>
56
+
57
+ <div class="product-action">
58
+ <%= button_to( "add to cart", refinery.add_to_cart_stores_stores_path(:id => @product), :class => "add-to-cart" ) %>
59
+ </div>
60
+
61
+ </div>
62
+
63
+ </div>
64
+
89
65
  </section>
66
+
90
67
  <% end %>
91
68
 
92
69
  <% content_for :body_content_right do %>
93
70
  <aside>
94
- <h2><%= t('.other') %></h2>
95
- <ul id="products">
96
- <% @products.each do |product| %>
97
- <li>
98
- <%= link_to product.name, refinery.products_product_path(product) %>
99
- </li>
100
- <% end %>
101
- </ul>
71
+ <%= render( :partial => "refinery/stores/stores/cart", :object => @cart ) %>
102
72
  </aside>
73
+
103
74
  <% end %>
104
75
 
105
76
  <%= render '/refinery/content_page' %>
@@ -8,7 +8,7 @@
8
8
  </div>
9
9
 
10
10
  <table>
11
- <%= render(:partial => "cart_item", :collection => cart.items) %>
11
+ <%= render(:partial => "refinery/stores/stores/cart_item", :collection => cart.items) %>
12
12
  <tr class="total-line">
13
13
  <td colspan="2">Total</td>
14
14
  <td class="total-cell"><%= number_to_currency(cart.total_price) %></td>
@@ -9,7 +9,7 @@
9
9
  <dd>
10
10
  <%= link_to( ( truncate( list_product.name, :length => 60 ) + " &raquo;" ).html_safe, refinery.products_product_path( list_product ) ) %>
11
11
  <br/>
12
- $<%= number_with_precision(list_product.price, :precision => 2) %>
12
+ <%= number_to_currency(list_product.price) %>
13
13
  <% # = button_to( "add to cart", refinery.add_to_cart_stores_stores_path(:id => list_product), :class => "add-to-cart" ) %>
14
14
 
15
15
  </dd>
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "refinerycms-stores"
8
- s.version = "0.0.5"
8
+ s.version = "0.0.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Daudi Amani"]
@@ -30,6 +30,7 @@ Gem::Specification.new do |s|
30
30
  "app/controllers/refinery/products/products_controller.rb",
31
31
  "app/controllers/refinery/stores/admin/stores_controller.rb",
32
32
  "app/controllers/refinery/stores/stores_controller.rb",
33
+ "app/controllers/refinery/stores_application_controller.rb",
33
34
  "app/helpers/refinery/orders/orders_helper.rb",
34
35
  "app/models/refinery/addresses/address.rb",
35
36
  "app/models/refinery/orders/line_item.rb",
@@ -222,6 +223,14 @@ Gem::Specification.new do |s|
222
223
  s.add_development_dependency(%q<rb-inotify>, [">= 0.5.1"])
223
224
  s.add_development_dependency(%q<libnotify>, ["~> 0.1.3"])
224
225
  s.add_development_dependency(%q<therubyracer>, [">= 0"])
226
+ s.add_development_dependency(%q<refinerycms-testing>, ["~> 2.0.0"])
227
+ s.add_development_dependency(%q<factory_girl_rails>, [">= 0"])
228
+ s.add_development_dependency(%q<generator_spec>, [">= 0"])
229
+ s.add_development_dependency(%q<jeweler>, [">= 0"])
230
+ s.add_development_dependency(%q<simplecov>, [">= 0"])
231
+ s.add_development_dependency(%q<rb-inotify>, [">= 0.5.1"])
232
+ s.add_development_dependency(%q<libnotify>, ["~> 0.1.3"])
233
+ s.add_development_dependency(%q<therubyracer>, [">= 0"])
225
234
  else
226
235
  s.add_dependency(%q<refinerycms-stores>, [">= 0"])
227
236
  s.add_dependency(%q<refinerycms>, ["~> 2.0.0"])
@@ -303,6 +312,14 @@ Gem::Specification.new do |s|
303
312
  s.add_dependency(%q<rb-inotify>, [">= 0.5.1"])
304
313
  s.add_dependency(%q<libnotify>, ["~> 0.1.3"])
305
314
  s.add_dependency(%q<therubyracer>, [">= 0"])
315
+ s.add_dependency(%q<refinerycms-testing>, ["~> 2.0.0"])
316
+ s.add_dependency(%q<factory_girl_rails>, [">= 0"])
317
+ s.add_dependency(%q<generator_spec>, [">= 0"])
318
+ s.add_dependency(%q<jeweler>, [">= 0"])
319
+ s.add_dependency(%q<simplecov>, [">= 0"])
320
+ s.add_dependency(%q<rb-inotify>, [">= 0.5.1"])
321
+ s.add_dependency(%q<libnotify>, ["~> 0.1.3"])
322
+ s.add_dependency(%q<therubyracer>, [">= 0"])
306
323
  end
307
324
  else
308
325
  s.add_dependency(%q<refinerycms-stores>, [">= 0"])
@@ -385,6 +402,14 @@ Gem::Specification.new do |s|
385
402
  s.add_dependency(%q<rb-inotify>, [">= 0.5.1"])
386
403
  s.add_dependency(%q<libnotify>, ["~> 0.1.3"])
387
404
  s.add_dependency(%q<therubyracer>, [">= 0"])
405
+ s.add_dependency(%q<refinerycms-testing>, ["~> 2.0.0"])
406
+ s.add_dependency(%q<factory_girl_rails>, [">= 0"])
407
+ s.add_dependency(%q<generator_spec>, [">= 0"])
408
+ s.add_dependency(%q<jeweler>, [">= 0"])
409
+ s.add_dependency(%q<simplecov>, [">= 0"])
410
+ s.add_dependency(%q<rb-inotify>, [">= 0.5.1"])
411
+ s.add_dependency(%q<libnotify>, ["~> 0.1.3"])
412
+ s.add_dependency(%q<therubyracer>, [">= 0"])
388
413
  end
389
414
  end
390
415