caboose-store 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/MIT-LICENSE +20 -0
- data/README.md +113 -0
- data/Rakefile +38 -0
- data/app/assets/images/caboose_store/caboose_logo_small.png +0 -0
- data/app/assets/images/caboose_store/caboose_nav.png +0 -0
- data/app/assets/images/caboose_store/caboose_nav_black.png +0 -0
- data/app/assets/images/caboose_store/default_user_pic.png +0 -0
- data/app/assets/images/caboose_store/loading_green.gif +0 -0
- data/app/assets/images/caboose_store/loading_small_white_on_black.gif +0 -0
- data/app/assets/images/caboose_store/loading_white_on_black.gif +0 -0
- data/app/assets/javascripts/caboose_store/admin.js +20 -0
- data/app/assets/javascripts/caboose_store/application.js +17 -0
- data/app/assets/javascripts/caboose_store/modal.js +52 -0
- data/app/assets/javascripts/caboose_store/modal_integration.js +25 -0
- data/app/assets/javascripts/caboose_store/model.form.page.js +30 -0
- data/app/assets/javascripts/caboose_store/model.form.user.js +36 -0
- data/app/assets/javascripts/caboose_store/shortcut.js +11 -0
- data/app/assets/javascripts/caboose_store/station.js +60 -0
- data/app/assets/stylesheets/caboose_store/admin.css +100 -0
- data/app/assets/stylesheets/caboose_store/application.css +19 -0
- data/app/assets/stylesheets/caboose_store/bound_input.css +1 -0
- data/app/assets/stylesheets/caboose_store/caboose.css +4 -0
- data/app/assets/stylesheets/caboose_store/fonts/big_noodle_titling.ttf +0 -0
- data/app/assets/stylesheets/caboose_store/fonts/big_noodle_titling_oblique.ttf +0 -0
- data/app/assets/stylesheets/caboose_store/fonts.css +5 -0
- data/app/assets/stylesheets/caboose_store/login.css +23 -0
- data/app/assets/stylesheets/caboose_store/modal.css +240 -0
- data/app/assets/stylesheets/caboose_store/page_bar_generator.css +34 -0
- data/app/assets/stylesheets/caboose_store/register.css +25 -0
- data/app/assets/stylesheets/caboose_store/station_modal.css +104 -0
- data/app/assets/stylesheets/caboose_store/station_sidebar.css +232 -0
- data/app/assets/stylesheets/caboose_store/tinymce.css +25 -0
- data/app/controllers/caboose_store/application_controller.rb +18 -0
- data/app/controllers/caboose_store/cart_controller.rb +59 -0
- data/app/controllers/caboose_store/categories_controller.rb +128 -0
- data/app/controllers/caboose_store/checkout_controller.rb +164 -0
- data/app/controllers/caboose_store/orders_controller.rb +264 -0
- data/app/controllers/caboose_store/product_images_controller.rb +38 -0
- data/app/controllers/caboose_store/products_controller.rb +387 -0
- data/app/controllers/caboose_store/reviews_controller.rb +15 -0
- data/app/controllers/caboose_store/variants_controller.rb +152 -0
- data/app/helpers/caboose_store/application_helper.rb +46 -0
- data/app/helpers/caboose_store/cart_helper.rb +28 -0
- data/app/helpers/caboose_store/categories_helper.rb +38 -0
- data/app/helpers/caboose_store/products_helper.rb +87 -0
- data/app/mailers/caboose_store/orders_mailer.rb +36 -0
- data/app/models/caboose_store/address.rb +30 -0
- data/app/models/caboose_store/caboose_store_plugin.rb +22 -0
- data/app/models/caboose_store/category.rb +63 -0
- data/app/models/caboose_store/category_membership.rb +11 -0
- data/app/models/caboose_store/discount.rb +14 -0
- data/app/models/caboose_store/message.rb +22 -0
- data/app/models/caboose_store/order.rb +97 -0
- data/app/models/caboose_store/order_discount.rb +11 -0
- data/app/models/caboose_store/order_line_item.rb +13 -0
- data/app/models/caboose_store/order_pdf.rb +82 -0
- data/app/models/caboose_store/product.rb +78 -0
- data/app/models/caboose_store/product_image.rb +25 -0
- data/app/models/caboose_store/product_image_variant.rb +10 -0
- data/app/models/caboose_store/review.rb +13 -0
- data/app/models/caboose_store/schema.rb +146 -0
- data/app/models/caboose_store/shipping_calculator.rb +79 -0
- data/app/models/caboose_store/states.rb +60 -0
- data/app/models/caboose_store/tax_calculator.rb +26 -0
- data/app/models/caboose_store/tax_line.rb +12 -0
- data/app/models/caboose_store/variant.rb +42 -0
- data/app/models/caboose_store/vendor.rb +7 -0
- data/app/views/caboose_store/application/_category_thumb.html.erb +6 -0
- data/app/views/caboose_store/application/_product_thumb.html.erb +13 -0
- data/app/views/caboose_store/cart/index.html.erb +19 -0
- data/app/views/caboose_store/categories/admin_edit.html.erb +82 -0
- data/app/views/caboose_store/categories/admin_index.html.erb +13 -0
- data/app/views/caboose_store/categories/admin_new.html.erb +45 -0
- data/app/views/caboose_store/checkout/billing.html.erb +168 -0
- data/app/views/caboose_store/checkout/discount.html.erb +166 -0
- data/app/views/caboose_store/checkout/index.html.erb +113 -0
- data/app/views/caboose_store/checkout/quantity_box.html.erb +39 -0
- data/app/views/caboose_store/checkout/shipping.html.erb +90 -0
- data/app/views/caboose_store/checkout/thank_you.html.erb +36 -0
- data/app/views/caboose_store/layouts/_banner.html.erb +10 -0
- data/app/views/caboose_store/layouts/_banner2.html.erb +10 -0
- data/app/views/caboose_store/layouts/_footer.html.erb +55 -0
- data/app/views/caboose_store/layouts/_header.html.erb +69 -0
- data/app/views/caboose_store/layouts/_sidebar.html.erb +27 -0
- data/app/views/caboose_store/layouts/application.html.erb +33 -0
- data/app/views/caboose_store/layouts/authorize_net.erb +18 -0
- data/app/views/caboose_store/layouts/layout_about.html.erb +42 -0
- data/app/views/caboose_store/layouts/layout_blog.html.erb +159 -0
- data/app/views/caboose_store/layouts/layout_confirm.html.erb +85 -0
- data/app/views/caboose_store/layouts/layout_contact.html.erb +38 -0
- data/app/views/caboose_store/layouts/layout_default.html.erb +10 -0
- data/app/views/caboose_store/layouts/layout_detail.html.erb +114 -0
- data/app/views/caboose_store/layouts/layout_order.html.erb +77 -0
- data/app/views/caboose_store/layouts/layout_pricing.html.erb +182 -0
- data/app/views/caboose_store/layouts/layout_product.html.erb +110 -0
- data/app/views/caboose_store/layouts/layout_profile.html.erb +55 -0
- data/app/views/caboose_store/layouts/layout_single.html.erb +3 -0
- data/app/views/caboose_store/layouts/layout_testimonial.html.erb +110 -0
- data/app/views/caboose_store/layouts/layout_testing.html.erb +4 -0
- data/app/views/caboose_store/orders/_admin_footer.html.erb +2 -0
- data/app/views/caboose_store/orders/_admin_header.html.erb +31 -0
- data/app/views/caboose_store/orders/_quickbooks_order.html.erb +0 -0
- data/app/views/caboose_store/orders/admin_delete_form.html.erb +21 -0
- data/app/views/caboose_store/orders/admin_edit.html.erb +173 -0
- data/app/views/caboose_store/orders/admin_index.html.erb +79 -0
- data/app/views/caboose_store/orders/admin_new.html.erb +42 -0
- data/app/views/caboose_store/orders/admin_print.html.erb +72 -0
- data/app/views/caboose_store/orders_mailer/customer_new_order.html.erb +47 -0
- data/app/views/caboose_store/orders_mailer/customer_status_updated.html.erb +49 -0
- data/app/views/caboose_store/orders_mailer/fulfillment_new_order.html.erb +43 -0
- data/app/views/caboose_store/orders_mailer/shipping_order_ready.html.erb +46 -0
- data/app/views/caboose_store/products/_admin_footer.html.erb +2 -0
- data/app/views/caboose_store/products/_admin_header.html.erb +31 -0
- data/app/views/caboose_store/products/admin_delete_form.html.erb +21 -0
- data/app/views/caboose_store/products/admin_edit_categories.html.erb +73 -0
- data/app/views/caboose_store/products/admin_edit_category_images.html.erb +233 -0
- data/app/views/caboose_store/products/admin_edit_description.html.erb +41 -0
- data/app/views/caboose_store/products/admin_edit_general.html.erb +47 -0
- data/app/views/caboose_store/products/admin_edit_images.html.erb +234 -0
- data/app/views/caboose_store/products/admin_edit_options.html.erb +51 -0
- data/app/views/caboose_store/products/admin_edit_seo.html.erb +37 -0
- data/app/views/caboose_store/products/admin_edit_variant_columns.html.erb +75 -0
- data/app/views/caboose_store/products/admin_edit_variants.html.erb +101 -0
- data/app/views/caboose_store/products/admin_edit_variants_single.html.erb +68 -0
- data/app/views/caboose_store/products/admin_index.html.erb +47 -0
- data/app/views/caboose_store/products/admin_new.html.erb +41 -0
- data/app/views/caboose_store/products/details.html.erb +437 -0
- data/app/views/caboose_store/products/index.html.erb +46 -0
- data/app/views/caboose_store/products/not_available.html.erb +35 -0
- data/app/views/caboose_store/variants/admin_edit.html.erb +80 -0
- data/app/views/caboose_store/variants/admin_new.html.erb +59 -0
- data/config/routes.rb +95 -0
- data/lib/caboose-store/caboose_store_helper.rb +35 -0
- data/lib/caboose-store/engine.rb +8 -0
- data/lib/caboose-store/version.rb +3 -0
- data/lib/caboose-store.rb +9 -0
- data/lib/tasks/caboose-store.rake +17 -0
- data/test/caboose_test.rb +7 -0
- data/test/dummy/README.rdoc +261 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/application.js +15 -0
- data/test/dummy/app/assets/stylesheets/application.css +13 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/config/application.rb +59 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +37 -0
- data/test/dummy/config/environments/production.rb +67 -0
- data/test/dummy/config/environments/test.rb +37 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +15 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +4 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/test.log +25 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +25 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/integration/navigation_test.rb +10 -0
- data/test/test_helper.rb +15 -0
- metadata +260 -0
@@ -0,0 +1,437 @@
|
|
1
|
+
<style type='text/css'>
|
2
|
+
.heads {
|
3
|
+
display: none;
|
4
|
+
}
|
5
|
+
#easy_zoom img { min-width: 1200px; }
|
6
|
+
#easy_zoom {
|
7
|
+
width:550px;
|
8
|
+
height:400px;
|
9
|
+
border:5px solid #eee;
|
10
|
+
background:#fff;
|
11
|
+
color:#333;
|
12
|
+
position:absolute;
|
13
|
+
top:148px;
|
14
|
+
left:635px;
|
15
|
+
overflow:hidden;
|
16
|
+
-moz-box-shadow:0 0 10px #777;
|
17
|
+
-webkit-box-shadow:0 0 10px #777;
|
18
|
+
box-shadow:0 0 10px #777;
|
19
|
+
/* vertical and horizontal alignment used for preloader text */
|
20
|
+
line-height:400px;
|
21
|
+
text-align:center;
|
22
|
+
}
|
23
|
+
#login-btn { cursor: pointer; }
|
24
|
+
.thumbnail {
|
25
|
+
width: 60px !important;
|
26
|
+
height: 60px !important;
|
27
|
+
overflow: hidden !important;
|
28
|
+
padding: 1px !important;
|
29
|
+
background-color: #ccc !important;
|
30
|
+
}
|
31
|
+
#itemsingle .carousel-indicators li:nth-child(3n) {
|
32
|
+
margin-right: 13px !important;
|
33
|
+
}
|
34
|
+
a.zoom-image {
|
35
|
+
position: relative;
|
36
|
+
display: block;
|
37
|
+
}
|
38
|
+
a.zoom-image .fullsize-loading {
|
39
|
+
position:absolute;
|
40
|
+
z-index:150;
|
41
|
+
}
|
42
|
+
div.product_thumb_image {
|
43
|
+
overflow: hidden;
|
44
|
+
}
|
45
|
+
div.product_thumb_image img {
|
46
|
+
margin: 0 auto;
|
47
|
+
}
|
48
|
+
ol.carousel-indicators li.thumbnail {
|
49
|
+
width: 100px;
|
50
|
+
height: 100px;
|
51
|
+
}
|
52
|
+
.product-review {
|
53
|
+
list-style:none;
|
54
|
+
margin-left:0;
|
55
|
+
padding:15px;
|
56
|
+
}
|
57
|
+
.product-review:nth-child(odd) {
|
58
|
+
background-color: rgb(240, 240, 240);
|
59
|
+
}
|
60
|
+
</style>
|
61
|
+
<% p = @product %>
|
62
|
+
|
63
|
+
<div class="page-content">
|
64
|
+
<div class="container">
|
65
|
+
<div class="row-fluid">
|
66
|
+
<div class="span12">
|
67
|
+
<ul class="breadcrumb">
|
68
|
+
<li><a href="/">Home</a>
|
69
|
+
<% if p.categories[1] %>
|
70
|
+
<span class="divider">/</span></li>
|
71
|
+
<% p.categories[1].ancestry.each do |c| %>
|
72
|
+
<% if c != p.categories[1] %>
|
73
|
+
<li><a href="<%= c.url %>"><%= c.name %></a> <span class="divider">/</span></li>
|
74
|
+
<% else %>
|
75
|
+
<li><a href="<%= c.url %>"><%= c.name %></a></li>
|
76
|
+
<% end %>
|
77
|
+
<% end %>
|
78
|
+
<% else %>
|
79
|
+
</li>
|
80
|
+
<% end %>
|
81
|
+
</ul>
|
82
|
+
</div>
|
83
|
+
</div>
|
84
|
+
|
85
|
+
<div class="row-fluid">
|
86
|
+
<div class="span12 single-item">
|
87
|
+
<div class="row-fluid">
|
88
|
+
<div class="span5">
|
89
|
+
<div id="itemsingle" class="carousel slide clearfix">
|
90
|
+
|
91
|
+
<div class="carousel-inner">
|
92
|
+
<% if p.product_images != [] %>
|
93
|
+
<% p.product_images.each_index do |i| %>
|
94
|
+
<% if i == 0 %>
|
95
|
+
<div class="item active" id="img_<%= p.product_images[i].id %>" style='position: relative;'>
|
96
|
+
<% else %>
|
97
|
+
<div class="item" id="img_<%= p.product_images[i].id %>" style='position: relative;'>
|
98
|
+
<% end %>
|
99
|
+
<a href="<%= p.product_images[i].url(:huge) %>" class="zoom-image" title="<%= p.title %>">
|
100
|
+
<img src="<%= p.product_images[i].url(:large) %>" title="<%= p.title %>" />
|
101
|
+
</a>
|
102
|
+
</div>
|
103
|
+
<% end %>
|
104
|
+
</div>
|
105
|
+
|
106
|
+
<ol class="carousel-indicators">
|
107
|
+
<% p.product_images.each_index do |i| %>
|
108
|
+
<li class='thumbnail' id="thumb_<%= p.product_images[i].id %>" data-target="#itemsingle" data-slide-to="<%= i %>">
|
109
|
+
<div class='product_thumb_image' style="<%= square_image(p.product_images[i]) %> height:100px; background-size:100px;"></div>
|
110
|
+
</li>
|
111
|
+
<% end %>
|
112
|
+
</ol>
|
113
|
+
<% else %>
|
114
|
+
<div class="item active" style='position: relative;'>
|
115
|
+
<img src="https://dmwwflw4i3miv.cloudfront.net/placeholder.jpg" title="<%= p.title %>" />
|
116
|
+
</div>
|
117
|
+
</div>
|
118
|
+
<% end
|
119
|
+
# end p.product_images
|
120
|
+
%>
|
121
|
+
|
122
|
+
</div>
|
123
|
+
</div>
|
124
|
+
<div class="span7">
|
125
|
+
<h3><%= p.title %></h3>
|
126
|
+
<div class="row-fluid">
|
127
|
+
<div class="span6">
|
128
|
+
<% if @average > 0 %>
|
129
|
+
<span class="rateit" data-rateit-value="<%= @average %>" data-rateit-ispreset="true" data-rateit-readonly="true" style="margin-bottom:10px;"></span>
|
130
|
+
<% end %>
|
131
|
+
<% if p.option1 && p.option1.strip.length > 0 %>
|
132
|
+
<% default = p.default1 ? p.default1 : p.variants[0].option1 %>
|
133
|
+
<select name='option1' id='option1'>
|
134
|
+
<optgroup label="Select a <%= p.option1 %>">
|
135
|
+
<% p.variants.where(:status => 'Active').collect{|v| v.option1}.reject{|str| str.nil? }.uniq.sort.each do |v| %>
|
136
|
+
<option value="<%= v %>"<%= raw v == default ? " selected='true'" : '' %>><%= v %></option>
|
137
|
+
<% end %>
|
138
|
+
</optgroup>
|
139
|
+
</select>
|
140
|
+
<br>
|
141
|
+
<% end %>
|
142
|
+
<% if p.option2 && p.option2.strip.length > 0 %>
|
143
|
+
<% default = p.default2 ? p.default2 : p.variants[0].option2 %>
|
144
|
+
<select name='option2' id='option2'>
|
145
|
+
<optgroup label="Select a <%= p.option2 %>">
|
146
|
+
<% p.variants.where(:status => 'Active').collect{|v| v.option2}.compact.uniq.sort.each do |v| %>
|
147
|
+
<option value="<%= v %>"<%= raw v == default ? " selected='true'" : '' %>><%= v %></option>
|
148
|
+
<% end %>
|
149
|
+
</optgroup>
|
150
|
+
</select>
|
151
|
+
<br>
|
152
|
+
<% end %>
|
153
|
+
<% if p.option3 && p.option3.strip.length > 0 %>
|
154
|
+
<% default = p.default3 ? p.default3 : p.variants[0].option3 %>
|
155
|
+
<select name='option3' id='option3'>
|
156
|
+
<optgroup label="Select a <%= p.option3 %>">
|
157
|
+
<% p.variants.where(:status => 'Active').collect{|v| v.option3}.reject{|str| str.nil?}.uniq.sort.each do |v| %>
|
158
|
+
<option value="<%= v %>"<%= raw v == default ? " selected='true'" : '' %>><%= v %></option>
|
159
|
+
<% end %>
|
160
|
+
</optgroup>
|
161
|
+
</select>
|
162
|
+
<br>
|
163
|
+
<% end %>
|
164
|
+
<span id='variant_qty'></span>
|
165
|
+
</div>
|
166
|
+
<div class="span6">
|
167
|
+
<h4>$<span id="variant_price"><%= p.most_popular_variant.price %></span></h4>
|
168
|
+
<p id="add_cart_btn"><a href="#" class="btn btn-warning btn-large"><i class="icon-shopping-cart"></i> Add to Cart</a></p>
|
169
|
+
<p class="btn btn-warning btn-large" id="sold_out_btn" style="display:none;"><i class="icon-shopping-cart"></i> Sold Out</p>
|
170
|
+
</div>
|
171
|
+
</div>
|
172
|
+
<br><br>
|
173
|
+
<p><%= strip_tags(p.description) %></p>
|
174
|
+
</div>
|
175
|
+
</div>
|
176
|
+
|
177
|
+
<div class="row-fluid">
|
178
|
+
<div class="span12">
|
179
|
+
<div class="tabbable">
|
180
|
+
<ul class="nav nav-tabs">
|
181
|
+
<li class="active"><a href="#tab1" data-toggle="tab">Product Features</a></li>
|
182
|
+
<li class=""><a href="#tab2" data-toggle="tab">Recent Reviews</a></li>
|
183
|
+
<li class=""><a href="#tab3" data-toggle="tab">Related Items</a></li>
|
184
|
+
</ul>
|
185
|
+
<div class="tab-content">
|
186
|
+
<div class="tab-pane active" id="tab1">
|
187
|
+
<p><%= strip_tags(p.description) %></p>
|
188
|
+
</div>
|
189
|
+
<div class="tab-pane" id="tab2">
|
190
|
+
<ul>
|
191
|
+
<% if @reviews.present? %>
|
192
|
+
<% @reviews.each do |r| %>
|
193
|
+
<li class='product-review'>
|
194
|
+
<% if r.rating && r.rating != 0 %>
|
195
|
+
<div class="rateit" data-rateit-value="<%= r.rating %>" data-rateit-ispreset="true" data-rateit-readonly="true" style="margin-right:10px;"></div>
|
196
|
+
<% end %>
|
197
|
+
<span style="font-weight:bold;"><%= r.name %></span>
|
198
|
+
<p><%= r.content %></p>
|
199
|
+
</li>
|
200
|
+
<%
|
201
|
+
end # @reviews.each do |r|
|
202
|
+
%>
|
203
|
+
<% else %>
|
204
|
+
<p>No reviews yet.</p>
|
205
|
+
<%
|
206
|
+
end # if @reviews.present?
|
207
|
+
%>
|
208
|
+
</ul>
|
209
|
+
<span id="message"></span>
|
210
|
+
<div id="add-new-review">
|
211
|
+
<hr style="display:block !important;"/>
|
212
|
+
Submit Your Review
|
213
|
+
<br>
|
214
|
+
<div class="rateit" id="new-rating"></div>
|
215
|
+
<br>
|
216
|
+
<form id="new_review">
|
217
|
+
<textarea name="content" cols="90" rows="3"></textarea>
|
218
|
+
<input type="hidden" name="product_id" value='<%= p.id %>' />
|
219
|
+
</form>
|
220
|
+
<button id="submit_review">Submit</button>
|
221
|
+
<br>
|
222
|
+
<br>
|
223
|
+
</div>
|
224
|
+
<div id="login-section">
|
225
|
+
<p>To submit a review, please <a id='login-btn'>log in</a>.</p>
|
226
|
+
</div>
|
227
|
+
</div>
|
228
|
+
<div class="tab-pane" id="tab3">
|
229
|
+
<div class="row-fluid">
|
230
|
+
<% if p.related_items && p.related_items.count > 0 %>
|
231
|
+
<ul class="thumbnails">
|
232
|
+
<% p.related_items.each do |p2| %>
|
233
|
+
<li class="span4">
|
234
|
+
<div class="thumbnail">
|
235
|
+
<div class="caption-details">
|
236
|
+
<h5><%= p2.title %></h5>
|
237
|
+
<span class="price"><%= raw product_price(p2) %></span>
|
238
|
+
</div>
|
239
|
+
</div>
|
240
|
+
</li>
|
241
|
+
<% end %>
|
242
|
+
</ul>
|
243
|
+
<% else %>
|
244
|
+
<p>This product doesn't have any related items yet.</p>
|
245
|
+
<% end %>
|
246
|
+
</div>
|
247
|
+
</div>
|
248
|
+
</div>
|
249
|
+
</div>
|
250
|
+
</div>
|
251
|
+
</div>
|
252
|
+
</div>
|
253
|
+
<!--break-->
|
254
|
+
</div>
|
255
|
+
</div>
|
256
|
+
</div>
|
257
|
+
|
258
|
+
<%= content_for :caboose_js do %>
|
259
|
+
<script type='text/javascript'>
|
260
|
+
|
261
|
+
var option1 = <%= raw p.option1 ? p.option1.to_json : false %>;
|
262
|
+
var option2 = <%= raw p.option2 ? p.option2.to_json : false %>;
|
263
|
+
var option3 = <%= raw p.option3 ? p.option3.to_json : false %>;
|
264
|
+
var default1 = <%= raw p.default1 ? p.default1.to_json : false %>;
|
265
|
+
var default2 = <%= raw p.default2 ? p.default2.to_json : false %>;
|
266
|
+
var default3 = <%= raw p.default3 ? p.default3.to_json : false %>;
|
267
|
+
var variants = <%= raw Caboose.json(p.variants) %>;
|
268
|
+
|
269
|
+
var quantities = {};
|
270
|
+
|
271
|
+
function get_variant_for_options()
|
272
|
+
{
|
273
|
+
var v1 = option1 ? $('#option1').val() : false;
|
274
|
+
var v2 = option2 ? $('#option2').val() : false;
|
275
|
+
var v3 = option3 ? $('#option3').val() : false;
|
276
|
+
|
277
|
+
var variant = false;
|
278
|
+
$.each(variants, function(i, v) {
|
279
|
+
if (v.option1 == v1 && (!option2 || (v.option2 == v2 && (!option3 || v.option3 == v3))))
|
280
|
+
{
|
281
|
+
variant = v;
|
282
|
+
return false;
|
283
|
+
}
|
284
|
+
});
|
285
|
+
return variant;
|
286
|
+
}
|
287
|
+
|
288
|
+
function show_variant_image() {
|
289
|
+
var v = get_variant_for_options();
|
290
|
+
if (!v) return;
|
291
|
+
|
292
|
+
var rurl = "/variant-images/" + v.id;
|
293
|
+
$.ajax({
|
294
|
+
type: 'get',
|
295
|
+
url: rurl,
|
296
|
+
success: function(img) {
|
297
|
+
if(img) {
|
298
|
+
var image = "#img_" + img.id;
|
299
|
+
var thumb = "#thumb_" + img.id;
|
300
|
+
$(".item").removeClass("active");
|
301
|
+
$(".thumbnail").removeClass("active");
|
302
|
+
$(image).addClass("active");
|
303
|
+
$(thumb).addClass("active");
|
304
|
+
}
|
305
|
+
}
|
306
|
+
});
|
307
|
+
}
|
308
|
+
|
309
|
+
function set_status()
|
310
|
+
{
|
311
|
+
var v = get_variant_for_options();
|
312
|
+
if (!v || v.quantity_in_stock == 0)
|
313
|
+
{
|
314
|
+
$("#variant_qty").html("Sold Out").css("color","red");
|
315
|
+
$("#add_cart_btn").hide();
|
316
|
+
$("#sold_out_btn").show();
|
317
|
+
if (v && v.price > 0) $("#variant_price").html(v.price);
|
318
|
+
}
|
319
|
+
else
|
320
|
+
{
|
321
|
+
$("#variant_qty").html("In Stock").css("color","green");
|
322
|
+
$("#add_cart_btn").show();
|
323
|
+
$("#sold_out_btn").hide();
|
324
|
+
if (v && v.price > 0) $("#variant_price").html(v.price);
|
325
|
+
}
|
326
|
+
}
|
327
|
+
|
328
|
+
function add_to_cart()
|
329
|
+
{
|
330
|
+
var v = get_variant_for_options();
|
331
|
+
if (!v) return;
|
332
|
+
|
333
|
+
$.colorbox({
|
334
|
+
href: '/cart/add/' + v.id,
|
335
|
+
iframe: true,
|
336
|
+
initialWidth: 400,
|
337
|
+
initialHeight: 200,
|
338
|
+
innerWidth: 400,
|
339
|
+
innerHeight: 200,
|
340
|
+
scrolling: false,
|
341
|
+
transition: 'fade',
|
342
|
+
closeButton: false,
|
343
|
+
onComplete: fix_colorbox,
|
344
|
+
opacity: 0.50
|
345
|
+
});
|
346
|
+
}
|
347
|
+
|
348
|
+
// Added to application footer
|
349
|
+
//function fix_colorbox() {
|
350
|
+
// var padding = 21; // 21 is default
|
351
|
+
// $("#cboxTopLeft" ).css('background', '#111');
|
352
|
+
// $("#cboxTopRight" ).css('background', '#111');
|
353
|
+
// $("#cboxBottomLeft" ).css('background', '#111');
|
354
|
+
// $("#cboxBottomRight" ).css('background', '#111');
|
355
|
+
// $("#cboxMiddleLeft" ).css('background', '#111');
|
356
|
+
// $("#cboxMiddleRight" ).css('background', '#111');
|
357
|
+
// $("#cboxTopCenter" ).css('background', '#111');
|
358
|
+
// $("#cboxBottomCenter" ).css('background', '#111');
|
359
|
+
// $("#cboxClose" ).hide();
|
360
|
+
//
|
361
|
+
// //var p = (padding-21)*2;
|
362
|
+
// //$("#cboxWrapper" ).css('padding', '0 ' + p + ' ' + p + ' 0');
|
363
|
+
// //$('#cboxLoadedContent').css('margin-bottom', 0);
|
364
|
+
// //h = $('#cboxLoadedContent').height();
|
365
|
+
// //$('#cboxLoadedContent').css('height', ''+(h+28)+'px');
|
366
|
+
//}
|
367
|
+
|
368
|
+
$(document).ready(function() {
|
369
|
+
show_variant_image();
|
370
|
+
if (option1) $('#option1').change(function() { set_status(); show_variant_image(); });
|
371
|
+
if (option2) $('#option2').change(function() { set_status(); show_variant_image(); });
|
372
|
+
if (option3) $('#option3').change(function() { set_status(); show_variant_image(); });
|
373
|
+
set_status();
|
374
|
+
$('.zoom-image').each( function() { $(this).easyZoom(); });
|
375
|
+
$('#add_cart_btn a').click(function(e) {
|
376
|
+
e.preventDefault();
|
377
|
+
add_to_cart();
|
378
|
+
});
|
379
|
+
});
|
380
|
+
|
381
|
+
|
382
|
+
</script>
|
383
|
+
|
384
|
+
<% if @is_logged_in %>
|
385
|
+
<script type='text/javascript'>
|
386
|
+
$("#login-section").hide();
|
387
|
+
$("#submit_review").click( function() {
|
388
|
+
var info = $("#new_review").serialize();
|
389
|
+
info += "&rating=" + $("#new-rating").rateit("value") + "&name=" + "<%= @first_name %>" + "+" + "<%= @last_name %>";
|
390
|
+
$.post("/reviews/add", info, function(data, status) { window.location.reload(true); });
|
391
|
+
$("#add-new-review").slideUp();
|
392
|
+
$("#message").html("<p class='note success'>Review added successfully</p>");
|
393
|
+
});
|
394
|
+
|
395
|
+
</script>
|
396
|
+
|
397
|
+
|
398
|
+
<% else %>
|
399
|
+
<script type='text/javascript'>
|
400
|
+
$("#add-new-review").hide();
|
401
|
+
$("#login-btn").click( function() {
|
402
|
+
open_colorbox();
|
403
|
+
});
|
404
|
+
|
405
|
+
function open_colorbox() {
|
406
|
+
$.colorbox({
|
407
|
+
href: '/login?return_url=/products/<%= p.id %>',
|
408
|
+
iframe: true,
|
409
|
+
innerWidth: 200,
|
410
|
+
innerHeight: 50,
|
411
|
+
scrolling: false,
|
412
|
+
transition: 'fade',
|
413
|
+
closeButton: false,
|
414
|
+
onComplete: fix_colorbox,
|
415
|
+
opacity: 0.50,
|
416
|
+
// onClosed: function() { open_colorbox(); }
|
417
|
+
});
|
418
|
+
}
|
419
|
+
|
420
|
+
function fix_colorbox() {
|
421
|
+
$("#cboxTopLeft" ).css('background', '#111');
|
422
|
+
$("#cboxTopRight" ).css('background', '#111');
|
423
|
+
$("#cboxBottomLeft" ).css('background', '#111');
|
424
|
+
$("#cboxBottomRight" ).css('background', '#111');
|
425
|
+
$("#cboxMiddleLeft" ).css('background', '#111');
|
426
|
+
$("#cboxMiddleRight" ).css('background', '#111');
|
427
|
+
$("#cboxTopCenter" ).css('background', '#111');
|
428
|
+
$("#cboxBottomCenter" ).css('background', '#111');
|
429
|
+
$("#cboxClose" ).hide();
|
430
|
+
}
|
431
|
+
|
432
|
+
</script>
|
433
|
+
<% end %>
|
434
|
+
|
435
|
+
|
436
|
+
<% end %>
|
437
|
+
|
@@ -0,0 +1,46 @@
|
|
1
|
+
|
2
|
+
<div id="catalogue">
|
3
|
+
<div class="container">
|
4
|
+
<div class="row-fluid">
|
5
|
+
<div class="span12">
|
6
|
+
<ul class="breadcrumb">
|
7
|
+
<li><a href="/">Home</a><span class="divider">/</span></li>
|
8
|
+
|
9
|
+
<% @category.ancestry.each do |c| %>
|
10
|
+
<% if c != @category %>
|
11
|
+
<li><a href="<%= c.url %>"><%= c.name %></a> <span class="divider">/</span></li>
|
12
|
+
<% else %>
|
13
|
+
<li><a href="<%= c.url %>"><%= c.name %></a></li>
|
14
|
+
<% end %>
|
15
|
+
<% end %>
|
16
|
+
</ul>
|
17
|
+
</div>
|
18
|
+
</div>
|
19
|
+
|
20
|
+
<div class="row-fluid">
|
21
|
+
<div class="span12">
|
22
|
+
<h2><%= @category.name %></h2>
|
23
|
+
<ul class="thumbs">
|
24
|
+
|
25
|
+
<% if @category.children && @category.children.count > 0 %>
|
26
|
+
<% @category.children.each do |cat| %>
|
27
|
+
<% if cat.id != 32 && cat.products != [] %>
|
28
|
+
<%= render partial: 'category_thumb', locals: {category: cat} %>
|
29
|
+
<% end %>
|
30
|
+
<% end %>
|
31
|
+
<% end %>
|
32
|
+
|
33
|
+
<% if @category.products && @category.products.count > 0 %>
|
34
|
+
<% @category.products.each do |p| %>
|
35
|
+
<% if p.status == "Active" && p.variants != [] %>
|
36
|
+
<%= render partial: 'product_thumb', locals: {product: p} %>
|
37
|
+
<% end %>
|
38
|
+
<% end %>
|
39
|
+
<% end %>
|
40
|
+
|
41
|
+
</ul>
|
42
|
+
</div>
|
43
|
+
</div>
|
44
|
+
</div>
|
45
|
+
</div>
|
46
|
+
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<% p = @product %>
|
2
|
+
|
3
|
+
<div class="page-content">
|
4
|
+
<div class="container">
|
5
|
+
<div class="row-fluid">
|
6
|
+
<div class="span12">
|
7
|
+
<ul class="breadcrumb">
|
8
|
+
<li><a href="/">Home</a>
|
9
|
+
<% if p.categories[1] %>
|
10
|
+
<span class="divider">/</span></li>
|
11
|
+
<% p.categories[1].ancestry.each do |c| %>
|
12
|
+
<% if c != p.categories[1] %>
|
13
|
+
<li><a href="<%= c.url %>"><%= c.name %></a> <span class="divider">/</span></li>
|
14
|
+
<% else %>
|
15
|
+
<li><a href="<%= c.url %>"><%= c.name %></a></li>
|
16
|
+
<% end %>
|
17
|
+
<% end %>
|
18
|
+
<% else %>
|
19
|
+
</li>
|
20
|
+
<% end %>
|
21
|
+
</ul>
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
<div class="row-fluid">
|
25
|
+
<div class="span12 single-item">
|
26
|
+
<div class="row-fluid">
|
27
|
+
<div class="span7">
|
28
|
+
<h3><%= p.title %></h3>
|
29
|
+
<p>This product is not currently available.</p>
|
30
|
+
</div>
|
31
|
+
</div>
|
32
|
+
</div>
|
33
|
+
</div>
|
34
|
+
</div>
|
35
|
+
</div>
|
@@ -0,0 +1,80 @@
|
|
1
|
+
<%
|
2
|
+
p = @product
|
3
|
+
v = @variant
|
4
|
+
%>
|
5
|
+
<h1>Edit Variant</h1>
|
6
|
+
|
7
|
+
<table>
|
8
|
+
<tr>
|
9
|
+
<td valign='top'>
|
10
|
+
<h2>Options</h2>
|
11
|
+
<% if p.option1 %><div id='variant_<%= v.id %>_option1'></div><% end %>
|
12
|
+
<% if p.option2 %><div id='variant_<%= v.id %>_option2'></div><% end %>
|
13
|
+
<% if p.option3 %><div id='variant_<%= v.id %>_option3'></div><% end %>
|
14
|
+
<div id='variant_<%= v.id %>_status' ></div>
|
15
|
+
<div id='variant_<%= v.id %>_requires_shipping' ></div>
|
16
|
+
<div id='variant_<%= v.id %>_allow_backorder' ></div>
|
17
|
+
<div id='variant_<%= v.id %>_taxable' ></div>
|
18
|
+
</td><td valign='top'>
|
19
|
+
<h2>Inventory</h2>
|
20
|
+
<div id='variant_<%= v.id %>_alternate_id' ></div>
|
21
|
+
<div id='variant_<%= v.id %>_sku' ></div>
|
22
|
+
<div id='variant_<%= v.id %>_barcode' ></div>
|
23
|
+
<div id='variant_<%= v.id %>_price' ></div>
|
24
|
+
<div id='variant_<%= v.id %>_quantity_in_stock' ></div>
|
25
|
+
</td><td valign='top'>
|
26
|
+
<h2>Dimensions</h2>
|
27
|
+
<div id='variant_<%= v.id %>_weight' ></div>
|
28
|
+
<div id='variant_<%= v.id %>_cylinder' ></div>
|
29
|
+
<div id='variant_<%= v.id %>_length' ></div>
|
30
|
+
<div id='variant_<%= v.id %>_width' ></div>
|
31
|
+
<div id='variant_<%= v.id %>_height' ></div>
|
32
|
+
</td>
|
33
|
+
</tr>
|
34
|
+
</table>
|
35
|
+
<div id='message'></div>
|
36
|
+
<p>
|
37
|
+
<input type='button' value='< Back' onclick="window.location='/admin/products/<%= p.id %>/variants';" />
|
38
|
+
<input type='button' value='Delete Variant' onclick="delete_variant(<%= v.id %>);" />
|
39
|
+
</p>
|
40
|
+
|
41
|
+
<% content_for :caboose_js do %>
|
42
|
+
<%= javascript_include_tag "caboose/model/all" %>
|
43
|
+
<%= javascript_include_tag "admin_products" %>
|
44
|
+
<script type='text/javascript'>
|
45
|
+
|
46
|
+
$(document).ready(function() {
|
47
|
+
m = new ModelBinder({
|
48
|
+
name: 'Variant',
|
49
|
+
id: <%= v.id %>,
|
50
|
+
update_url: '/admin/variants/<%= v.id %>',
|
51
|
+
authenticity_token: '<%= form_authenticity_token %>',
|
52
|
+
attributes: [
|
53
|
+
<% if p.option1 %>{ name: 'option1' , nice_name: <%= raw Caboose.json(p.option1) %> , type: 'text' , align: 'right' , value: <%= raw Caboose.json(v.option1 ) %>, width: 250 },<% end %>
|
54
|
+
<% if p.option2 %>{ name: 'option2' , nice_name: <%= raw Caboose.json(p.option2) %> , type: 'text' , align: 'right' , value: <%= raw Caboose.json(v.option2 ) %>, width: 250 },<% end %>
|
55
|
+
<% if p.option3 %>{ name: 'option3' , nice_name: <%= raw Caboose.json(p.option3) %> , type: 'text' , align: 'right' , value: <%= raw Caboose.json(v.option3 ) %>, width: 250 },<% end %>
|
56
|
+
{ name: 'alternate_id' , nice_name: 'Alternate ID' , type: 'text' , align: 'right' , value: <%= raw Caboose.json(v.alternate_id ) %>, width: 250 },
|
57
|
+
{ name: 'sku' , nice_name: 'SKU' , type: 'text' , align: 'right' , value: <%= raw Caboose.json(v.sku ) %>, width: 250 },
|
58
|
+
{ name: 'barcode' , nice_name: 'Barcode' , type: 'text' , align: 'right' , value: <%= raw Caboose.json(v.barcode ) %>, width: 250 },
|
59
|
+
{ name: 'price' , nice_name: 'Price' , type: 'text' , align: 'right' , value: <%= raw Caboose.json(v.price ) %>, width: 250 },
|
60
|
+
{ name: 'quantity_in_stock' , nice_name: 'Quantity' , type: 'text' , align: 'right' , value: <%= raw Caboose.json(v.quantity_in_stock ) %>, width: 250 },
|
61
|
+
{ name: 'weight' , nice_name: 'Weight (grams)' , type: 'text' , align: 'right' , value: <%= raw Caboose.json(v.weight ) %>, width: 250 },
|
62
|
+
{ name: 'length' , nice_name: 'Length (in)' , type: 'text' , align: 'right' , value: <%= raw Caboose.json(v.length ) %>, width: 250 },
|
63
|
+
{ name: 'width' , nice_name: 'Width (in)' , type: 'text' , align: 'right' , value: <%= raw Caboose.json(v.width ) %>, width: 250 },
|
64
|
+
{ name: 'height' , nice_name: 'Height (in)' , type: 'text' , align: 'right' , value: <%= raw Caboose.json(v.height ) %>, width: 250 },
|
65
|
+
{ name: 'cylinder' , nice_name: 'Cylinder' , type: 'checkbox' , align: 'right' , value: <%= raw Caboose.json(v.cylinder ) %>, width: 250 },
|
66
|
+
{ name: 'requires_shipping' , nice_name: 'Requires shipping' , type: 'checkbox' , align: 'right' , value: <%= raw Caboose.json(v.requires_shipping ) %>, width: 250 },
|
67
|
+
{ name: 'taxable' , nice_name: 'Taxable' , type: 'checkbox' , align: 'right' , value: <%= raw Caboose.json(v.taxable ) %>, width: 250 },
|
68
|
+
{ name: 'allow_backorder' , nice_name: 'Allow backorder' , type: 'checkbox' , align: 'right' , value: <%= raw Caboose.json(v.allow_backorder ) %>, width: 250 },
|
69
|
+
{ name: 'status' , nice_name: 'Status' , type: 'select' , align: 'right' , value: <%= raw Caboose.json(v.status) %>, text: <%= raw Caboose.json(v.status) %>, width: 250, options_url: '/admin/variants/status-options' }
|
70
|
+
]
|
71
|
+
});
|
72
|
+
});
|
73
|
+
|
74
|
+
var modal = false;
|
75
|
+
$(window).load(function() {
|
76
|
+
modal = new CabooseModal(800);
|
77
|
+
});
|
78
|
+
|
79
|
+
</script>
|
80
|
+
<% end %>
|
@@ -0,0 +1,59 @@
|
|
1
|
+
<%
|
2
|
+
p = @product
|
3
|
+
v = @variant
|
4
|
+
%>
|
5
|
+
<%= render :partial => 'caboose_store/products/admin_header' %>
|
6
|
+
|
7
|
+
<div id='variant_<%= v.id %>_sku'></div>
|
8
|
+
<div id='variant_<%= v.id %>_barcode'></div>
|
9
|
+
<div id='variant_<%= v.id %>_price'></div>
|
10
|
+
<div id='variant_<%= v.id %>_quantity_in_stock'></div>
|
11
|
+
<div id='variant_<%= v.id %>_taxable'></div>
|
12
|
+
<div id='variant_<%= v.id %>_requires_shipping'></div>
|
13
|
+
|
14
|
+
<div id='dimensions_container' style='display: hidden;'>
|
15
|
+
<h2>Dimensions</h2>
|
16
|
+
<div id='variant_<%= v.id %>_weight'></div>
|
17
|
+
<div id='variant_<%= v.id %>_length'></div>
|
18
|
+
<div id='variant_<%= v.id %>_width'></div>
|
19
|
+
<div id='variant_<%= v.id %>_height'></div>
|
20
|
+
<div id='variant_<%= v.id %>_cylinder'></div>
|
21
|
+
</div>
|
22
|
+
|
23
|
+
<div id='message'></div>
|
24
|
+
|
25
|
+
<%= render :partial => 'caboose_store/products/admin_footer' %>
|
26
|
+
<% content_for :caboose_js do %>
|
27
|
+
<%= javascript_include_tag "caboose/model/all" %>
|
28
|
+
<%= javascript_include_tag "admin_products" %>
|
29
|
+
<script type='text/javascript'>
|
30
|
+
|
31
|
+
$(document).ready(function() {
|
32
|
+
m = new ModelBinder({
|
33
|
+
name: 'Variant',
|
34
|
+
id: <%= v.id %>,
|
35
|
+
update_url: '/admin/variants/<%= v.id %>',
|
36
|
+
authenticity_token: '<%= form_authenticity_token %>',
|
37
|
+
attributes: [
|
38
|
+
{ name: 'sku' , nice_name: 'SKU' , type: 'text' , align_right: true, value: <%= raw Caboose.json(v.sku ) %>, width: 250 },
|
39
|
+
{ name: 'barcode' , nice_name: 'Barcode' , type: 'text' , align_right: true, value: <%= raw Caboose.json(v.barcode ) %>, width: 250 },
|
40
|
+
{ name: 'price' , nice_name: 'Price' , type: 'text' , align_right: true, value: <%= raw Caboose.json(v.price ) %>, width: 250 },
|
41
|
+
{ name: 'quantity_in_stock' , nice_name: 'Quantity' , type: 'text' , align_right: true, value: <%= raw Caboose.json(v.quantity_in_stock ) %>, width: 250 },
|
42
|
+
{ name: 'weight' , nice_name: 'Weight (grams)' , type: 'text' , align_right: true, value: <%= raw Caboose.json(v.weight ) %>, width: 200 },
|
43
|
+
{ name: 'length' , nice_name: 'Length (in)' , type: 'text' , align_right: true, value: <%= raw Caboose.json(v.length ) %>, width: 200 },
|
44
|
+
{ name: 'width' , nice_name: 'Width (in)' , type: 'text' , align_right: true, value: <%= raw Caboose.json(v.width ) %>, width: 200 },
|
45
|
+
{ name: 'height' , nice_name: 'Height (in)' , type: 'text' , align_right: true, value: <%= raw Caboose.json(v.height ) %>, width: 200 },
|
46
|
+
{ name: 'cylinder' , nice_name: 'Cylinder' , type: 'checkbox' , align_right: true, value: <%= raw Caboose.json(v.cylinder ) %>, width: 200 },
|
47
|
+
{ name: 'requires_shipping' , nice_name: 'Requires shipping' , type: 'checkbox' , align_right: true, value: <%= raw Caboose.json(v.requires_shipping ) %>, width: 250 },
|
48
|
+
{ name: 'taxable' , nice_name: 'Taxable' , type: 'checkbox' , align_right: true, value: <%= raw Caboose.json(v.taxable ) %>, width: 250 }
|
49
|
+
]
|
50
|
+
});
|
51
|
+
});
|
52
|
+
|
53
|
+
var modal = false;
|
54
|
+
$(window).load(function() {
|
55
|
+
modal = new CabooseModal(800);
|
56
|
+
});
|
57
|
+
|
58
|
+
</script>
|
59
|
+
<% end %>
|