synergy_bootstrap_theme 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +4 -0
- data/LICENSE +23 -0
- data/README.md +22 -0
- data/app/controllers/home_controller.rb +8 -0
- data/app/helpers/base_helper_decorator.rb +16 -0
- data/app/helpers/checkout_helper_decorator.rb +69 -0
- data/app/helpers/orders_helper_decorator.rb +5 -0
- data/app/helpers/product_helper_decorator.rb +22 -0
- data/app/helpers/taxons_helper_decorator.rb +7 -0
- data/app/models/image_decorator.rb +3 -0
- data/app/models/product_decorator.rb +7 -0
- data/app/models/taxon_decorator.rb +4 -0
- data/app/views/addresses/_form.html.erb +15 -0
- data/app/views/addresses/edit.html.erb +15 -0
- data/app/views/admin/taxonomies/_list.html.erb +23 -0
- data/app/views/admin/taxonomies/_show_on_homepage_field.html.erb +4 -0
- data/app/views/checkout/_address.html.erb +191 -0
- data/app/views/checkout/_confirm.html.erb +10 -0
- data/app/views/checkout/_delivery.html.erb +22 -0
- data/app/views/checkout/_payment.html.erb +31 -0
- data/app/views/checkout/_summary.html.erb +23 -0
- data/app/views/checkout/edit.html.erb +27 -0
- data/app/views/checkout/registration.html.erb +25 -0
- data/app/views/home/index.html.erb +14 -0
- data/app/views/layouts/spree_application.html.erb +53 -0
- data/app/views/orders/_form.html.erb +19 -0
- data/app/views/orders/_line_item.html.erb +45 -0
- data/app/views/orders/edit.html.erb +53 -0
- data/app/views/products/_cart_form.html.erb +54 -0
- data/app/views/products/_description.html.erb +9 -0
- data/app/views/products/_image.html.erb +21 -0
- data/app/views/products/_properties.html.erb +15 -0
- data/app/views/products/_similar_products.html.erb +21 -0
- data/app/views/products/_thumbnails.html.erb +32 -0
- data/app/views/products/show.html.erb +37 -0
- data/app/views/shared/_breadcrumbs.html.erb +8 -0
- data/app/views/shared/_carousel.html.erb +39 -0
- data/app/views/shared/_error_messages.html.erb +12 -0
- data/app/views/shared/_footer.html.erb +10 -0
- data/app/views/shared/_head.html.erb +13 -0
- data/app/views/shared/_header.html.erb +45 -0
- data/app/views/shared/_login.html.erb +29 -0
- data/app/views/shared/_main_menu.html.erb +35 -0
- data/app/views/shared/_order_details.html.erb +50 -0
- data/app/views/shared/_products.html.erb +50 -0
- data/app/views/shared/_taxonomies.html.erb +26 -0
- data/app/views/shared/_user_form.html.erb +22 -0
- data/app/views/taxons/_taxon.html.erb +10 -0
- data/app/views/taxons/show.html.erb +26 -0
- data/app/views/user_passwords/edit.html.erb +26 -0
- data/app/views/user_passwords/new.html.erb +16 -0
- data/app/views/user_registrations/new.html.erb +17 -0
- data/app/views/user_sessions/new.html.erb +7 -0
- data/app/views/users/_addresses.html.erb +20 -0
- data/app/views/users/edit.html.erb +11 -0
- data/app/views/users/show.html.erb +57 -0
- data/config/initializers/advanced_cart.rb +3 -0
- data/config/initializers/constants.rb +3 -0
- data/config/locales/ru.yml +47 -0
- data/config/routes.rb +4 -0
- data/db/migrate/20110330125354_add_show_on_main_page_flag_to_taxonomies.rb +9 -0
- data/db/migrate/20110404120925_change_column_title_in_reviews.rb +13 -0
- data/db/migrate/20110510080413_revert_changes_column_title_in_reviews.rb +13 -0
- data/lib/synergy_bootstrap_theme.rb +39 -0
- data/lib/synergy_bootstrap_theme_hooks.rb +5 -0
- data/lib/tasks/install.rake +25 -0
- data/public/images/carousel_1.jpg +0 -0
- data/public/images/carousel_2.jpg +0 -0
- data/public/images/carousel_3.jpg +0 -0
- data/public/images/cart.png +0 -0
- data/public/images/glyphicons-halflings-white.png +0 -0
- data/public/images/glyphicons-halflings.png +0 -0
- data/public/images/noimage/taxon.png +0 -0
- data/public/javascripts/application.js +12 -0
- data/public/javascripts/bootstrap-image-gallery.min.js +1 -0
- data/public/javascripts/bootstrap.min.js +6 -0
- data/public/javascripts/jquery.min.js +4 -0
- data/public/javascripts/load-image.min.js +1 -0
- data/public/javascripts/rails.js +377 -0
- data/public/stylesheets/bootstrap-image-gallery.min.css +21 -0
- data/public/stylesheets/bootstrap.min.css +689 -0
- data/public/stylesheets/main.css +166 -0
- data/synergy_bootstrap_theme.gemspec +21 -0
- metadata +139 -0
data/.gitignore
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
Redistribution and use in source and binary forms, with or without modification,
|
2
|
+
are permitted provided that the following conditions are met:
|
3
|
+
|
4
|
+
* Redistributions of source code must retain the above copyright notice,
|
5
|
+
this list of conditions and the following disclaimer.
|
6
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
7
|
+
this list of conditions and the following disclaimer in the documentation
|
8
|
+
and/or other materials provided with the distribution.
|
9
|
+
* Neither the name of the Rails Dog LLC nor the names of its
|
10
|
+
contributors may be used to endorse or promote products derived from this
|
11
|
+
software without specific prior written permission.
|
12
|
+
|
13
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
14
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
15
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
16
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
17
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
18
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
19
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
20
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
21
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
22
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
23
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/README.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Synerge Bootstrap Theme
|
2
|
+
-----------------------
|
3
|
+
|
4
|
+
Тема для [synergy] c использованием [twitter bootstrap]. Замена для [synergy default theme].
|
5
|
+
|
6
|
+
Зависимости
|
7
|
+
-----------
|
8
|
+
|
9
|
+
Работает с synergy 0.60
|
10
|
+
|
11
|
+
Установка
|
12
|
+
---------
|
13
|
+
|
14
|
+
Добавьте в Gemfile:
|
15
|
+
`gem 'synergy_bootstrap_theme'`
|
16
|
+
|
17
|
+
Выполните команды:
|
18
|
+
`rake synergy_bootstrap_theme:install db:migrate`
|
19
|
+
|
20
|
+
[synergy]: https://github.com/secoint/synergy
|
21
|
+
[twitter bootstrap]: https://github.com/twitter/bootstrap
|
22
|
+
[synergy default theme]: https://github.com/romul/synergy_default_theme
|
@@ -0,0 +1,16 @@
|
|
1
|
+
Spree::BaseHelper.module_eval do
|
2
|
+
def link_to_cart(text = t('cart'))
|
3
|
+
item_count = (current_order.nil? or current_order.line_items.empty?) ? 0 : current_order.item_count
|
4
|
+
text = "<h4>#{text} <span class=\"badge badge-info\">#{item_count}</span></h4>"
|
5
|
+
|
6
|
+
link_to text.html_safe, cart_path
|
7
|
+
end
|
8
|
+
|
9
|
+
# Outputs the corresponding flash message if any are set
|
10
|
+
def flash_messages
|
11
|
+
bootstrap_class = {"notice" => "alert alert-success", "error" => "alert alert-error", "warning" => "alert"}
|
12
|
+
bootstrap_class.keys.map do |msg|
|
13
|
+
content_tag(:div, ("<a class=\"close\" data-dismiss=\"alert\">×</a>".html_safe + flash.delete(msg.to_sym).html_safe), {:class => bootstrap_class[msg]}) unless flash[msg.to_sym].blank?
|
14
|
+
end.join("\n").html_safe
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
CheckoutHelper.module_eval do
|
2
|
+
|
3
|
+
def checkout_states
|
4
|
+
%w(address delivery payment confirm)
|
5
|
+
end
|
6
|
+
|
7
|
+
# TODO: this can be deleted from extension after Spree 0.70.0 release
|
8
|
+
def checkout_progress
|
9
|
+
states = checkout_states
|
10
|
+
items = states.map do |state|
|
11
|
+
css_class = "empty"
|
12
|
+
current_index = states.index(@order.state)
|
13
|
+
state_index = states.index(state)
|
14
|
+
|
15
|
+
text = t("order_state.#{state}").titleize
|
16
|
+
link = link_to "#{state_index + 1}. #{text}", checkout_state_path(state)
|
17
|
+
|
18
|
+
if state == @order.state
|
19
|
+
link = link_to "#{state_index + 1}. #{text}", "#"
|
20
|
+
css_class = 'active'
|
21
|
+
end
|
22
|
+
|
23
|
+
content_tag('li', link, :class => css_class) if state_index <= current_index
|
24
|
+
end
|
25
|
+
content_tag('ul', raw(items.join("\n")), :class => 'nav nav-tabs checkout_states', :id => "checkout-step-#{@order.state}")
|
26
|
+
end
|
27
|
+
|
28
|
+
|
29
|
+
def address_field(form, method, id_prefix = "b", &handler)
|
30
|
+
if handler
|
31
|
+
handler.call
|
32
|
+
else
|
33
|
+
label = form.label(method, :class => "control-label")
|
34
|
+
field = content_tag :div, :class => "controls" do
|
35
|
+
form.text_field(method)
|
36
|
+
end
|
37
|
+
label + field
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def address_state(form, country)
|
42
|
+
country ||= Country.find(Spree::Config[:default_country_id])
|
43
|
+
have_states = !country.states.empty?
|
44
|
+
state_elements = [
|
45
|
+
form.collection_select(:state_id, country.states.order(:name),
|
46
|
+
:id, :name,
|
47
|
+
{:include_blank => true},
|
48
|
+
{:style => have_states ? "" : "display:none",
|
49
|
+
:disabled => !have_states}) +
|
50
|
+
form.text_field(:state_name,
|
51
|
+
:style => !have_states ? "" : "display:none",
|
52
|
+
:disabled => have_states)
|
53
|
+
].join.gsub('"', "'").gsub("\n", "")
|
54
|
+
|
55
|
+
content_tag :div, :class => "control-group" do
|
56
|
+
label = form.label(:state, t(:state), :class => "control-label")
|
57
|
+
field = content_tag :div, :class => "controls" do
|
58
|
+
content_tag(:noscript, form.text_field(:state_name, :class => 'required')) +
|
59
|
+
javascript_tag("document.write(\"#{state_elements.html_safe}\");")
|
60
|
+
end
|
61
|
+
label + field
|
62
|
+
end
|
63
|
+
|
64
|
+
|
65
|
+
end
|
66
|
+
|
67
|
+
|
68
|
+
end
|
69
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
ProductsHelper.module_eval do
|
2
|
+
def variant_price_diff(variant)
|
3
|
+
return product_price(variant) unless variant.product.master.price
|
4
|
+
diff = product_price(variant, :format_as_currency => false) - product_price(variant.product, :format_as_currency => false)
|
5
|
+
return nil if diff == 0
|
6
|
+
if diff > 0
|
7
|
+
"(+ #{format_price diff.abs})"
|
8
|
+
else
|
9
|
+
"(- #{format_price diff.abs})"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def product_description(product)
|
14
|
+
raw(product.description)
|
15
|
+
end
|
16
|
+
|
17
|
+
def large_sizes
|
18
|
+
return @large_sizes if @large_sizes
|
19
|
+
match = Image.attachment_definitions[:attachment][:styles][:large].match(/(\d+)x(\d+)/)
|
20
|
+
@large_sizes = {:width => match[1], :height => match[2]}
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<% ADDRESS_FIELDS.each do |field| %>
|
2
|
+
<div id="<%= [address_name, field].join('_') %>" class="control-group">
|
3
|
+
<% if field == "country" %>
|
4
|
+
<%= address_form.label :country_id, t(field, :scope => [:activerecord, :attributes, :address]), :class => "control-label" %>
|
5
|
+
<div class="controls"><%= address_form.collection_select :country_id, available_countries, :id, :name, {}, {:class => 'required'} %></div>
|
6
|
+
<% elsif field == "state" && Spree::Config[:address_requires_state] %>
|
7
|
+
<%= address_field(address_form, :state, address_name) { address_state(address_form, address.country) } %>
|
8
|
+
<% else %>
|
9
|
+
<%= address_field(address_form, field.to_sym, address_name) %>
|
10
|
+
<% end %>
|
11
|
+
</div>
|
12
|
+
<% end %>
|
13
|
+
<% if Spree::Config["alternative_#{address_name}_phone"] %>
|
14
|
+
<%= address_field(address_form, :alternative_phone, address_name) %>
|
15
|
+
<% end %>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<%= form_for @address, :html => {:class => "form-horizontal"} do |f| %>
|
2
|
+
<legend><%= t(:edit_address) %></legend>
|
3
|
+
<fieldset>
|
4
|
+
<div class="inner">
|
5
|
+
<%= render :partial => 'addresses/form', :locals => {
|
6
|
+
:address_name => 'address',
|
7
|
+
:address_form => f,
|
8
|
+
:address => @address
|
9
|
+
} %>
|
10
|
+
</div>
|
11
|
+
<div class="form-actions">
|
12
|
+
<%= f.submit t(:update), :disable_with => t(:wait), :class => "btn btn-primary" %>
|
13
|
+
</div>
|
14
|
+
</fieldset>
|
15
|
+
<% end %>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<table class="index">
|
2
|
+
<tr>
|
3
|
+
<th><%= t('name') %></th>
|
4
|
+
<% if defined?(SpreeCompareProducts) %>
|
5
|
+
<th><%= t('compare_products.comparable_container') %></th>
|
6
|
+
<% end %>
|
7
|
+
<th><%= t('activerecord.attributes.taxonomy.show_on_homepage').capitalize %></th>
|
8
|
+
<th></th>
|
9
|
+
</tr>
|
10
|
+
|
11
|
+
<% for taxonomy in @taxonomies %>
|
12
|
+
<tr id="<%= dom_id taxonomy %>">
|
13
|
+
<td><%= taxonomy.name %></td>
|
14
|
+
<% if defined?(SpreeCompareProducts) %>
|
15
|
+
<td><%= icon('tick') if taxonomy.comparable? %></td>
|
16
|
+
<% end %>
|
17
|
+
<td><%= icon('tick') if taxonomy.show_on_homepage? %></td>
|
18
|
+
<td class="actions">
|
19
|
+
<%= link_to_edit taxonomy.id %> <%= link_to_delete taxonomy %>
|
20
|
+
</td>
|
21
|
+
</tr>
|
22
|
+
<% end %>
|
23
|
+
</table>
|
@@ -0,0 +1,191 @@
|
|
1
|
+
<style>
|
2
|
+
div.inner input[type=text], div.inner select { width: 80%; }
|
3
|
+
.hidden { display: none; }
|
4
|
+
</style>
|
5
|
+
<fieldset id='billing'>
|
6
|
+
<%= form.fields_for :bill_address, :html => {:class => "form-horizontal"} do |bill_form| %>
|
7
|
+
<legend><%= t("shipping_address")%></legend>
|
8
|
+
|
9
|
+
<div class="control-group">
|
10
|
+
<%= bill_form.label :firstname, t(:first_name), :class => "control-label" %>
|
11
|
+
<div class="controls">
|
12
|
+
<%= bill_form.text_field :firstname %>
|
13
|
+
</div>
|
14
|
+
</div>
|
15
|
+
|
16
|
+
<div class="control-group">
|
17
|
+
<%= bill_form.label :lastname, t(:last_name), :class => "control-label" %>
|
18
|
+
<div class="controls">
|
19
|
+
<%= bill_form.text_field :lastname %>
|
20
|
+
</div>
|
21
|
+
</div>
|
22
|
+
|
23
|
+
<div class="control-group">
|
24
|
+
<%= bill_form.label :address1, t(:street_address), :class => "control-label" %>
|
25
|
+
<div class="controls">
|
26
|
+
<%= bill_form.text_field :address1 %>
|
27
|
+
</div>
|
28
|
+
</div>
|
29
|
+
|
30
|
+
<div class="control-group">
|
31
|
+
<%= bill_form.label :address2, t(:street_address_2), :class => "control-label" %>
|
32
|
+
<div class="controls">
|
33
|
+
<%= bill_form.text_field :address2 %>
|
34
|
+
</div>
|
35
|
+
</div>
|
36
|
+
|
37
|
+
<div class="control-group">
|
38
|
+
<%= bill_form.label :city, t(:city), :class => "control-label" %>
|
39
|
+
<div class="controls">
|
40
|
+
<%= bill_form.text_field :city %>
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
|
44
|
+
<% if Spree::Config[:address_requires_state] %>
|
45
|
+
<div class="control-group">
|
46
|
+
<%= bill_form.label :state, t(:state), :class => "control-label" %>
|
47
|
+
<div class="controls">
|
48
|
+
<% have_states = !@order.bill_address.country.states.empty? %>
|
49
|
+
<noscript>
|
50
|
+
<%= bill_form.text_field :state_name, :class => 'required' %>
|
51
|
+
</noscript>
|
52
|
+
<% state_elements = [
|
53
|
+
bill_form.collection_select(:state_id, @order.bill_address.country.states,
|
54
|
+
:id, :name,
|
55
|
+
{:include_blank => true},
|
56
|
+
{:style => have_states ? "" : "display:none",
|
57
|
+
:disabled => !have_states}) +
|
58
|
+
bill_form.text_field(:state_name,
|
59
|
+
:style => !have_states ? "" : "display:none",
|
60
|
+
:disabled => have_states)
|
61
|
+
].join.gsub('"', "'").gsub("\n", "")
|
62
|
+
%>
|
63
|
+
<script type="text/javascript" language="javascript" charset="utf-8">
|
64
|
+
// <![CDATA[
|
65
|
+
document.write("<%== state_elements %>");
|
66
|
+
// ]]>
|
67
|
+
</script>
|
68
|
+
</div>
|
69
|
+
</div>
|
70
|
+
<% end %>
|
71
|
+
|
72
|
+
<div class="control-group">
|
73
|
+
<%= bill_form.label :zipcode, t(:zip), :class => "control-label" %>
|
74
|
+
<div class="controls">
|
75
|
+
<%= bill_form.text_field :zipcode %>
|
76
|
+
</div>
|
77
|
+
</div>
|
78
|
+
|
79
|
+
<div class="control-group">
|
80
|
+
<%= bill_form.label :country_id, t(:country), :class => "control-label" %>
|
81
|
+
<div class="controls">
|
82
|
+
<%= bill_form.collection_select :country_id, available_countries, :id, :name, {}, {:class => 'required'} %>
|
83
|
+
</div>
|
84
|
+
</div>
|
85
|
+
|
86
|
+
<div class="control-group">
|
87
|
+
<%= bill_form.label :phone, t(:phone), :class => "control-label" %>
|
88
|
+
<div class="controls">
|
89
|
+
<%= bill_form.text_field :phone %>
|
90
|
+
</div>
|
91
|
+
</div>
|
92
|
+
|
93
|
+
<% if Spree::Config[:alternative_billing_phone] %>
|
94
|
+
<div class="control-group">
|
95
|
+
<%= bill_form.label :alternative_phone, t(:alternative_phone), :class => "control-label" %>
|
96
|
+
<div class="controls">
|
97
|
+
<%= bill_form.text_field :alternative_phone %>
|
98
|
+
</div>
|
99
|
+
</div>
|
100
|
+
<% end %>
|
101
|
+
|
102
|
+
<% end %>
|
103
|
+
</fieldset>
|
104
|
+
|
105
|
+
<% #платежный адрес и адрес доставки один и тот же, кому нужны отдельные поля - делайте сами :)
|
106
|
+
%>
|
107
|
+
<div style="display:none">
|
108
|
+
<fieldset id='shipping'>
|
109
|
+
<%= form.fields_for :ship_address do |ship_form| %>
|
110
|
+
<legend><%= t("shipping_address")%></legend>
|
111
|
+
<p class="field checkbox">
|
112
|
+
<label for="order_use_billing" id="use_billing">
|
113
|
+
<%= check_box_tag 'order[use_billing]', '1', (!(@order.bill_address.empty? && @order.ship_address.empty?) && @order.bill_address.eql?(@order.ship_address)), :checked => true %> <%= t("use_billing_address") %>
|
114
|
+
</label>
|
115
|
+
</p>
|
116
|
+
<div class="inner">
|
117
|
+
<p id="sfname" class="field">
|
118
|
+
<%= ship_form.label :firstname, t(:first_name) %>
|
119
|
+
<%= ship_form.text_field :firstname, :class => 'required' %><span class="req">*</span>
|
120
|
+
</p>
|
121
|
+
<p id="slname" class="field">
|
122
|
+
<%= ship_form.label :lastname, t(:last_name) %>
|
123
|
+
<%= ship_form.text_field :lastname, :class => 'required' %><span class="req">*</span>
|
124
|
+
</p>
|
125
|
+
<p id="saddress" class="field">
|
126
|
+
<%= ship_form.label :address1, t(:street_address) %>
|
127
|
+
<%= ship_form.text_field :address1, :class => 'required' %><span class="req">*</span>
|
128
|
+
</p>
|
129
|
+
<p id="saddress2" class="field">
|
130
|
+
<%= ship_form.label :address2, t(:street_address_2) %>
|
131
|
+
<%= ship_form.text_field :address2 %>
|
132
|
+
</p>
|
133
|
+
<p id="scity" class="field">
|
134
|
+
<%= ship_form.label :city, t(:city) %>
|
135
|
+
<%= ship_form.text_field :city, :class => 'required' %><span class="req">*</span>
|
136
|
+
</p>
|
137
|
+
<% if Spree::Config[:address_requires_state] %>
|
138
|
+
<p class="field">
|
139
|
+
<span id="sstate">
|
140
|
+
<% have_states = !@order.ship_address.country.states.empty? %>
|
141
|
+
<%= ship_form.label :state, t(:state) %>
|
142
|
+
<noscript>
|
143
|
+
<%= ship_form.text_field :state_name, :class => 'required' %>
|
144
|
+
</noscript>
|
145
|
+
<% state_elements = [
|
146
|
+
ship_form.collection_select(:state_id, @order.bill_address.country.states,
|
147
|
+
:id, :name,
|
148
|
+
{:include_blank => true},
|
149
|
+
{:class => have_states ? "required" : "hidden",
|
150
|
+
:disabled => !have_states}) +
|
151
|
+
ship_form.text_field(:state_name,
|
152
|
+
:class => !have_states ? "required" : "hidden",
|
153
|
+
:disabled => have_states)
|
154
|
+
].join.gsub('"', "'").gsub("\n", "")
|
155
|
+
%>
|
156
|
+
<script type="text/javascript" language="javascript" charset="utf-8">
|
157
|
+
// <![CDATA[
|
158
|
+
document.write("<%== state_elements %>");
|
159
|
+
// ]]>
|
160
|
+
</script>
|
161
|
+
</span>
|
162
|
+
<span class="req">*</span>
|
163
|
+
</p>
|
164
|
+
<% end %>
|
165
|
+
<p id="szip" class="field">
|
166
|
+
<%= ship_form.label :zipcode, t(:zip) %>
|
167
|
+
<%= ship_form.text_field :zipcode, :class => 'required' %><span class="req">*</span>
|
168
|
+
</p>
|
169
|
+
<p id="scountry" class="field">
|
170
|
+
<%= ship_form.label :country_id, t(:country) %>
|
171
|
+
<span id="scountry"><%= ship_form.collection_select :country_id, available_countries, :id, :name, {}, {:class => 'required'} %></span>
|
172
|
+
<span class="req">*</span>
|
173
|
+
</p>
|
174
|
+
<p id="sphone" class="field">
|
175
|
+
<%= ship_form.label :phone, t(:phone) %>
|
176
|
+
<%= ship_form.text_field :phone, :class => 'required' %><span class="req">*</span>
|
177
|
+
</p>
|
178
|
+
<% if Spree::Config[:alternative_shipping_phone] %>
|
179
|
+
<p id="saltphone">
|
180
|
+
<%= ship_form.label :alternative_phone, t(:alternative_phone) %>
|
181
|
+
<%= ship_form.text_field :alternative_phone %>
|
182
|
+
</p>
|
183
|
+
<% end %>
|
184
|
+
</div>
|
185
|
+
<% end %>
|
186
|
+
</fieldset>
|
187
|
+
</div>
|
188
|
+
|
189
|
+
<div class="form-actions">
|
190
|
+
<button type="submit" class="btn btn-primary" data-disable-with="<%= t(:wait) %>"><%=t("save_and_continue") %></button>
|
191
|
+
</div>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<fieldset id="order_details">
|
2
|
+
<div class="clear"></div>
|
3
|
+
<legend><%= t(@order.state, :scope => :order_state).titleize %></legend>
|
4
|
+
<%= render :partial => 'shared/order_details', :locals => {:order => @order} %>
|
5
|
+
</fieldset>
|
6
|
+
|
7
|
+
|
8
|
+
<div class="form-actions">
|
9
|
+
<input type="submit" class="btn btn-primary" value="<%=t("place_order") %>" data-disable-with="<%= t(:wait) %>"/>
|
10
|
+
</div>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<fieldset id='shipping_method'>
|
2
|
+
|
3
|
+
<div class="control-group">
|
4
|
+
<label class="control-label"><%= t("shipping_method") %></label>
|
5
|
+
<div class="controls">
|
6
|
+
|
7
|
+
<% @order.rate_hash.each do |shipping_method| %>
|
8
|
+
<label class="radio">
|
9
|
+
<%= radio_button(:order, :shipping_method_id, shipping_method[:id]) %>
|
10
|
+
<%= shipping_method[:name] %> <%= number_to_currency shipping_method[:cost] %>
|
11
|
+
</label><br />
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
|
17
|
+
</fieldset>
|
18
|
+
|
19
|
+
|
20
|
+
<div class="form-actions">
|
21
|
+
<input type="submit" class="btn btn-primary" value="<%=t("save_and_continue") %>" data-disable-with="<%= t(:wait) %>"/>
|
22
|
+
</div>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<fieldset id="payment">
|
2
|
+
<legend><%= t("payment_information") %></legend>
|
3
|
+
<%= hook :checkout_payment_step, {:form => form} do %>
|
4
|
+
<% @order.available_payment_methods.each do |method| %>
|
5
|
+
<p>
|
6
|
+
<label>
|
7
|
+
<%= radio_button_tag "order[payments_attributes][][payment_method_id]", method.id, method == @order.payment_method %>
|
8
|
+
<%= t(method.name, :scope => :payment_methods, :default => method.name) %>
|
9
|
+
</label>
|
10
|
+
</p>
|
11
|
+
<% end %>
|
12
|
+
|
13
|
+
<ul id="payment-methods">
|
14
|
+
<% @order.available_payment_methods.each do |method| %>
|
15
|
+
<li id="payment_method_<%= method.id %>"<%= ' class="last"' if method == @order.available_payment_methods.last %>>
|
16
|
+
<fieldset>
|
17
|
+
<%= render "checkout/payment/#{method.method_type}", :payment_method => method %>
|
18
|
+
</fieldset>
|
19
|
+
</li>
|
20
|
+
<% end %>
|
21
|
+
</ul>
|
22
|
+
<br style='clear:both;' />
|
23
|
+
<%= hook :coupon_code_field, {:form => form} %>
|
24
|
+
<% end %>
|
25
|
+
</fieldset>
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
<div class="form-actions">
|
30
|
+
<input type="submit" class="btn btn-primary" value="<%=t("save_and_continue") %>" data-disable-with="<%= t(:wait) %>"/>
|
31
|
+
</div>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<div class="well">
|
2
|
+
<h3><%= t(:order_summary) %></h3>
|
3
|
+
<table class="table table-bordered">
|
4
|
+
<tbody>
|
5
|
+
<tr>
|
6
|
+
<td><strong><%= t('item_total') %>:</strong></td>
|
7
|
+
<td><strong><%= number_to_currency order.item_total %></strong></td>
|
8
|
+
</tr>
|
9
|
+
<tbody id="summary-order-charges">
|
10
|
+
<% order.adjustments.each do |adjustment| %>
|
11
|
+
<tr>
|
12
|
+
<td><%= adjustment.label %>:</td>
|
13
|
+
<td><%= number_to_currency adjustment.amount %></td>
|
14
|
+
</tr>
|
15
|
+
<% end %>
|
16
|
+
</tbody>
|
17
|
+
<tr>
|
18
|
+
<td><strong><%= t('order_total') %>:</strong></td>
|
19
|
+
<td><strong><span id='summary-order-total'><%= number_to_currency @order.total %></span></strong></td>
|
20
|
+
</tr>
|
21
|
+
</tbody>
|
22
|
+
</table>
|
23
|
+
</div>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<% content_for :head do %>
|
2
|
+
<%= javascript_include_tag 'checkout', '/states' %>
|
3
|
+
<% end %>
|
4
|
+
|
5
|
+
<div id="checkout" class='row'>
|
6
|
+
|
7
|
+
<div class="span8">
|
8
|
+
<h2><%= t("checkout")%></h2><br>
|
9
|
+
<%= checkout_progress %>
|
10
|
+
<%= render "shared/error_messages", :target => @order %>
|
11
|
+
<%= form_for @order, :url => update_checkout_path(@order.state), :html => {:id => "checkout_form_#{@order.state}", :class => "form-horizontal"} do |form| %>
|
12
|
+
<%= render @order.state, :form => form %>
|
13
|
+
<input id="post-final" type="submit" style="display:none"/>
|
14
|
+
<% end %>
|
15
|
+
</div>
|
16
|
+
|
17
|
+
<div class="span4">
|
18
|
+
<%= hook :checkout_summary_box do %>
|
19
|
+
<% if @order.state != 'confirm' %>
|
20
|
+
<div id="checkout-summary" class=" pull-right">
|
21
|
+
<%= render 'summary', :order => @order %>
|
22
|
+
</div>
|
23
|
+
<% end %>
|
24
|
+
<% end %>
|
25
|
+
</div>
|
26
|
+
|
27
|
+
</div>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<%= render "shared/error_messages", :target => @user %>
|
2
|
+
<div id="registration" class="row">
|
3
|
+
<% if Spree::Config[:allow_guest_checkout] %>
|
4
|
+
<div id="guest_checkout" class="span5">
|
5
|
+
<%= render "shared/error_messages", :target => @order %>
|
6
|
+
<%= form_for @order, :url => update_checkout_registration_path, :html => {:method => :put, :id => "checkout_form_registration"} do |f| %>
|
7
|
+
<fieldset>
|
8
|
+
<legend><%= t(:guest_user_account) %></legend>
|
9
|
+
<div class="control-group">
|
10
|
+
<%= f.label(:email, t("email"), :class => "control-label") %>
|
11
|
+
<div class="controls">
|
12
|
+
<%= f.text_field :email %>
|
13
|
+
</div>
|
14
|
+
</div>
|
15
|
+
|
16
|
+
<%= submit_tag t("continue"), :disable_with => t(:wait), :class => 'submit btn btn-primary' %>
|
17
|
+
</fieldset>
|
18
|
+
<% end %>
|
19
|
+
</div>
|
20
|
+
<% end %>
|
21
|
+
|
22
|
+
<div id="account" class="span7">
|
23
|
+
<%= render "shared/login" %>
|
24
|
+
</div>
|
25
|
+
</div>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<% content_for :sidebar do %>
|
2
|
+
<%= render "shared/taxonomies" %>
|
3
|
+
<% end %>
|
4
|
+
|
5
|
+
<%= render :partial => "shared/carousel" %>
|
6
|
+
|
7
|
+
|
8
|
+
<% @taxons.each do |taxon| %>
|
9
|
+
<div class="taxon">
|
10
|
+
<h2><%= taxon.name %></h2>
|
11
|
+
|
12
|
+
<%= render :partial => "shared/products", :locals => {:products => taxon_preview(taxon, 6), :taxon => taxon} %>
|
13
|
+
</div>
|
14
|
+
<% end %>
|