spree_core 1.1.6 → 1.2.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/images/{creditcards → credit_cards}/amex_cid.gif +0 -0
- data/app/assets/images/{creditcards/creditcard.gif → credit_cards/credit_card.gif} +0 -0
- data/app/assets/images/{creditcards → credit_cards}/discover_cid.gif +0 -0
- data/app/assets/images/{creditcards → credit_cards}/icons/american_express.png +0 -0
- data/app/assets/images/{creditcards → credit_cards}/icons/cirrus.png +0 -0
- data/app/assets/images/{creditcards → credit_cards}/icons/delta.png +0 -0
- data/app/assets/images/{creditcards → credit_cards}/icons/dinersclub.png +0 -0
- data/app/assets/images/{creditcards → credit_cards}/icons/directdebit.png +0 -0
- data/app/assets/images/{creditcards → credit_cards}/icons/discover.png +0 -0
- data/app/assets/images/{creditcards → credit_cards}/icons/egold.png +0 -0
- data/app/assets/images/{creditcards → credit_cards}/icons/maestro.png +0 -0
- data/app/assets/images/{creditcards → credit_cards}/icons/master.png +0 -0
- data/app/assets/images/{creditcards → credit_cards}/icons/paypal.png +0 -0
- data/app/assets/images/{creditcards → credit_cards}/icons/solo.png +0 -0
- data/app/assets/images/{creditcards → credit_cards}/icons/switch.png +0 -0
- data/app/assets/images/{creditcards → credit_cards}/icons/visa.png +0 -0
- data/app/assets/images/{creditcards → credit_cards}/icons/visaelectron.png +0 -0
- data/app/assets/images/{creditcards → credit_cards}/icons/westernunion.png +0 -0
- data/app/assets/images/{creditcards → credit_cards}/icons/wirecard.png +0 -0
- data/app/assets/images/{creditcards → credit_cards}/icons/worldpay.png +0 -0
- data/app/assets/images/{creditcards → credit_cards}/master_cid.jpg +0 -0
- data/app/assets/images/{creditcards → credit_cards}/visa_cid.gif +0 -0
- data/app/assets/javascripts/admin/admin.js.erb +12 -136
- data/app/assets/javascripts/admin/checkouts/edit.js +18 -35
- data/app/assets/javascripts/admin/gateway.js +2 -2
- data/app/assets/javascripts/admin/images/index.js.coffee +12 -0
- data/app/assets/javascripts/admin/images/new.js.coffee +4 -0
- data/app/assets/javascripts/admin/orders/edit.js +1 -1
- data/app/assets/javascripts/admin/orders/edit_form.js +0 -2
- data/app/assets/javascripts/admin/product_autocomplete.js.erb +116 -0
- data/app/assets/javascripts/store/cart.js.coffee +7 -0
- data/app/assets/javascripts/store/checkout.js.coffee +57 -0
- data/app/assets/javascripts/store/product.js.coffee +36 -0
- data/app/assets/stylesheets/admin/admin.css.erb +5 -0
- data/app/assets/stylesheets/admin/spree_core.css +1 -0
- data/app/assets/stylesheets/store/screen.css.scss +15 -1
- data/app/assets/stylesheets/store/variables.css.scss +29 -29
- data/app/controllers/spree/admin/banners_controller.rb +14 -0
- data/app/controllers/spree/admin/base_controller.rb +11 -0
- data/app/controllers/spree/admin/images_controller.rb +13 -5
- data/app/controllers/spree/admin/line_items_controller.rb +16 -25
- data/app/controllers/spree/admin/mail_methods_controller.rb +1 -8
- data/app/controllers/spree/admin/option_types_controller.rb +0 -25
- data/app/controllers/spree/admin/orders/customer_details_controller.rb +3 -3
- data/app/controllers/spree/admin/orders_controller.rb +23 -14
- data/app/controllers/spree/admin/payment_methods_controller.rb +1 -7
- data/app/controllers/spree/admin/payments_controller.rb +5 -5
- data/app/controllers/spree/admin/products_controller.rb +15 -5
- data/app/controllers/spree/admin/prototypes_controller.rb +2 -2
- data/app/controllers/spree/admin/reports_controller.rb +1 -7
- data/app/controllers/spree/admin/resource_controller.rb +130 -130
- data/app/controllers/spree/admin/search_controller.rb +47 -0
- data/app/controllers/spree/admin/taxons_controller.rb +0 -43
- data/app/controllers/spree/base_controller.rb +2 -1
- data/app/controllers/spree/checkout_controller.rb +29 -10
- data/app/controllers/spree/orders_controller.rb +7 -11
- data/app/controllers/spree/products_controller.rb +5 -1
- data/app/helpers/spree/account_helper.rb +4 -0
- data/app/helpers/spree/admin/base_helper.rb +2 -44
- data/app/helpers/spree/admin/navigation_helper.rb +1 -3
- data/app/helpers/spree/admin/orders_helper.rb +3 -2
- data/app/helpers/spree/admin/products_helper.rb +21 -0
- data/app/helpers/spree/base_helper.rb +14 -11
- data/app/helpers/spree/checkout_helper.rb +5 -1
- data/app/helpers/spree/orders_helper.rb +5 -0
- data/app/helpers/spree/products_helper.rb +4 -0
- data/app/helpers/spree/trackers_helper.rb +4 -0
- data/app/models/spree/ability.rb +70 -0
- data/app/models/spree/address.rb +4 -12
- data/app/models/spree/adjustment.rb +30 -8
- data/app/models/spree/app_configuration.rb +1 -1
- data/app/models/spree/calculator/price_sack.rb +3 -5
- data/app/models/spree/country.rb +1 -4
- data/app/models/spree/{creditcard.rb → credit_card.rb} +4 -4
- data/app/models/spree/gateway.rb +2 -2
- data/app/models/spree/gateway/bogus.rb +10 -10
- data/app/models/spree/gateway/bogus_simple.rb +4 -4
- data/app/models/spree/image.rb +3 -12
- data/app/models/spree/inventory_unit.rb +4 -6
- data/app/models/spree/{user.rb → legacy_user.rb} +7 -6
- data/app/models/spree/line_item.rb +4 -5
- data/app/models/spree/option_type.rb +4 -6
- data/app/models/spree/option_value.rb +1 -1
- data/app/models/spree/order.rb +90 -132
- data/app/models/spree/order/checkout.rb +124 -0
- data/app/models/spree/payment.rb +6 -6
- data/app/models/spree/payment/processing.rb +34 -38
- data/app/models/spree/payment_method.rb +2 -2
- data/app/models/spree/preference.rb +2 -0
- data/app/models/spree/preferences/preferable_class_methods.rb +0 -2
- data/app/models/spree/preferences/store.rb +3 -21
- data/app/models/spree/product.rb +41 -43
- data/app/models/spree/product/scopes.rb +9 -25
- data/app/models/spree/product_option_type.rb +2 -2
- data/app/models/spree/product_property.rb +9 -4
- data/app/models/spree/property.rb +1 -1
- data/app/models/spree/prototype.rb +2 -2
- data/app/models/spree/return_authorization.rb +2 -2
- data/app/models/spree/role.rb +1 -1
- data/app/models/spree/shipment.rb +6 -5
- data/app/models/spree/shipping_method.rb +19 -13
- data/app/models/spree/state.rb +2 -5
- data/app/models/spree/state_change.rb +1 -1
- data/app/models/spree/tax_rate.rb +8 -1
- data/app/models/spree/taxon.rb +5 -1
- data/app/models/spree/taxonomy.rb +1 -1
- data/app/models/spree/tokenized_permission.rb +6 -0
- data/app/models/spree/tracker.rb +1 -1
- data/app/models/spree/variant.rb +13 -40
- data/app/models/spree/zone.rb +15 -14
- data/app/models/spree/zone_member.rb +1 -1
- data/app/views/spree/admin/image_settings/edit.html.erb +2 -2
- data/app/views/spree/admin/images/_form.html.erb +8 -4
- data/app/views/spree/admin/images/index.html.erb +1 -1
- data/app/views/spree/admin/line_items/create.js.erb +1 -1
- data/app/views/spree/admin/option_types/_option_value_fields.html.erb +1 -1
- data/app/views/spree/admin/option_types/index.html.erb +1 -1
- data/app/views/spree/admin/orders/_add_product.html.erb +1 -1
- data/app/views/spree/admin/orders/customer_details/edit.html.erb +1 -1
- data/app/views/spree/admin/orders/index.html.erb +4 -4
- data/app/views/spree/admin/orders/show.html.erb +1 -1
- data/app/views/spree/admin/payments/_form.html.erb +1 -1
- data/app/views/spree/admin/payments/new.html.erb +0 -4
- data/app/views/spree/admin/payments/source_forms/_gateway.html.erb +1 -1
- data/app/views/spree/admin/payments/source_views/_gateway.html.erb +2 -2
- data/app/views/spree/admin/products/_form.html.erb +21 -5
- data/app/views/spree/admin/products/index.html.erb +2 -2
- data/app/views/spree/admin/properties/_form.html.erb +1 -1
- data/app/views/spree/admin/properties/index.html.erb +1 -1
- data/app/views/spree/admin/return_authorizations/_form.html.erb +33 -17
- data/app/views/spree/admin/return_authorizations/edit.html.erb +2 -2
- data/app/views/spree/admin/shared/_address_form.html.erb +1 -1
- data/app/views/spree/admin/shared/_head.html.erb +12 -2
- data/app/views/spree/admin/shared/_order_tabs.html.erb +1 -4
- data/app/views/spree/admin/shared/_product_tabs.html.erb +0 -6
- data/app/views/spree/admin/shared/_show_resource_links.html.erb +3 -3
- data/app/views/spree/admin/shared/_tabs.html.erb +1 -2
- data/app/views/spree/admin/shipments/edit.html.erb +2 -2
- data/app/views/spree/admin/shipping_methods/_form.html.erb +1 -1
- data/app/views/spree/admin/states/_state_list.html.erb +1 -1
- data/app/views/spree/admin/tax_rates/index.html.erb +1 -1
- data/app/views/spree/admin/taxonomies/_form.html.erb +1 -1
- data/app/views/spree/admin/taxons/_form.html.erb +1 -1
- data/app/views/spree/admin/taxons/_taxon_table.html.erb +2 -2
- data/app/views/spree/admin/variants/_form.html.erb +13 -13
- data/app/views/spree/admin/variants/index.html.erb +1 -7
- data/app/views/spree/checkout/_address.html.erb +10 -4
- data/app/views/spree/checkout/edit.html.erb +0 -1
- data/app/views/spree/checkout/payment/_gateway.html.erb +5 -5
- data/app/views/spree/checkout/registration.html.erb +2 -2
- data/app/views/spree/content/cvv.html.erb +6 -6
- data/app/views/spree/layouts/spree_application.html.erb +4 -48
- data/app/views/spree/order_mailer/cancel_email.text.erb +5 -5
- data/app/views/spree/order_mailer/confirm_email.text.erb +6 -7
- data/app/views/spree/orders/_adjustments.html.erb +14 -0
- data/app/views/spree/orders/_form.html.erb +1 -0
- data/app/views/spree/orders/show.html.erb +3 -3
- data/app/views/spree/products/_thumbnails.html.erb +1 -1
- data/app/views/spree/products/index.html.erb +1 -1
- data/app/views/spree/shared/_footer.html.erb +6 -0
- data/app/views/spree/shared/_google_analytics.html.erb +15 -16
- data/app/views/spree/shared/_head.html.erb +3 -9
- data/app/views/spree/shared/_header.html.erb +5 -0
- data/app/views/spree/shared/_main_nav_bar.html.erb +6 -0
- data/app/views/spree/shared/_nav_bar.html.erb +7 -3
- data/app/views/spree/shared/_order_details.html.erb +14 -11
- data/app/views/spree/shared/_sidebar.html.erb +3 -0
- data/app/views/spree/shared/unauthorized.html.erb +0 -0
- data/app/views/spree/shipment_mailer/shipped_email.text.erb +7 -7
- data/app/views/spree/taxons/show.html.erb +1 -1
- data/config/initializers/check_for_orphaned_preferences.rb +1 -1
- data/config/initializers/spree.rb +0 -12
- data/config/initializers/user_class_extensions.rb +25 -0
- data/config/initializers/workarounds_for_ruby19.rb +72 -0
- data/config/locales/en.yml +11 -24
- data/config/routes.rb +7 -37
- data/db/migrate/20090823005402_spree_zero_nine_zero.rb +14 -12
- data/db/migrate/20091015153048_add_openid_field_to_users.rb +9 -7
- data/db/migrate/20100209144531_polymorphic_payments.rb +5 -5
- data/db/migrate/20100214212536_assign_creditcard_txns_to_payment.rb +4 -4
- data/db/migrate/20100528185820_add_index_on_users_persistence_token.rb +3 -1
- data/db/migrate/20100811163637_add_guest_flag.rb +3 -1
- data/db/migrate/20100901171814_change_guest_flag_to_anonymous.rb +3 -1
- data/db/migrate/20101026184959_generate_anonymous_users.rb +3 -3
- data/db/migrate/20101103212716_drop_anonymous_field_for_user.rb +3 -1
- data/db/migrate/20111007143030_namespace_top_level_models.rb +18 -1
- data/db/migrate/20120315064358_migrate_images_from_products_to_variants.rb +6 -4
- data/db/migrate/20120509055454_create_tokenized_permissions_table.rb +16 -0
- data/db/migrate/20120530012000_rename_creditcards_to_credit_cards.rb +11 -0
- data/db/migrate/20120604203654_remove_credit_total_from_orders.rb +5 -0
- data/lib/generators/spree/custom_user/custom_user_generator.rb +53 -0
- data/lib/generators/spree/custom_user/templates/authentication_helpers.rb.tt +28 -0
- data/lib/generators/spree/custom_user/templates/initializer.rb.tt +1 -0
- data/lib/generators/spree/custom_user/templates/migration.rb.tt +7 -0
- data/lib/generators/spree/dummy/dummy_generator.rb +3 -0
- data/lib/generators/spree/dummy/templates/initializers/custom_user.rb +1 -0
- data/lib/generators/spree/install/templates/app/assets/javascripts/admin/all.js +0 -1
- data/lib/generators/spree/install/templates/app/assets/javascripts/store/all.js +0 -1
- data/lib/generators/spree/install/templates/app/assets/stylesheets/admin/all.css +0 -1
- data/lib/generators/spree/install/templates/app/assets/stylesheets/store/all.css +0 -1
- data/lib/generators/spree/install/templates/config/initializers/spree.rb +2 -0
- data/lib/spree/core.rb +15 -2
- data/lib/spree/core/controller_helpers.rb +123 -62
- data/lib/spree/core/current_order.rb +5 -0
- data/lib/spree/core/engine.rb +1 -1
- data/lib/spree/core/mail_settings.rb +1 -2
- data/lib/spree/core/permalinks.rb +1 -5
- data/lib/spree/core/preference_rescue.rb +8 -4
- data/lib/spree/core/relation_serialization.rb +9 -0
- data/lib/spree/core/respond_with.rb +1 -1
- data/lib/spree/core/s3_support.rb +25 -0
- data/lib/spree/core/search/base.rb +2 -5
- data/lib/spree/core/ssl_requirement.rb +2 -2
- data/lib/spree/core/store_helpers.rb +1 -2
- data/lib/spree/core/testing_support/controller_requests.rb +1 -0
- data/lib/spree/core/testing_support/env.rb +2 -0
- data/lib/spree/core/testing_support/factories/{creditcard_factory.rb → credit_card_factory.rb} +3 -3
- data/lib/spree/core/testing_support/factories/payment_factory.rb +1 -1
- data/lib/spree/core/testing_support/factories/product_factory.rb +4 -4
- data/lib/spree/core/testing_support/factories/user_factory.rb +3 -3
- data/lib/spree/core/testing_support/factories/zone_factory.rb +2 -3
- data/lib/spree/core/token_resource.rb +27 -0
- data/lib/spree/core/version.rb +1 -1
- data/lib/spree/product_filters.rb +12 -13
- data/lib/tasks/core.rake +1 -1
- metadata +146 -154
- data/app/assets/images/noimage/large.png +0 -0
- data/app/assets/javascripts/admin/images/index.js +0 -10
- data/app/assets/javascripts/admin/images/new.js +0 -5
- data/app/assets/javascripts/admin/products.js +0 -2
- data/app/assets/javascripts/store/cart.js +0 -11
- data/app/assets/javascripts/store/checkout.js +0 -78
- data/app/assets/javascripts/store/product.js +0 -49
- data/app/controllers/spree/admin/users_controller.rb +0 -68
- data/app/views/spree/admin/option_types/_available.html.erb +0 -28
- data/app/views/spree/admin/option_types/_selected.html.erb +0 -26
- data/app/views/spree/admin/option_types/available.js.erb +0 -2
- data/app/views/spree/admin/option_types/select.js.erb +0 -3
- data/app/views/spree/admin/option_types/selected.html.erb +0 -6
- data/app/views/spree/admin/orders/history.html.erb +0 -29
- data/app/views/spree/admin/products/_option_types.html.erb +0 -40
- data/app/views/spree/admin/shared/_additional_field.html.erb +0 -5
- data/app/views/spree/admin/shared/_routes.html.erb +0 -8
- data/app/views/spree/admin/shared/_translations.html.erb +0 -17
- data/app/views/spree/admin/taxons/available.js.erb +0 -26
- data/app/views/spree/admin/taxons/remove.html.erb +0 -1
- data/app/views/spree/admin/taxons/select.js.erb +0 -2
- data/app/views/spree/admin/taxons/selected.html.erb +0 -42
- data/app/views/spree/admin/users/_form.html.erb +0 -19
- data/app/views/spree/admin/users/edit.html.erb +0 -14
- data/app/views/spree/admin/users/index.html.erb +0 -48
- data/app/views/spree/admin/users/new.html.erb +0 -14
- data/app/views/spree/admin/users/show.html.erb +0 -21
- data/app/views/spree/shared/_store_menu.html.erb +0 -2
- data/config/initializers/rails_5868.rb +0 -8
- data/db/migrate/20120605211305_make_users_email_index_unique.rb +0 -10
- data/db/migrate/20121017010007_remove_not_null_constraint_from_products_on_hand.rb +0 -11
- data/db/sample/users.rb +0 -61
- data/lib/generators/spree/sandbox/sandbox_generator.rb +0 -36
- data/lib/generators/spree/sandbox/templates/rails/routes.rb +0 -7
- data/lib/spree/core/ext/array.rb +0 -14
- data/lib/spree/core/ext/hash.rb +0 -75
- data/lib/spree/core/ext/string.rb +0 -10
- data/lib/tasks/install.rake +0 -18
@@ -1 +0,0 @@
|
|
1
|
-
<%= render :partial => 'taxon_table', :locals => { :taxons => @taxons } %>
|
@@ -1,42 +0,0 @@
|
|
1
|
-
<%= render :partial => 'spree/admin/shared/product_sub_menu' %>
|
2
|
-
|
3
|
-
<%= render :partial => 'spree/admin/shared/product_tabs', :locals => { :current => 'Taxons' } %>
|
4
|
-
<div id="selected-taxons" data-hook>
|
5
|
-
<%= render :partial => 'taxon_table', :locals => { :taxons => @taxons } %>
|
6
|
-
</div>
|
7
|
-
|
8
|
-
<%= form_tag '#' do %>
|
9
|
-
<%= label_tag nil, t(:search) %>:
|
10
|
-
<input id="searchtext" size="25">
|
11
|
-
<% end %>
|
12
|
-
|
13
|
-
<%= javascript_tag do %>
|
14
|
-
function search_for_taxons(){
|
15
|
-
$.ajax({
|
16
|
-
data: {q: $("#searchtext").val() },
|
17
|
-
dataType: 'html',
|
18
|
-
success: function(request){
|
19
|
-
jQuery('#search_hits').html(request);
|
20
|
-
},
|
21
|
-
type: 'POST',
|
22
|
-
url: '<%= available_admin_product_taxons_url(@product, :format => 'js') %>'
|
23
|
-
});
|
24
|
-
}
|
25
|
-
|
26
|
-
$("#searchtext").keypress(function (e) {
|
27
|
-
if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {
|
28
|
-
search_for_taxons();
|
29
|
-
|
30
|
-
return false;
|
31
|
-
} else {
|
32
|
-
return true;
|
33
|
-
}
|
34
|
-
});
|
35
|
-
|
36
|
-
$("#searchtext").delayedObserver(function() {
|
37
|
-
search_for_taxons();
|
38
|
-
}, 0.75);
|
39
|
-
<% end %>
|
40
|
-
<br />
|
41
|
-
<div id="search_hits" data-hook></div>
|
42
|
-
|
@@ -1,19 +0,0 @@
|
|
1
|
-
<div data-hook="admin_user_form_fields">
|
2
|
-
<%= f.field_container :email do %>
|
3
|
-
<%= f.label :email, t(:email) %><br />
|
4
|
-
<%= f.email_field :email %>
|
5
|
-
<%= error_message_on :user, :email %>
|
6
|
-
<% end %>
|
7
|
-
|
8
|
-
<%= f.field_container :password do %>
|
9
|
-
<%= f.label :password, t(:password) %><br />
|
10
|
-
<%= f.password_field :password %>
|
11
|
-
<%= f.error_message_on :password %>
|
12
|
-
<% end %>
|
13
|
-
|
14
|
-
<%= f.field_container :password do %>
|
15
|
-
<%= f.label :password_confirmation, t(:confirm_password) %><br />
|
16
|
-
<%= f.password_field :password_confirmation %>
|
17
|
-
<%= f.error_message_on :password_confirmation %>
|
18
|
-
<% end %>
|
19
|
-
</div>
|
@@ -1,14 +0,0 @@
|
|
1
|
-
<div data-hook="admin_user_edit_form_header">
|
2
|
-
<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @user } %>
|
3
|
-
<h1><%= t(:editing_user) %></h1>
|
4
|
-
</div>
|
5
|
-
|
6
|
-
<div data-hook="admin_user_edit_form">
|
7
|
-
<%= form_for [:admin, @user] do |f| %>
|
8
|
-
<%= render :partial => 'form', :locals => { :f => f } %>
|
9
|
-
|
10
|
-
<div data-hook="admin_user_edit_form_button">
|
11
|
-
<%= render :partial => 'spree/admin/shared/edit_resource_links' %>
|
12
|
-
</div>
|
13
|
-
<% end %>
|
14
|
-
</div>
|
@@ -1,48 +0,0 @@
|
|
1
|
-
<div class="toolbar" data-hook="toolbar">
|
2
|
-
<ul class="actions">
|
3
|
-
<li>
|
4
|
-
<p><%= button_link_to t(:new_user), new_object_url, :icon => 'add', :id => 'admin_new_user_link' %></p>
|
5
|
-
</li>
|
6
|
-
</ul>
|
7
|
-
<br class="clear" />
|
8
|
-
</div>
|
9
|
-
|
10
|
-
<h1><%= t(:listing_users) %></h1>
|
11
|
-
|
12
|
-
<table class="index" id="listing_users" data-hook>
|
13
|
-
<thead>
|
14
|
-
<tr data-hook="admin_users_index_headers">
|
15
|
-
<th><%= sort_link @search,:email, t(:user), {}, {:title => 'users_email_title'} %></th>
|
16
|
-
<th data-hook="admin_users_index_header_actions"></th>
|
17
|
-
</tr>
|
18
|
-
</thead>
|
19
|
-
<tbody>
|
20
|
-
<% @users.each do |user|%>
|
21
|
-
<tr id="<%= spree_dom_id user %>" data-hook="admin_users_index_rows">
|
22
|
-
<td width="350px" class='user_email'><%=link_to user.email, object_url(user) %></td>
|
23
|
-
<td data-hook="admin_users_index_row_actions">
|
24
|
-
<%= link_to_edit user, :class => 'edit' %>
|
25
|
-
<%= link_to_delete user %>
|
26
|
-
</td>
|
27
|
-
</tr>
|
28
|
-
<% end %>
|
29
|
-
</tbody>
|
30
|
-
</table>
|
31
|
-
|
32
|
-
<%= paginate @users %>
|
33
|
-
|
34
|
-
|
35
|
-
<% content_for :sidebar do %>
|
36
|
-
<div class="box" data-hook="admin_users_index_search">
|
37
|
-
<h3><%= t(:search) %></h3>
|
38
|
-
<%= search_form_for [:admin, @search] do |f| %>
|
39
|
-
<p>
|
40
|
-
<%= t(:email) %><br />
|
41
|
-
<%= f.text_field :email_cont, :size =>18 %>
|
42
|
-
</p>
|
43
|
-
<div data-hook="admin_users_index_search_buttons">
|
44
|
-
<p><%= button t(:search) %></p>
|
45
|
-
</div>
|
46
|
-
<% end %>
|
47
|
-
</div>
|
48
|
-
<% end %>
|
@@ -1,14 +0,0 @@
|
|
1
|
-
<div data-hook="admin_user_new_form_header">
|
2
|
-
<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @user } %>
|
3
|
-
<h1><%= t(:new_user) %></h1>
|
4
|
-
</div>
|
5
|
-
|
6
|
-
<div data-hook="admin_user_new_form">
|
7
|
-
<%= form_for [:admin, @user] do |f| %>
|
8
|
-
<%= render :partial => 'form', :locals => { :f => f } %>
|
9
|
-
|
10
|
-
<div data-hook="admin_user_new_form_buttons">
|
11
|
-
<%= render :partial => 'spree/admin/shared/new_resource_links' %>
|
12
|
-
</div>
|
13
|
-
<% end %>
|
14
|
-
</div>
|
@@ -1,21 +0,0 @@
|
|
1
|
-
<h1><%= t(:user_account) %></h1>
|
2
|
-
|
3
|
-
<table>
|
4
|
-
<tr data-hook="email">
|
5
|
-
<th><%= t(:email) %></th>
|
6
|
-
<td>
|
7
|
-
<%= @user.email %>
|
8
|
-
</td>
|
9
|
-
</tr>
|
10
|
-
<tr data-hook="roles">
|
11
|
-
<th><%= t(:roles) %></th>
|
12
|
-
<td>
|
13
|
-
<%= list_roles(@user) %>
|
14
|
-
</td>
|
15
|
-
</tr>
|
16
|
-
</table>
|
17
|
-
|
18
|
-
<p>
|
19
|
-
<%= link_to_edit @user, :class => 'edit_user' %> <%= t(:or) %>
|
20
|
-
<%= link_to t(:back), collection_url %>
|
21
|
-
</p>
|
@@ -1,10 +0,0 @@
|
|
1
|
-
class MakeUsersEmailIndexUnique < ActiveRecord::Migration
|
2
|
-
def up
|
3
|
-
add_index "spree_users", ["email"], :name => "email_idx_unique", :unique => true
|
4
|
-
end
|
5
|
-
|
6
|
-
def down
|
7
|
-
remove_index "spree_users", :name => "email_idx_unique"
|
8
|
-
add_index "spree_users", ["email"], :name => "email_idx_unique"
|
9
|
-
end
|
10
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
class RemoveNotNullConstraintFromProductsOnHand < ActiveRecord::Migration
|
2
|
-
def up
|
3
|
-
change_column :spree_products, :count_on_hand, :integer, :null => true
|
4
|
-
change_column :spree_variants, :count_on_hand, :integer, :null => true
|
5
|
-
end
|
6
|
-
|
7
|
-
def down
|
8
|
-
change_column :spree_products, :count_on_hand, :integer, :null => false
|
9
|
-
change_column :spree_variants, :count_on_hand, :integer, :null => false
|
10
|
-
end
|
11
|
-
end
|
data/db/sample/users.rb
DELETED
@@ -1,61 +0,0 @@
|
|
1
|
-
# # HACK - need to add all sample users to the 'user' role (can't do this in sample fixtures because user role is seed data)
|
2
|
-
# user_role = Spree::Role.find_by_name "user"
|
3
|
-
# if user_role
|
4
|
-
# User.all.each { |u| u.roles << user_role unless u.has_role?("user") }
|
5
|
-
# end
|
6
|
-
#
|
7
|
-
# # see last line where we create an admin if there is none, asking for email and password
|
8
|
-
#
|
9
|
-
# def prompt_for_admin_password
|
10
|
-
# password = ask('Password [spree]: ', String) do |q|
|
11
|
-
# q.echo = false
|
12
|
-
# q.validate = /^(|.{5,40})$/
|
13
|
-
# q.responses[:not_valid] = "Invalid password. Must be at least 5 characters long."
|
14
|
-
# q.whitespace = :strip
|
15
|
-
# end
|
16
|
-
# password = "spree" if password.blank?
|
17
|
-
# password
|
18
|
-
# end
|
19
|
-
#
|
20
|
-
# def prompt_for_admin_email
|
21
|
-
# email = ask('Email [spree@example.com]: ', String) do |q|
|
22
|
-
# q.echo = true
|
23
|
-
# q.whitespace = :strip
|
24
|
-
# end
|
25
|
-
# email = "spree@example.com" if email.blank?
|
26
|
-
# email
|
27
|
-
# end
|
28
|
-
#
|
29
|
-
# def create_admin_user
|
30
|
-
# if ENV['AUTO_ACCEPT']
|
31
|
-
# password = "spree"
|
32
|
-
# email = "spree@example.com"
|
33
|
-
# else
|
34
|
-
# require 'highline/import'
|
35
|
-
# puts "Create the admin user (press enter for defaults)."
|
36
|
-
# #name = prompt_for_admin_name unless name
|
37
|
-
# email = prompt_for_admin_email
|
38
|
-
# password = prompt_for_admin_password
|
39
|
-
# end
|
40
|
-
# attributes = {
|
41
|
-
# :password => password,
|
42
|
-
# :password_confirmation => password,
|
43
|
-
# :email => email,
|
44
|
-
# :login => email
|
45
|
-
# }
|
46
|
-
#
|
47
|
-
# load 'user.rb'
|
48
|
-
#
|
49
|
-
# if User.find_by_login(email)
|
50
|
-
# say "\nWARNING: There is already a user with the email: #{email}, so no account changes were made. If you wish to create an additional admin user, please run rake db:admin:create again with a different email.\n\n"
|
51
|
-
# else
|
52
|
-
# admin = User.create(attributes)
|
53
|
-
# # create an admin role and and assign the admin user to that role
|
54
|
-
# role = Spree::Role.find_or_create_by_name "admin"
|
55
|
-
# admin.roles << role
|
56
|
-
# admin.save
|
57
|
-
# end
|
58
|
-
# end
|
59
|
-
#
|
60
|
-
# create_admin_user unless User.first(:include => :roles, :conditions => ["roles.name = 'admin'"])
|
61
|
-
#
|
@@ -1,36 +0,0 @@
|
|
1
|
-
require "rails/generators/rails/app/app_generator"
|
2
|
-
|
3
|
-
module Spree
|
4
|
-
class SandboxGenerator < Spree::DummyGenerator
|
5
|
-
desc "Creates blank Rails application, installs Spree and all sample data"
|
6
|
-
|
7
|
-
def self.source_paths
|
8
|
-
paths = self.superclass.source_paths
|
9
|
-
paths.unshift File.expand_path('../templates', __FILE__)
|
10
|
-
paths.flatten
|
11
|
-
end
|
12
|
-
|
13
|
-
def drop_database
|
14
|
-
say "dropping database"
|
15
|
-
inside dummy_path do
|
16
|
-
quietly do
|
17
|
-
rake 'db:drop -f sandbox/Rakefile'
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
protected
|
23
|
-
def dummy_path
|
24
|
-
'sandbox'
|
25
|
-
end
|
26
|
-
|
27
|
-
def gemfile_path
|
28
|
-
'../../../Gemfile'
|
29
|
-
end
|
30
|
-
|
31
|
-
def module_name
|
32
|
-
'Sandbox'
|
33
|
-
end
|
34
|
-
|
35
|
-
end
|
36
|
-
end
|
data/lib/spree/core/ext/array.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
# RAILS3 TODO (likely not needed - it was commented out before rails3 branch)
|
2
|
-
# module Spree::Core::Ext::Array
|
3
|
-
# def to_hash_keys(&block)
|
4
|
-
# Hash[*self.collect { |v|
|
5
|
-
# [v, block.call(v)]
|
6
|
-
# }.flatten]
|
7
|
-
# end
|
8
|
-
#
|
9
|
-
# def to_hash_values(&block)
|
10
|
-
# Hash[*self.collect { |v|
|
11
|
-
# [block.call(v), v]
|
12
|
-
# }.flatten]
|
13
|
-
# end
|
14
|
-
# end
|
data/lib/spree/core/ext/hash.rb
DELETED
@@ -1,75 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# = Hash Recursive Merge
|
3
|
-
#
|
4
|
-
# Merges a Ruby Hash recursively, Also known as deep merge.
|
5
|
-
# Recursive version of Hash#merge and Hash#merge!.
|
6
|
-
#
|
7
|
-
# Category:: Ruby
|
8
|
-
# Package:: Hash
|
9
|
-
# Author:: Simone Carletti <weppos@weppos.net>
|
10
|
-
# Copyright:: 2007-2008 The Authors
|
11
|
-
# License:: MIT License
|
12
|
-
# Link:: http://www.simonecarletti.com/
|
13
|
-
# Source:: http://gist.github.com/gists/6391/
|
14
|
-
#
|
15
|
-
module HashRecursiveMerge
|
16
|
-
|
17
|
-
#
|
18
|
-
# Recursive version of Hash#merge!
|
19
|
-
#
|
20
|
-
# Adds the contents of +other_hash+ to +hsh+,
|
21
|
-
# merging entries in +hsh+ with duplicate keys with those from +other_hash+.
|
22
|
-
#
|
23
|
-
# Compared with Hash#merge!, this method supports nested hashes.
|
24
|
-
# When both +hsh+ and +other_hash+ contains an entry with the same key,
|
25
|
-
# it merges and returns the values from both arrays.
|
26
|
-
#
|
27
|
-
# h1 = {"a" => 100, "b" => 200, "c" => {"c1" => 12, "c2" => 14}}
|
28
|
-
# h2 = {"b" => 254, "c" => 300, "c" => {"c1" => 16, "c3" => 94}}
|
29
|
-
# h1.rmerge!(h2) #=> {"a" => 100, "b" => 254, "c" => {"c1" => 16, "c2" => 14, "c3" => 94}}
|
30
|
-
#
|
31
|
-
# Simply using Hash#merge! would return
|
32
|
-
#
|
33
|
-
# h1.merge!(h2) #=> {"a" => 100, "b" = >254, "c" => {"c1" => 16, "c3" => 94}}
|
34
|
-
#
|
35
|
-
def rmerge!(other_hash)
|
36
|
-
merge!(other_hash) do |key, oldval, newval|
|
37
|
-
oldval.class == self.class ? oldval.rmerge!(newval) : newval
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
#
|
42
|
-
# Recursive version of Hash#merge
|
43
|
-
#
|
44
|
-
# Compared with Hash#merge!, this method supports nested hashes.
|
45
|
-
# When both +hsh+ and +other_hash+ contains an entry with the same key,
|
46
|
-
# it merges and returns the values from both arrays.
|
47
|
-
#
|
48
|
-
# Compared with Hash#merge, this method provides a different approch
|
49
|
-
# for merging nasted hashes.
|
50
|
-
# If the value of a given key is an Hash and both +other_hash+ abd +hsh
|
51
|
-
# includes the same key, the value is merged instead replaced with
|
52
|
-
# +other_hash+ value.
|
53
|
-
#
|
54
|
-
# h1 = {"a" => 100, "b" => 200, "c" => {"c1" => 12, "c2" => 14}}
|
55
|
-
# h2 = {"b" => 254, "c" => 300, "c" => {"c1" => 16, "c3" => 94}}
|
56
|
-
# h1.rmerge(h2) #=> {"a" => 100, "b" => 254, "c" => {"c1" => 16, "c2" => 14, "c3" => 94}}
|
57
|
-
#
|
58
|
-
# Simply using Hash#merge would return
|
59
|
-
#
|
60
|
-
# h1.merge(h2) #=> {"a" => 100, "b" = >254, "c" => {"c1" => 16, "c3" => 94}}
|
61
|
-
#
|
62
|
-
def rmerge(other_hash)
|
63
|
-
r = {}
|
64
|
-
merge(other_hash) do |key, oldval, newval|
|
65
|
-
r[key] = oldval.class == self.class ? oldval.rmerge(newval) : newval
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
end
|
70
|
-
|
71
|
-
|
72
|
-
class Hash
|
73
|
-
include HashRecursiveMerge
|
74
|
-
end
|
75
|
-
|
data/lib/tasks/install.rake
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
namespace :spree_core do
|
2
|
-
task_warning = "[WARNING] This task has been removed, please run Rails default task: rake railties:install:migrations"
|
3
|
-
task :install do
|
4
|
-
puts task_warning
|
5
|
-
end
|
6
|
-
|
7
|
-
namespace :install do
|
8
|
-
|
9
|
-
task :migrations do
|
10
|
-
puts task_warning
|
11
|
-
end
|
12
|
-
|
13
|
-
task :assets do
|
14
|
-
puts "[WARNING] This task is no longer required, and has been replaced with standard Rails 3.1 asset pipeline"
|
15
|
-
end
|
16
|
-
|
17
|
-
end
|
18
|
-
end
|