spree_core 0.50.4 → 0.60.0.RC1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. data/app/controllers/admin/adjustments_controller.rb +8 -7
  2. data/app/controllers/admin/base_controller.rb +1 -33
  3. data/app/controllers/admin/configurations_controller.rb +0 -24
  4. data/app/controllers/admin/images_controller.rb +10 -25
  5. data/app/controllers/admin/line_items_controller.rb +41 -26
  6. data/app/controllers/admin/mail_methods_controller.rb +2 -7
  7. data/app/controllers/admin/option_types_controller.rb +17 -21
  8. data/app/controllers/admin/orders_controller.rb +70 -55
  9. data/app/controllers/admin/payment_methods_controller.rb +33 -22
  10. data/app/controllers/admin/payments_controller.rb +25 -27
  11. data/app/controllers/admin/product_groups_controller.rb +22 -20
  12. data/app/controllers/admin/product_properties_controller.rb +2 -6
  13. data/app/controllers/admin/product_scopes_controller.rb +24 -20
  14. data/app/controllers/admin/products_controller.rb +20 -26
  15. data/app/controllers/admin/properties_controller.rb +2 -20
  16. data/app/controllers/admin/prototypes_controller.rb +5 -33
  17. data/app/controllers/admin/resource_controller.rb +221 -0
  18. data/app/controllers/admin/return_authorizations_controller.rb +3 -9
  19. data/app/controllers/admin/shipments_controller.rb +68 -35
  20. data/app/controllers/admin/shipping_categories_controller.rb +1 -15
  21. data/app/controllers/admin/shipping_methods_controller.rb +6 -12
  22. data/app/controllers/admin/states_controller.rb +16 -21
  23. data/app/controllers/admin/tax_categories_controller.rb +1 -12
  24. data/app/controllers/admin/tax_rates_controller.rb +2 -12
  25. data/app/controllers/admin/taxonomies_controller.rb +11 -12
  26. data/app/controllers/admin/taxons_controller.rb +74 -53
  27. data/app/controllers/admin/trackers_controller.rb +1 -6
  28. data/app/controllers/admin/users_controller.rb +36 -35
  29. data/app/controllers/admin/variants_controller.rb +7 -22
  30. data/app/controllers/admin/zones_controller.rb +12 -25
  31. data/app/controllers/checkout_controller.rb +2 -6
  32. data/app/controllers/orders_controller.rb +0 -1
  33. data/app/controllers/products_controller.rb +12 -16
  34. data/app/controllers/taxons_controller.rb +8 -15
  35. data/app/helpers/admin/navigation_helper.rb +4 -0
  36. data/app/models/address.rb +1 -1
  37. data/app/models/app_configuration.rb +2 -3
  38. data/app/models/product.rb +1 -2
  39. data/app/models/product_group.rb +8 -8
  40. data/app/models/product_scope.rb +1 -1
  41. data/app/models/shipping_method.rb +6 -2
  42. data/app/models/tax_rate.rb +1 -1
  43. data/app/views/admin/general_settings/edit.html.erb +10 -15
  44. data/app/views/admin/general_settings/show.html.erb +5 -5
  45. data/app/views/admin/option_types/{new.html.erb → new.erb} +0 -0
  46. data/app/views/admin/orders/_form.html.erb +0 -1
  47. data/app/views/admin/orders/edit.html.erb +2 -2
  48. data/app/views/admin/orders/index.html.erb +2 -2
  49. data/app/views/admin/payment_methods/edit.html.erb +1 -1
  50. data/app/views/admin/payments/new.html.erb +2 -2
  51. data/app/views/admin/payments/show.html.erb +3 -3
  52. data/app/views/admin/product_groups/index.html.erb +1 -1
  53. data/app/views/admin/product_scopes/create.js.erb +3 -3
  54. data/app/views/admin/product_scopes/destroy.js.erb +2 -2
  55. data/app/views/admin/products/{new.html.erb → new.erb} +0 -0
  56. data/app/views/admin/properties/{new.html.erb → new.erb} +0 -0
  57. data/app/views/admin/prototypes/{new.html.erb → new.erb} +0 -0
  58. data/app/views/admin/shared/_product_tabs.html.erb +1 -1
  59. data/app/views/admin/shared/_tabs.html.erb +1 -1
  60. data/app/views/admin/shipments/edit.html.erb +3 -3
  61. data/app/views/admin/shipments/index.html.erb +1 -1
  62. data/app/views/admin/shipments/new.html.erb +1 -1
  63. data/app/views/admin/states/{new.html.erb → new.erb} +0 -0
  64. data/app/views/admin/tax_categories/edit.html.erb +1 -1
  65. data/app/views/admin/taxonomies/{edit.html.erb → edit.erb} +0 -0
  66. data/app/views/admin/taxons/edit.html.erb +1 -1
  67. data/app/views/admin/variants/{new.html.erb → new.erb} +0 -0
  68. data/app/views/admin/zones/index.html.erb +2 -3
  69. data/app/views/checkout/_address.html.erb +2 -2
  70. data/app/views/layouts/admin.html.erb +0 -1
  71. data/app/views/products/_thumbnails.html.erb +2 -2
  72. data/app/views/shared/_admin_head.html.erb +5 -5
  73. data/app/views/shared/_order_details.html.erb +1 -1
  74. data/app/views/states/index.js.erb +1 -1
  75. data/config/initializers/spree.rb +2 -0
  76. data/config/locales/en.yml +12 -9
  77. data/config/routes.rb +2 -6
  78. data/lib/scopes/product.rb +5 -8
  79. data/lib/spree/preference_access.rb +2 -2
  80. data/lib/spree_base.rb +1 -1
  81. data/lib/spree_core.rb +1 -1
  82. data/lib/spree_core/action_callbacks.rb +26 -0
  83. data/lib/spree_core/version.rb +1 -1
  84. data/lib/tasks/taxon.rake +1 -1
  85. data/public/javascripts/admin.js +0 -6
  86. data/public/javascripts/admin/address_states.js +5 -5
  87. data/public/javascripts/application.js +2 -2
  88. data/public/stylesheets/admin/admin.css +0 -29
  89. data/public/stylesheets/screen.css +1 -0
  90. metadata +97 -79
  91. data/app/models/spree/alert.rb +0 -13
  92. data/app/views/account/login.html.erb +0 -4
  93. data/app/views/admin/configurations/new.html.erb +0 -13
  94. data/app/views/admin/payments/_card_form.html.erb +0 -49
  95. data/app/views/admin/shared/_alert.html.erb +0 -6
  96. data/lib/spree_core/find_by_param.rb +0 -119
