spree 0.6.0 → 0.7.0
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/CHANGELOG +30 -0
- data/CONTRIBUTORS +38 -20
- data/app/controllers/admin/creditcard_payments_controller.rb +10 -3
- data/app/controllers/admin/orders_controller.rb +17 -16
- data/app/controllers/admin/products_controller.rb +12 -14
- data/app/controllers/admin/reports_controller.rb +12 -14
- data/app/controllers/admin/users_controller.rb +10 -5
- data/app/controllers/admin/zones_controller.rb +4 -1
- data/app/controllers/application.rb +0 -1
- data/app/controllers/checkout_controller.rb +96 -0
- data/app/controllers/content_controller.rb +11 -1
- data/app/controllers/orders_controller.rb +12 -33
- data/app/controllers/products_controller.rb +12 -7
- data/app/controllers/spree/base_controller.rb +1 -1
- data/app/controllers/states_controller.rb +14 -2
- data/app/controllers/taxons_controller.rb +6 -2
- data/app/controllers/users_controller.rb +9 -6
- data/app/helpers/application_helper.rb +1 -11
- data/app/helpers/products_helper.rb +3 -1
- data/app/helpers/spree/base_helper.rb +0 -26
- data/app/models/address.rb +3 -3
- data/app/models/app_configuration.rb +1 -0
- data/app/models/country.rb +4 -0
- data/app/models/creditcard.rb +6 -1
- data/app/models/creditcard_payment.rb +1 -1
- data/app/models/inventory_unit.rb +4 -1
- data/app/models/order.rb +37 -21
- data/app/models/product.rb +19 -8
- data/{vendor/extensions/shipping/app → app}/models/shipment.rb +20 -4
- data/{vendor/extensions/shipping/app → app}/models/shipping_category.rb +0 -0
- data/{vendor/extensions/shipping/app → app}/models/shipping_method.rb +6 -4
- data/app/models/state.rb +5 -0
- data/app/models/user.rb +4 -2
- data/app/models/variant.rb +19 -1
- data/app/presenters/checkout_presenter.rb +58 -0
- data/app/views/admin/creditcard_payments/edit.html.erb +1 -1
- data/app/views/admin/option_types/available.html.erb +1 -1
- data/app/views/admin/orders/index.html.erb +28 -18
- data/app/views/admin/orders/show.html.erb +1 -1
- data/app/views/admin/payments/index.html.erb +1 -1
- data/app/views/admin/products/_images.html.erb +1 -1
- data/app/views/admin/products/index.html.erb +17 -13
- data/app/views/admin/users/index.html.erb +8 -8
- data/app/views/admin/zones/index.html.erb +5 -2
- data/app/views/checkout/_form.html.erb +165 -0
- data/app/views/{creditcards → checkout}/cvv.html.erb +1 -1
- data/app/views/checkout/new.html.erb +6 -0
- data/app/views/layouts/admin.html.erb +2 -3
- data/app/views/layouts/application.html.erb +1 -1
- data/app/views/orders/_form.html.erb +6 -4
- data/app/views/orders/_google_order.html.erb +24 -0
- data/app/views/orders/_line_item.html.erb +2 -1
- data/app/views/orders/show.html.erb +4 -1
- data/app/views/products/index.html.erb +2 -1
- data/app/views/products/show.html.erb +4 -4
- data/app/views/shared/_footer.html.erb +12 -1
- data/app/views/shared/_login.html.erb +1 -1
- data/app/views/shared/_order_details.html.erb +8 -9
- data/app/views/shared/_products.html.erb +1 -1
- data/app/views/shared/_report_criteria.html.erb +28 -28
- data/app/views/states/index.js.erb +10 -1
- data/config/environment.rb +10 -4
- data/config/initializers/searchlogic.rb +6 -0
- data/config/locales/de.yml +14 -0
- data/config/locales/en-GB.yml +20 -6
- data/config/locales/en-US.yml +20 -4
- data/config/locales/es.yml +14 -0
- data/config/locales/fr-FR.yml +463 -0
- data/config/locales/fr-FR_rails.yml +115 -0
- data/config/locales/it.yml +14 -0
- data/config/locales/nb-NO.yml +457 -0
- data/config/locales/nb-NO_rails.yml +105 -0
- data/config/locales/pl.yml +14 -0
- data/config/locales/pt-BR.yml +14 -0
- data/config/locales/pt-PT.yml +14 -0
- data/config/locales/ru-RU.yml +458 -0
- data/config/locales/ru-RU_rails.yml +154 -0
- data/config/routes.rb +11 -4
- data/db/migrate/20090204200045_add_order_permalink.rb +13 -0
- data/db/migrate/20090225231119_add_more_needed_keys_items_and_conf.rb +19 -0
- data/db/migrate/20090302221152_give_all_users_user_role.rb +13 -0
- data/db/sample/orders.yml +1 -1
- data/lib/generators/instance/instance_generator.rb +1 -1
- data/lib/spree.rb +1 -1
- data/lib/spree/setup.rb +1 -1
- data/lib/tasks/database.rake +5 -2
- data/lib/tasks/release.rake +1 -1
- data/lib/tasks/upgrade.rake +11 -0
- data/public/assets/products/1009/mini/sean.jpg +0 -0
- data/public/assets/products/1009/original/sean.jpg +0 -0
- data/public/assets/products/1009/product/sean.jpg +0 -0
- data/public/assets/products/1009/small/sean.jpg +0 -0
- data/public/images/ajax_loader.gif +0 -0
- data/public/javascripts/checkout.js +284 -0
- data/public/javascripts/jquery-1.3.2.min.js +19 -0
- data/public/javascripts/jquery.validate.pack.js +15 -0
- data/public/stylesheets/checkout.css +25 -0
- data/public/stylesheets/spree-admin.css +6 -2
- data/public/stylesheets/spree.css +419 -432
- data/spec/controllers/countries_controller_spec.rb +3 -2
- data/spec/controllers/orders_controller_spec.rb +7 -5
- data/spec/controllers/states_controller_spec.rb +4 -2
- data/spec/models/creditcard_payment_spec.rb +6 -2
- data/spec/models/order_spec.rb +164 -157
- data/spec/models/product_spec.rb +2 -2
- data/vendor/extensions/payment_gateway/db/migrate/20090218091936_create_protx_gateway.rb +18 -0
- data/vendor/extensions/payment_gateway/lib/spree/payment_gateway.rb +7 -5
- data/vendor/extensions/shipping/app/controllers/admin/shipments_controller.rb +6 -5
- data/vendor/extensions/shipping/app/views/admin/shipments/index.html.erb +1 -1
- data/vendor/extensions/shipping/config/locales/nb-NO.yml +25 -0
- data/vendor/extensions/shipping/config/locales/ru-RU.yml +25 -0
- data/vendor/extensions/shipping/db/sample/shipping_methods.yml +5 -1
- data/vendor/extensions/shipping/db/sample/zone_members.yml +9 -1
- data/vendor/extensions/shipping/db/sample/zones.yml +4 -1
- data/vendor/extensions/shipping/lib/spree/shipping_calculator.rb +0 -16
- data/vendor/extensions/shipping/shipping_extension.rb +0 -15
- data/vendor/extensions/shipping/spec/models/shipping_method_spec.rb +16 -10
- data/vendor/extensions/shipping/spec/models/shipping_order_spec.rb +3 -17
- data/vendor/extensions/tax_calculator/config/locales/nb-NO.yml +30 -0
- data/vendor/extensions/tax_calculator/spec/models/{order_spec.rb → order_tax_calc_spec.rb} +2 -2
- data/vendor/gems/{active_presenter-0.0.4 → active_presenter-0.0.6}/.specification +3 -5
- data/vendor/gems/{active_presenter-0.0.4 → active_presenter-0.0.6}/LICENSE +0 -0
- data/vendor/gems/{active_presenter-0.0.4 → active_presenter-0.0.6}/README +9 -2
- data/vendor/gems/{active_presenter-0.0.4 → active_presenter-0.0.6}/Rakefile +0 -0
- data/vendor/gems/{active_presenter-0.0.4 → active_presenter-0.0.6}/lib/active_presenter.rb +0 -0
- data/vendor/gems/{active_presenter-0.0.4 → active_presenter-0.0.6}/lib/active_presenter/base.rb +38 -8
- data/vendor/gems/{active_presenter-0.0.4 → active_presenter-0.0.6}/lib/active_presenter/version.rb +1 -1
- data/vendor/gems/{active_presenter-0.0.4 → active_presenter-0.0.6}/lib/tasks/doc.rake +0 -0
- data/vendor/gems/{active_presenter-0.0.4 → active_presenter-0.0.6}/lib/tasks/gem.rake +0 -0
- data/vendor/gems/{active_presenter-0.0.4 → active_presenter-0.0.6}/test/base_test.rb +66 -30
- data/vendor/gems/{active_presenter-0.0.4 → active_presenter-0.0.6}/test/test_helper.rb +36 -0
- data/vendor/plugins/attribute_fu/lib/attribute_fu/associated_form_helper.rb +12 -4
- data/vendor/plugins/find_by_param/MIT-LICENSE +1 -1
- data/vendor/plugins/find_by_param/{README → README.markdown} +7 -1
- data/vendor/plugins/find_by_param/init.rb +0 -1
- data/vendor/plugins/find_by_param/lib/find_by_param.rb +23 -87
- data/vendor/plugins/find_by_param/test/find_by_param_test.rb +22 -8
- data/vendor/plugins/find_by_param/test/test_helper.rb +0 -1
- metadata +65 -193
- data/app/controllers/creditcards_controller.rb +0 -73
- data/app/models/order_filter.rb +0 -28
- data/app/models/user_filter.rb +0 -6
- data/app/views/creditcards/_form_credit_card.html.erb +0 -30
- data/app/views/creditcards/new.html.erb +0 -25
- data/app/views/shared/_paginate.html.erb +0 -34
- data/lib/plugins/paginating_find/CHANGELOG +0 -120
- data/lib/plugins/paginating_find/README +0 -89
- data/lib/plugins/paginating_find/init.rb +0 -2
- data/lib/plugins/paginating_find/lib/paginating_find.rb +0 -138
- data/lib/plugins/paginating_find/lib/paging_enumerator.rb +0 -158
- data/lib/plugins/paginating_find/lib/paging_helper.rb +0 -47
- data/lib/plugins/paginating_find/test_app/Rakefile +0 -10
- data/lib/plugins/paginating_find/test_app/app/controllers/application.rb +0 -2
- data/lib/plugins/paginating_find/test_app/config/boot.rb +0 -44
- data/lib/plugins/paginating_find/test_app/config/database.yml +0 -6
- data/lib/plugins/paginating_find/test_app/config/environment.rb +0 -53
- data/lib/plugins/paginating_find/test_app/config/environments/test.rb +0 -19
- data/lib/plugins/paginating_find/test_app/config/routes.rb +0 -22
- data/lib/plugins/paginating_find/test_app/script/breakpointer +0 -3
- data/lib/plugins/paginating_find/test_app/script/console +0 -3
- data/lib/plugins/paginating_find/test_app/test/fixtures/articles.yml +0 -19
- data/lib/plugins/paginating_find/test_app/test/fixtures/authors.yml +0 -7
- data/lib/plugins/paginating_find/test_app/test/fixtures/edits.yml +0 -11
- data/lib/plugins/paginating_find/test_app/test/fixtures/models.rb +0 -18
- data/lib/plugins/paginating_find/test_app/test/test_helper.rb +0 -33
- data/lib/plugins/paginating_find/test_app/test/unit/abstract_test.rb +0 -7
- data/lib/plugins/paginating_find/test_app/test/unit/group_test.rb +0 -40
- data/lib/plugins/paginating_find/test_app/test/unit/paginating_find_test.rb +0 -194
- data/lib/plugins/paginating_find/test_app/test/unit/paging_enumerator_test.rb +0 -143
- data/public/assets/products/1012/mini/bt.jpg +0 -0
- data/public/assets/products/1012/original/bt.jpg +0 -0
- data/public/assets/products/1012/product/bt.jpg +0 -0
- data/public/assets/products/1012/small/bt.jpg +0 -0
- data/spec/views/products/index.html.erb_spec.rb +0 -46
- data/spec/views/products/show.html.erb_spec.rb +0 -46
- data/vendor/extensions/shipping/app/controllers/shipments_controller.rb +0 -96
- data/vendor/extensions/shipping/app/helpers/shipments_helper.rb +0 -20
- data/vendor/extensions/shipping/app/views/orders/fatal_shipping.html.erb +0 -6
- data/vendor/extensions/shipping/app/views/shipments/_form.html.erb +0 -46
- data/vendor/extensions/shipping/app/views/shipments/edit.html.erb +0 -57
- data/vendor/extensions/shipping/app/views/shipments/new.html.erb +0 -10
|
File without changes
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
class ShippingMethod < ActiveRecord::Base
|
|
2
2
|
belongs_to :zone
|
|
3
3
|
|
|
4
|
-
def available?(shipment)
|
|
5
|
-
zone.include?(shipment.address)
|
|
6
|
-
end
|
|
7
|
-
|
|
8
4
|
def calculate_shipping(shipment)
|
|
9
5
|
return 0 unless zone.include?(shipment.address)
|
|
10
6
|
return shipping_calculator.constantize.new.send(:calculate_shipping, shipment)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def available?(order)
|
|
10
|
+
calculator = shipping_calculator.constantize.new
|
|
11
|
+
return true unless calculator.respond_to?(:available?)
|
|
12
|
+
calculator.available?(order)
|
|
11
13
|
end
|
|
12
14
|
end
|
data/app/models/state.rb
CHANGED
data/app/models/user.rb
CHANGED
|
@@ -4,6 +4,8 @@ class User < ActiveRecord::Base
|
|
|
4
4
|
# Virtual attribute for the unencrypted password
|
|
5
5
|
attr_accessor :password
|
|
6
6
|
|
|
7
|
+
has_many :addresses, :as => :addressable, :dependent => :destroy
|
|
8
|
+
|
|
7
9
|
validates_presence_of :email
|
|
8
10
|
validates_format_of :email, :with => RFC822::EmailAddress,
|
|
9
11
|
:message => 'email must be valid'
|
|
@@ -111,8 +113,8 @@ class User < ActiveRecord::Base
|
|
|
111
113
|
end
|
|
112
114
|
end
|
|
113
115
|
|
|
114
|
-
def
|
|
115
|
-
|
|
116
|
+
def last_address
|
|
117
|
+
addresses.last
|
|
116
118
|
end
|
|
117
119
|
|
|
118
120
|
protected
|
data/app/models/variant.rb
CHANGED
|
@@ -23,6 +23,10 @@ class Variant < ActiveRecord::Base
|
|
|
23
23
|
@new_level = new_level
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
+
def on_backorder
|
|
27
|
+
inventory_units.with_state("backordered").size
|
|
28
|
+
end
|
|
29
|
+
|
|
26
30
|
def in_stock
|
|
27
31
|
on_hand > 0
|
|
28
32
|
end
|
|
@@ -43,6 +47,10 @@ class Variant < ActiveRecord::Base
|
|
|
43
47
|
super
|
|
44
48
|
end
|
|
45
49
|
end
|
|
50
|
+
|
|
51
|
+
def orderable?
|
|
52
|
+
self.in_stock || ( !self.in_stock && self.allow_backordering) || Spree::Config[:allow_backorders]
|
|
53
|
+
end
|
|
46
54
|
|
|
47
55
|
private
|
|
48
56
|
|
|
@@ -51,7 +59,17 @@ class Variant < ActiveRecord::Base
|
|
|
51
59
|
@new_level = @new_level.to_i
|
|
52
60
|
# don't allow negative on_hand inventory
|
|
53
61
|
return if @new_level < 0
|
|
54
|
-
|
|
62
|
+
|
|
63
|
+
# fill backordered orders first
|
|
64
|
+
inventory_units.with_state("backordered").each{|iu|
|
|
65
|
+
if @new_level > 0
|
|
66
|
+
iu.fill_backorder
|
|
67
|
+
@new_level = @new_level - 1
|
|
68
|
+
end
|
|
69
|
+
break if @new_level < 1
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
adjustment = @new_level - on_hand
|
|
55
73
|
if adjustment > 0
|
|
56
74
|
InventoryUnit.create_on_hand(self, adjustment)
|
|
57
75
|
reload
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
class CheckoutPresenter < ActivePresenter::Base
|
|
2
|
+
presents :creditcard, {:bill_address => Address}, {:ship_address => Address}
|
|
3
|
+
|
|
4
|
+
include ActionView::Helpers::NumberHelper # Needed for JS usable rate information
|
|
5
|
+
|
|
6
|
+
alias_method :old_initialize, :initialize
|
|
7
|
+
attr_accessor :order
|
|
8
|
+
attr_accessor :shipping_method
|
|
9
|
+
attr_accessor :order_hash
|
|
10
|
+
attr_accessor :final_answer
|
|
11
|
+
|
|
12
|
+
def initialize(args = {})
|
|
13
|
+
old_initialize(args)
|
|
14
|
+
default_country = Country.find_by_id Spree::Config[:default_country_id]
|
|
15
|
+
bill_address.country ||= default_country
|
|
16
|
+
ship_address.country ||= default_country
|
|
17
|
+
# credit card needs to use some bill_address attributes
|
|
18
|
+
creditcard.address = bill_address
|
|
19
|
+
creditcard.first_name = bill_address.firstname
|
|
20
|
+
creditcard.last_name = bill_address.lastname
|
|
21
|
+
self.order_hash = {}
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def save
|
|
25
|
+
return false if final_answer and not valid?
|
|
26
|
+
saved = false
|
|
27
|
+
ActiveRecord::Base.transaction do
|
|
28
|
+
# clear existing shipments (no orphans please)
|
|
29
|
+
order.shipments.clear
|
|
30
|
+
# clear existing addresses, eventually this won't be necessary (we'll have an address book)
|
|
31
|
+
order.user.addresses.clear
|
|
32
|
+
|
|
33
|
+
order.user.addresses << bill_address.clone
|
|
34
|
+
|
|
35
|
+
order.shipments.create(:address => ship_address, :shipping_method => shipping_method)
|
|
36
|
+
|
|
37
|
+
order.ship_amount = order.shipment.shipping_method.calculate_shipping(order.shipment) if order.shipment and order.shipment.shipping_method
|
|
38
|
+
order.tax_amount = order.calculate_tax
|
|
39
|
+
order.save
|
|
40
|
+
|
|
41
|
+
if final_answer
|
|
42
|
+
# authorize the credit card and then save (authorize first before number is cleared for security purposes)
|
|
43
|
+
creditcard.order = order
|
|
44
|
+
creditcard.authorize(order.total)
|
|
45
|
+
creditcard.save
|
|
46
|
+
order.complete
|
|
47
|
+
end
|
|
48
|
+
saved = true
|
|
49
|
+
end
|
|
50
|
+
# populate the order hash
|
|
51
|
+
|
|
52
|
+
order_hash[:ship_amount] = number_to_currency(order.ship_amount)
|
|
53
|
+
order_hash[:tax_amount] = number_to_currency(order.tax_amount)
|
|
54
|
+
order_hash[:order_total] = number_to_currency(order.total)
|
|
55
|
+
order_hash[:ship_method] = order.shipment.shipping_method.name if order.shipment and order.shipment.shipping_method
|
|
56
|
+
saved
|
|
57
|
+
end
|
|
58
|
+
end
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<td><%=CreditcardTxn::TxnType.from_value t.txn_type.to_i%></td>
|
|
22
22
|
<td><%=number_to_currency t.amount%></td>
|
|
23
23
|
<td><%=t.response_code%></td>
|
|
24
|
-
<td><%=t.created_at.to_s(:
|
|
24
|
+
<td><%=t.created_at.to_s(:date_time24)%></td>
|
|
25
25
|
</tr>
|
|
26
26
|
<% end %>
|
|
27
27
|
</table>
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
<table class="admin-report" width="545">
|
|
11
11
|
<thead>
|
|
12
12
|
<tr>
|
|
13
|
-
<th><%= t("order_date") %></th>
|
|
14
|
-
<th><%= t("order_number") %></th>
|
|
15
|
-
<th><%= t("status") %></th>
|
|
16
|
-
<th><%= t("customer") %></th>
|
|
17
|
-
<th><%= t("total") %></th>
|
|
13
|
+
<th><%= order_by_link :created_at, :text => t("order_date") %></th>
|
|
14
|
+
<th><%= order_by_link :number, :text => t("order_number") %></th>
|
|
15
|
+
<th><%= order_by_link :state, :text => t("status") %></th>
|
|
16
|
+
<th><%= order_by_link ({:user => :email}, :text => t("customer")) %></th>
|
|
17
|
+
<th><%= order_by_link :total, :text =>t("total") %></th>
|
|
18
18
|
</tr>
|
|
19
19
|
</thead>
|
|
20
20
|
<tbody>
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
</div>
|
|
33
33
|
</td>
|
|
34
34
|
<td valign="top">
|
|
35
|
-
|
|
35
|
+
<% form_for [:admin, @search] do |f| %>
|
|
36
|
+
<% f.fields_for @search.conditions do |orders| %>
|
|
36
37
|
<div id="search-col">
|
|
37
38
|
<table class="admin-search">
|
|
38
39
|
<thead>
|
|
@@ -44,15 +45,15 @@
|
|
|
44
45
|
<tr>
|
|
45
46
|
<td><%= t("start") %>:</td>
|
|
46
47
|
<td>
|
|
47
|
-
|
|
48
|
-
<%= calendar_date_select :
|
|
48
|
+
<%#= error_message_on :search, :start%>
|
|
49
|
+
<%= orders.calendar_date_select :created_at_after, :style=>"width:100px" %>
|
|
49
50
|
</td>
|
|
50
51
|
</tr>
|
|
51
52
|
<tr>
|
|
52
53
|
<td><%= t("stop") %>:</td>
|
|
53
54
|
<td>
|
|
54
|
-
|
|
55
|
-
<%= calendar_date_select :
|
|
55
|
+
<%#= error_message_on :search, :stop%>
|
|
56
|
+
<%= orders.calendar_date_select :created_at_before, :style=>"width:100px" %>
|
|
56
57
|
</td>
|
|
57
58
|
</tr>
|
|
58
59
|
</tbody>
|
|
@@ -67,43 +68,52 @@
|
|
|
67
68
|
<tr>
|
|
68
69
|
<td><%= t("order_number") %></td>
|
|
69
70
|
<td>
|
|
70
|
-
<%=
|
|
71
|
+
<%= orders.text_field :number, :size=>13 %>
|
|
71
72
|
</td>
|
|
72
73
|
</tr>
|
|
73
74
|
<tr>
|
|
74
75
|
<td><%= t("status") %></td>
|
|
75
76
|
<td>
|
|
76
|
-
<%=
|
|
77
|
+
<%= orders.select :state, Order.state_machines['state'].states.collect {|status| [status.titleize, status]}, {:include_blank => true}, {:style => "width: 115px"}%>
|
|
77
78
|
</td>
|
|
78
79
|
</tr>
|
|
80
|
+
<% orders.fields_for orders.object.user do |user| %>
|
|
79
81
|
<tr>
|
|
80
82
|
<td><%= t("email") %></td>
|
|
81
83
|
<td>
|
|
82
|
-
<%=
|
|
84
|
+
<%= user.text_field :email, :size=>13 %>
|
|
83
85
|
</td>
|
|
84
86
|
</tr>
|
|
87
|
+
<% end %>
|
|
88
|
+
<% orders.fields_for orders.object.creditcards do |cc| %>
|
|
89
|
+
<% cc.fields_for cc.object.address do |address| %>
|
|
85
90
|
<tr>
|
|
86
91
|
<td><%= t("first_name") %></td>
|
|
87
92
|
<td>
|
|
88
|
-
<%=
|
|
93
|
+
<%= address.text_field :lower_of_firstname_contains, :size=>13 %>
|
|
89
94
|
</td>
|
|
90
95
|
</tr>
|
|
91
96
|
<tr>
|
|
92
97
|
<td><%= t("last_name") %></td>
|
|
93
98
|
<td>
|
|
94
|
-
<%=
|
|
99
|
+
<%= address.text_field :lower_of_lastname_contains, :size=>13 %>
|
|
95
100
|
</td>
|
|
96
101
|
</tr>
|
|
102
|
+
<% end %>
|
|
103
|
+
<% end %>
|
|
97
104
|
<tr>
|
|
98
|
-
<td colspan="2"
|
|
105
|
+
<td colspan="2">
|
|
106
|
+
<%= t("show_only_complete_orders") %>
|
|
107
|
+
<%= orders.check_box :checkout_complete, {:style => "vertical-align:middle;"}, "1", "" %>
|
|
99
108
|
</td>
|
|
100
109
|
</tr>
|
|
101
110
|
</tbody>
|
|
102
111
|
</table>
|
|
103
|
-
|
|
112
|
+
<%= f.submit t("search") %>
|
|
104
113
|
</div>
|
|
114
|
+
<% end %>
|
|
105
115
|
<% end %>
|
|
106
116
|
</td>
|
|
107
117
|
</tr>
|
|
108
118
|
</table>
|
|
109
|
-
<%=
|
|
119
|
+
<%= page_links(:prev => "« #{t('previous')}", :next => "#{t('next')} »") if @search.page_count > 1 %>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
</tr>
|
|
9
9
|
<% @payments.each do |payment| %>
|
|
10
10
|
<tr>
|
|
11
|
-
<td><%= payment.created_at.to_s(:
|
|
11
|
+
<td><%= payment.created_at.to_s(:date_time24) %></td>
|
|
12
12
|
<td><%= number_to_currency(payment.amount) %></td>
|
|
13
13
|
<td><%= payment.class.to_s %></td>
|
|
14
14
|
<!-- TODO: don't assume credit card, make it possible to edit other kinds of payments -->
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
:method => 'delete',
|
|
18
18
|
:before => "Element.show('img_busy_indicator')",
|
|
19
19
|
:complete => "Element.hide('img_busy_indicator')",
|
|
20
|
-
:confirm => t("
|
|
20
|
+
:confirm => t("are_you_sure_delete_image"),
|
|
21
21
|
:update => 'image-listing' %>
|
|
22
22
|
<%= image_tag "spinner.gif", :plugin=>"spree", :style => "display:none", :id => 'img_busy_indicator' %>
|
|
23
23
|
</td>
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
<table class="admin-report" width="545">
|
|
7
7
|
<tr>
|
|
8
8
|
<td><b><%= t("image") %></b></td>
|
|
9
|
-
<td><b><%= t("name") %></b></td>
|
|
10
|
-
<td><b><%= t("master_price") %></b></td>
|
|
9
|
+
<td><b><%= order_by_link :name, :text => t("name") %></b></td>
|
|
10
|
+
<td><b><%= order_by_link :master_price, :text => t("master_price") %></b></td>
|
|
11
11
|
<td/>
|
|
12
12
|
</tr>
|
|
13
|
-
<% @
|
|
13
|
+
<% @collection.each do |product| %>
|
|
14
14
|
<tr <%= 'style="color:red;"' unless product.deleted_at.nil? %>>
|
|
15
15
|
<td><%= mini_image(product) %></td>
|
|
16
16
|
<td valign="top"><%=product.name%></td>
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
</tr>
|
|
24
24
|
<% end %>
|
|
25
25
|
</table>
|
|
26
|
-
|
|
26
|
+
<%= page_links(:prev => "« #{t('previous')}", :next => "#{t('next')} »") if @search.page_count > 1 %>
|
|
27
27
|
</td>
|
|
28
28
|
<td valign="top">
|
|
29
|
-
|
|
29
|
+
<% form_for [:admin, @search] do |f| %>
|
|
30
30
|
<div id="search-col">
|
|
31
31
|
<table class="admin-search">
|
|
32
32
|
<thead>
|
|
@@ -35,27 +35,31 @@
|
|
|
35
35
|
</tr>
|
|
36
36
|
</thead>
|
|
37
37
|
<tbody>
|
|
38
|
+
<% f.fields_for @search.conditions do |products| %>
|
|
39
|
+
|
|
38
40
|
<tr>
|
|
39
41
|
<td><%= t("name") %></td>
|
|
40
42
|
<td>
|
|
41
|
-
|
|
43
|
+
<%= products.text_field :name_contains, :size => 15 %>
|
|
42
44
|
</td>
|
|
43
45
|
</tr>
|
|
44
46
|
<tr>
|
|
47
|
+
|
|
48
|
+
<% products.fields_for products.object.variants do |variants| %>
|
|
45
49
|
<td><%= t("sku") %></td>
|
|
46
|
-
<td>
|
|
47
|
-
|
|
48
|
-
</td>
|
|
50
|
+
<td><%= variants.text_field :sku_contains, :size => 15 %></td>
|
|
51
|
+
<% end %>
|
|
49
52
|
</tr>
|
|
50
53
|
<tr>
|
|
51
|
-
|
|
52
|
-
|
|
54
|
+
<td><%= t("show_deleted") %></td>
|
|
55
|
+
<td><%= products.check_box :deleted_at_is_not_null, {}, "1", "" %></td>
|
|
53
56
|
</tr>
|
|
57
|
+
<%end%>
|
|
54
58
|
</tbody>
|
|
55
59
|
</table>
|
|
56
|
-
|
|
60
|
+
<%= f.submit t("search") %>
|
|
57
61
|
</div>
|
|
58
|
-
|
|
62
|
+
<% end %>
|
|
59
63
|
</td>
|
|
60
64
|
</tr>
|
|
61
65
|
</table>
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
<td valign="top">
|
|
6
6
|
<table class="admin-report">
|
|
7
7
|
<thead>
|
|
8
|
-
<th><%= t("user") %></th>
|
|
8
|
+
<th><%= order_by_link :email, :text => t("user") %></th>
|
|
9
9
|
<th><%= t("action") %></th>
|
|
10
10
|
</thead>
|
|
11
11
|
<tbody>
|
|
12
|
-
<%- @
|
|
12
|
+
<%- @collection.each do |user|%>
|
|
13
13
|
<tr>
|
|
14
14
|
<td width="350px"><%=link_to user.email, object_url(user) %></td>
|
|
15
15
|
<td>
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
</table>
|
|
23
23
|
</td>
|
|
24
24
|
<td valign="top">
|
|
25
|
-
<% form_for :
|
|
25
|
+
<% form_for [:admin, @search] do |f| %>
|
|
26
|
+
<% f.fields_for @search.conditions do |user| %>
|
|
26
27
|
<div id="search-col">
|
|
27
28
|
<table class="admin-search">
|
|
28
29
|
<thead>
|
|
@@ -34,19 +35,18 @@
|
|
|
34
35
|
<tr>
|
|
35
36
|
<td><%= t("email") %></td>
|
|
36
37
|
<td>
|
|
37
|
-
<%=
|
|
38
|
+
<%= user.text_field :lower_of_email, :size=>18 %>
|
|
38
39
|
</td>
|
|
39
40
|
</tr>
|
|
40
41
|
</tbody>
|
|
41
42
|
</table>
|
|
42
|
-
|
|
43
|
+
<%= f.submit t("search") %>
|
|
43
44
|
</div>
|
|
45
|
+
<% end %>
|
|
44
46
|
<% end %>
|
|
45
47
|
</td>
|
|
46
48
|
</tr>
|
|
47
49
|
</table>
|
|
48
|
-
<%=
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
<%= page_links(:prev => "« #{t('previous')}", :next => "#{t('next')} »") if @search.page_count > 1 %>
|
|
51
51
|
<%= link_to t('new_user'), new_object_url %>
|
|
52
52
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
<table class="admin-report" width="545">
|
|
3
3
|
<thead>
|
|
4
4
|
<tr>
|
|
5
|
-
<th><%= t("name") %></th>
|
|
6
|
-
<th><%= t("description") %></th>
|
|
5
|
+
<th><%= order_by_link :name, :text => t("name") %></th>
|
|
6
|
+
<th><%= order_by_link :description, :text => t("description") %></th>
|
|
7
7
|
<th><%= t("action") %></th>
|
|
8
8
|
</tr>
|
|
9
9
|
</thead>
|
|
@@ -23,4 +23,7 @@
|
|
|
23
23
|
<% end %>
|
|
24
24
|
</tbody>
|
|
25
25
|
</table>
|
|
26
|
+
|
|
27
|
+
<%= page_links(:prev => "« #{t('previous')}", :next => "#{t('next')} »") if @search.page_count > 1 %>
|
|
28
|
+
|
|
26
29
|
<%= link_to t("new_zone"), new_object_url %>
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
<% content_for :head do %>
|
|
2
|
+
<%= javascript_include_tag 'jquery-1.3.2.min' %>
|
|
3
|
+
<%= javascript_include_tag 'jquery.validate.pack.js' %>
|
|
4
|
+
<%= javascript_include_tag 'checkout' %>
|
|
5
|
+
<%= javascript_tag "var AUTH_TOKEN = #{form_authenticity_token.inspect};" if protect_against_forgery? %>
|
|
6
|
+
<%= stylesheet_link_tag 'checkout.css' %>
|
|
7
|
+
<% end %>
|
|
8
|
+
|
|
9
|
+
<input type="hidden" id="hidden_bstate" name="hidden_bstate" value="<%= @object.bill_address.state_id || @object.bill_address.state_name %>" />
|
|
10
|
+
<input type="hidden" id="hidden_bcountry" name="hidden_bcountry" value="<%= @object.bill_address.country_id %>" />
|
|
11
|
+
<input type="hidden" id="hidden_sstate" name="hidden_sstate" value="<%= @object.ship_address.state_id || @object.ship_address.state_name %>" />
|
|
12
|
+
<input type="hidden" id="hidden_scountry" name="hidden_scountry" value="<%= @object.ship_address.country_id %>" />
|
|
13
|
+
|
|
14
|
+
<%= error_messages_for :checkout_presenter %>
|
|
15
|
+
<div id="billing">
|
|
16
|
+
<h2><%= t("billing_address")%></h2>
|
|
17
|
+
<div class="inner">
|
|
18
|
+
<p id="bfname">
|
|
19
|
+
<label for="<%= t("first_name") %>"><%= t("first_name") %></label>
|
|
20
|
+
<%= f.text_field :bill_address_firstname, :class => 'required' -%><span class="req">*</span>
|
|
21
|
+
</p>
|
|
22
|
+
<p id="blname">
|
|
23
|
+
<label for="<%= t("last_name") %>"><%= t("last_name") %></label>
|
|
24
|
+
<%= f.text_field :bill_address_lastname, :class => 'required' -%><span class="req">*</span>
|
|
25
|
+
</p>
|
|
26
|
+
<p id="baddress">
|
|
27
|
+
<label for=""><%= t("street_address") %></label>
|
|
28
|
+
<%= f.text_field :bill_address_address1, :class => 'required' -%><span class="req">*</span>
|
|
29
|
+
</p>
|
|
30
|
+
<p id="baddress2">
|
|
31
|
+
<label for=""><%= t("street_address_2") %></label>
|
|
32
|
+
<%= f.text_field :bill_address_address2 %>
|
|
33
|
+
</p>
|
|
34
|
+
<p id="bcity">
|
|
35
|
+
<label for=""><%= t("city") %></label>
|
|
36
|
+
<%= f.text_field :bill_address_city, :class => 'required' -%><span class="req">*</span>
|
|
37
|
+
</p>
|
|
38
|
+
<p>
|
|
39
|
+
<label for=""><%= t("state") %></label>
|
|
40
|
+
<span id="bstate">
|
|
41
|
+
<%= collection_select("checkout_presenter",
|
|
42
|
+
:bill_address_state_id,
|
|
43
|
+
@states,
|
|
44
|
+
:id,
|
|
45
|
+
:name,
|
|
46
|
+
{:include_blank => true},
|
|
47
|
+
{:style=> 'width:150px;'}) %>
|
|
48
|
+
</span>
|
|
49
|
+
<span class="req">*</span>
|
|
50
|
+
</p>
|
|
51
|
+
<p id="bzip">
|
|
52
|
+
<label for=""><%= t("zip") %></label>
|
|
53
|
+
<%= f.text_field :bill_address_zipcode, :class => 'required' -%><span class="req">*</span>
|
|
54
|
+
</p>
|
|
55
|
+
<p id="bcountry">
|
|
56
|
+
<label for=""><%= t("country") %></label>
|
|
57
|
+
<span id="bcountry"><%= f.collection_select :bill_address_country_id, @countries, :id, :name, {}, {:style => 'width:150px;', :class => 'required'} %></span>
|
|
58
|
+
</p>
|
|
59
|
+
<p id="bphone">
|
|
60
|
+
<label for=""><%= t("phone") %></label>
|
|
61
|
+
<%= f.text_field :bill_address_phone, :class => 'required' -%><span class="req">*</span>
|
|
62
|
+
</p>
|
|
63
|
+
<p><input id="validate_billing" type="button" value="<%=t("continue")%>"/></p>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
<div id="shipping" class="checkout_disabled">
|
|
68
|
+
<h2><%= t("shipping_address")%></h2>
|
|
69
|
+
<div class="inner">
|
|
70
|
+
<p><label for="<%= t("use_billing_address") %>" id="use_billing"><%= t("use_billing_address") %></label><input id="checkout_presenter_same_address" name="checkout_presenter_same_address" type="checkbox" /></p>
|
|
71
|
+
<p id="sfname">
|
|
72
|
+
<label for="<%= t("first_name") %>"><%= t("first_name") %></label>
|
|
73
|
+
<%= f.text_field :ship_address_firstname, :class => 'required' -%><span class="req">*</span>
|
|
74
|
+
</p>
|
|
75
|
+
<p id="slname">
|
|
76
|
+
<label for="<%= t("last_name") %>"><%= t("last_name") %></label>
|
|
77
|
+
<%= f.text_field :ship_address_lastname, :class => 'required' -%><span class="req">*</span>
|
|
78
|
+
</p>
|
|
79
|
+
<p id="saddress">
|
|
80
|
+
<label for="<%= t("street_address") %>"><%= t("street_address") %></label>
|
|
81
|
+
<%= f.text_field :ship_address_address1, :class => 'required' -%><span class="req">*</span>
|
|
82
|
+
</p>
|
|
83
|
+
<p id="saddress2">
|
|
84
|
+
<label for="<%= t("street_address_2") %>"><%= t("street_address_2") %></label>
|
|
85
|
+
<%= f.text_field :ship_address_address2 %>
|
|
86
|
+
</p>
|
|
87
|
+
<p id="scity">
|
|
88
|
+
<label for="<%= t("city") %>"><%= t("city") %></label>
|
|
89
|
+
<%= f.text_field :ship_address_city, :class => 'required' -%><span class="req">*</span>
|
|
90
|
+
</p>
|
|
91
|
+
<p>
|
|
92
|
+
<label for="<%= t("state") %>"><%= t("state") %></label>
|
|
93
|
+
<span id="sstate">
|
|
94
|
+
<%= collection_select("checkout_presenter",
|
|
95
|
+
:ship_address_state_id,
|
|
96
|
+
@states,
|
|
97
|
+
:id,
|
|
98
|
+
:name,
|
|
99
|
+
{:include_blank => true},
|
|
100
|
+
{:style=> 'width:150px;'}) %>
|
|
101
|
+
</span>
|
|
102
|
+
<span class="req">*</span>
|
|
103
|
+
</p>
|
|
104
|
+
<p id="szip">
|
|
105
|
+
<label for="<%=t ("zip") %>"><%= t("zip") %></label>
|
|
106
|
+
<%= f.text_field :ship_address_zipcode, :class => 'required' -%><span class="req">*</span>
|
|
107
|
+
</p>
|
|
108
|
+
<p id="scountry">
|
|
109
|
+
<label for="<%= t("country") %>"><%= t("country") %></label>
|
|
110
|
+
<span id="scountry"><%= f.collection_select :ship_address_country_id, @shipping_countries, :id, :name, {}, {:style => 'width:150px;', :class => 'required'} %></span>
|
|
111
|
+
</p>
|
|
112
|
+
<p id="sphone">
|
|
113
|
+
<label for="<%= t("phone") %>"><%= t("phone") %></label>
|
|
114
|
+
<%= f.text_field :ship_address_phone, :class => 'required' -%><span class="req">*</span>
|
|
115
|
+
</p>
|
|
116
|
+
<p><input id="validate_shipping" type="button" value="<%=t("continue")%>"/></p>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
|
|
120
|
+
<div id="shipping_method" class="checkout_disabled">
|
|
121
|
+
<h2><%= t("shipping_method") %></h2>
|
|
122
|
+
<div class="inner">
|
|
123
|
+
<div id="methods"></div>
|
|
124
|
+
<p><input id="select_shipping_method" type="button" value="<%=t("continue")%>"/></p>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
|
|
128
|
+
<div id="creditcard" class="checkout_disabled">
|
|
129
|
+
<h2><%= t("payment_information") %></h2>
|
|
130
|
+
<div class="inner">
|
|
131
|
+
<p>
|
|
132
|
+
<%= image_tag "creditcard.gif", :id => 'creditcard-image' %>
|
|
133
|
+
</p>
|
|
134
|
+
<p>
|
|
135
|
+
<label for=""><%= t("card_number") %></label>
|
|
136
|
+
<%= f.text_field :creditcard_number, :size=> 19, :class => 'required' -%><span class="req">*</span>
|
|
137
|
+
</p>
|
|
138
|
+
<p>
|
|
139
|
+
<label for=""><%= t("expiration") %></label>
|
|
140
|
+
<%= select_month(@date, :prefix => 'checkout_presenter', :field_name => 'creditcard_month', :use_month_numbers => true, :class => 'required') -%>
|
|
141
|
+
<%= select_year(@date, :prefix => 'checkout_presenter', :field_name => 'creditcard_year', :start_year => Date.today.year, :end_year => Date.today.year + 15, :class => 'required') -%>
|
|
142
|
+
<span class="req">*</span>
|
|
143
|
+
</p>
|
|
144
|
+
<p>
|
|
145
|
+
<label for=""><%= t("card_code") %></label>
|
|
146
|
+
<%= f.text_field :creditcard_verification_value, {:style => 'width:40px', :class => 'required'} -%><span class="req">*</span>
|
|
147
|
+
<a href="" onclick="window.open('/checkout/cvv','mywin','left=20,top=20,width=500,height=500,toolbar=0,resizable=0,scrollbars=1');return false">
|
|
148
|
+
(<%= t("whats_this") %>)
|
|
149
|
+
</a>
|
|
150
|
+
</p>
|
|
151
|
+
<p><input id="confirm_payment" type="button" value="<%=t("continue")%>"/></p>
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
|
|
155
|
+
<div id="confirm_order" class="checkout_disabled">
|
|
156
|
+
<h2><%= t("confirm") %></h2>
|
|
157
|
+
<div class="inner">
|
|
158
|
+
<input id="final_answer" name="final_answer" type="hidden">
|
|
159
|
+
<div id="bdisplay"><img src="/images/ajax_loader.gif" id="bconfirm_loader" /></div>
|
|
160
|
+
<div id="sdisplay"><img src="/images/ajax_loader.gif" id="sconfirm_loader" /></div>
|
|
161
|
+
<div class="clear"></div>
|
|
162
|
+
<%= render :partial => 'shared/order_details', :locals => {:order => @order} -%>
|
|
163
|
+
<%= submit_tag t('place_order') %>
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|