@@ -1,13 +0,0 @@
1
- class Spree::Alert < ActiveResource::Base
2
- self.site = "http://alerts.spreecommerce.com/"
3
- self.format = :json
4
-
5
- def self.current(host)
6
- find(:all, :params => { :version => Spree.version,
7
- :name => Spree::Config[:site_name],
8
- :host => host,
9
- :rails_env => Rails.env,
10
- :rails_version => Rails.version })
11
- end
12
- end
13
-
@@ -1,4 +0,0 @@
1
- <h1><%= t("login_name") %></h1>
2
-
3
- <%= render :partial => 'shared/login' %>
4
- <%= t("or") %> <%= link_to t("create_a_new_account"), signup_path %> </p>
@@ -1,13 +0,0 @@
1
- <h2><%= t("new_configuration_template") %></h2>
2
-
3
- <%= render "shared/error_messages", :target => @app_configuration %>
4
-
5
- <%= form_for @app_configuration, :url => admin_configurations_path do |f| %>
6
- <p>
7
- <strong><%= t("name") %></strong><br />
8
- <%= f.text_field :name %>
9
- </p>
10
- <p>
11
- <%= f.submit t("create") %>
12
- <% end %>
13
-
@@ -1,49 +0,0 @@
1
- <% f.fields_for :creditcard do |cc_form| %>
2
-
3
- <table class="index">
4
- <tr>
5
- <th colspan="6"><%= t('card_details') %></th>
6
- </tr>
7
- <tr>
8
- <td>
9
- <%= cc_form.label :number, t(:card_number) %>
10
- </td>
11
- <td>
12
- <%= cc_form.text_field :number, :size=> 19, :max_length => 19%>
13
- </td>
14
- <td>
15
- <%= cc_form.label :month, t(:expiration) %>
16
- </td>
17
- <td>
18
- <%= select_month(Date.today, :prefix => 'creditcard_payment[creditcard_attributes]', :field_name => 'month', :use_month_numbers => true) %>
19
- <%= select_year(Date.today, :prefix => 'creditcard_payment[creditcard_attributes]', :field_name => 'year', :start_year => Date.today.year, :end_year => Date.today.year + 15) %>
20
- </td>
21
- <td>
22
- <%= cc_form.label :verification_value, t(:card_code) %>
23
- </td>
24
- <td>
25
- <%= cc_form.text_field :verification_value, {:style => 'width:40px'} %>
26
- </td>
27
- </tr>
28
- <tr>
29
- <td>
30
- <%= cc_form.label :issue_number, t(:maestro_or_solo_cards) %>
31
- </td>
32
- <td>
33
- <%= cc_form.text_field :issue_number, {:style => 'width:40px', :title => t('enter_exactly_as_shown_on_card') + ', e.g. 2, 01.' } %>
34
- </td>
35
- <td>
36
- <%= cc_form.label :start_month, t(:start_date) %>
37
- </td>
38
- <td colspan="3">
39
- <%= select_month(@date, :prefix => 'creditcard', :field_name => 'start_month', :use_month_numbers => true, :include_blank => true) %>
40
- <%= select_year(@date, :prefix => 'creditcard', :field_name => 'start_year', :start_year => Date.today.year - 15, :end_year => Date.today.year, :include_blank => true) %>
41
- </td>
42
- </tr>
43
- </table>
44
-
45
- <%= cc_form.hidden_field :address_id, :value => @payment.order.checkout.bill_address.id %>
46
- <%= cc_form.hidden_field :first_name, :value => @payment.order.checkout.bill_address.firstname %>
47
- <%= cc_form.hidden_field :last_name, :value => @payment.order.checkout.bill_address.lastname %>
48
-
49
- <% end %>
@@ -1,6 +0,0 @@
1
- <div class="alert <%= alert.severity.downcase %>">
2
- <%= alert.message %> <%= link_to alert.url_name, alert.url if alert.url %>
3
- <%= link_to 'X', dismiss_alert_admin_general_settings_path(:alert_id => alert.id),
4
- :remote => true, :method => :post, :class => 'dismiss' %>
5
- </div>
6
-
@@ -1,119 +0,0 @@
1
- # This is a modified version of the original find_by_param plugin by Michael Bumann. Simplified to use Rails 2.2
2
- # functionality and tossed out some features not worth supporting.
3
-
4
- # ++
5
- # Copyright (c) 2007 [Michael Bumann - Railslove.com]
6
- #
7
- # Permission is hereby granted, free of charge, to any person obtaining
8
- # a copy of this software and associated documentation files (the
9
- # "Software"), to deal in the Software without restriction, including
10
- # without limitation the rights to use, copy, modify, merge, publish,
11
- # distribute, sublicense, and/or sell copies of the Software, and to
12
- # permit persons to whom the Software is furnished to do so, subject to
13
- # the following conditions:
14
- #
15
- # The above copyright notice and this permission notice shall be
16
- # included in all copies or substantial portions of the Software.
17
- #
18
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19
- # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20
- # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21
- # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22
- # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23
- # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24
- # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
- # --
26
-
27
- begin
28
- require "active_support/multibyte"
29
- rescue LoadError
30
- require "rubygems"
31
- require "active_support/multibyte"
32
- end
33
- module Railslove
34
- module Plugins
35
- module FindByParam
36
-
37
- def self.included(base)
38
- base.extend(ClassMethods)
39
- end
40
-
41
- module ClassMethods
42
-
43
- def make_permalink(options={})
44
- options[:field] ||= "permalink"
45
-
46
- if self.column_names.include?(options[:field].to_s)
47
- options[:param] = options[:field]
48
- before_validation(:on => :create){ save_permalink }
49
- end
50
-
51
- self.permalink_options = options
52
- extend Railslove::Plugins::FindByParam::SingletonMethods
53
- include Railslove::Plugins::FindByParam::InstanceMethods
54
- rescue
55
- # Database is not available (not a problem if we're running rake db:create or rake db:bootstrap)
56
- end
57
- end
58
-
59
- module SingletonMethods
60
-
61
- def find_by_param(value,args={})
62
- if permalink_options[:prepend_id]
63
- param = "id"
64
- value = value.to_i
65
- else
66
- param = permalink_options[:field]
67
- end
68
- self.send("find_by_#{param}".to_sym, value, args)
69
- end
70
-
71
- def find_by_param!(value, args={})
72
- param = permalink_options[:field]
73
- obj = find_by_param(value, args)
74
- raise ::ActiveRecord::RecordNotFound unless obj
75
- obj
76
- end
77
- end
78
-
79
- module InstanceMethods
80
-
81
- protected
82
- def save_permalink
83
- return unless self.class.column_names.include?(permalink_options[:field].to_s)
84
- return if !changed?
85
-
86
- base_value = to_param
87
- permalink_value = base_value
88
- counter = 0
89
-
90
- begin
91
- permalink_value = base_value + ((counter == 0) ? "" : "-#{counter}")
92
- query = self.class.send("where", "#{permalink_options[:field]} = ?", permalink_value)
93
- counter += 1
94
- end while query.limit(1).present?
95
-
96
- write_attribute(permalink_options[:field], permalink_value)
97
- true
98
-
99
- end
100
- end
101
-
102
- end
103
- end
104
- end
105
-
106
- class ActiveRecord::Base
107
- class_attribute :permalink_options
108
- self.permalink_options = {:param => :id}
109
-
110
- #default finders these are overwritten if you use make_permalink in your model
111
- def self.find_by_param(value,args={})
112
- find_by_id(value,args)
113
- end
114
- def self.find_by_param!(value,args={})
115
- find(value,args)
116
- end
117
-
118
- end
119
- ActiveRecord::Base.send(:include, Railslove::Plugins::FindByParam)