radiant-shop-extension 0.10.0 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +5 -1
- data/VERSION +1 -1
- data/app/controllers/admin/shop/categories_controller.rb +32 -65
- data/app/controllers/admin/shop/customers_controller.rb +8 -7
- data/app/controllers/admin/shop/orders_controller.rb +37 -159
- data/app/controllers/admin/shop/packages/packings_controller.rb +90 -0
- data/app/controllers/admin/shop/packages_controller.rb +65 -0
- data/app/controllers/admin/shop/products/images_controller.rb +5 -8
- data/app/controllers/admin/shop/products/variant_templates_controller.rb +27 -0
- data/app/controllers/admin/shop/products/variants_controller.rb +60 -0
- data/app/controllers/admin/shop/products_controller.rb +67 -64
- data/app/controllers/admin/shop/variants_controller.rb +49 -0
- data/app/helpers/shop_helper.rb +5 -0
- data/app/models/form_address.rb +144 -0
- data/app/models/form_checkout.rb +200 -307
- data/app/models/form_line_item.rb +60 -0
- data/app/models/shop_address.rb +2 -2
- data/app/models/shop_category.rb +48 -51
- data/app/models/shop_customer.rb +25 -5
- data/app/models/shop_group.rb +15 -0
- data/app/models/shop_grouping.rb +6 -0
- data/app/models/shop_line_item.rb +7 -6
- data/app/models/shop_order.rb +44 -16
- data/app/models/shop_package.rb +74 -0
- data/app/models/shop_packing.rb +22 -0
- data/app/models/shop_page.rb +7 -0
- data/app/models/shop_payment.rb +5 -1
- data/app/models/shop_product.rb +86 -48
- data/app/models/shop_product_attachment.rb +5 -2
- data/app/models/shop_product_variant.rb +31 -0
- data/app/models/shop_variant.rb +25 -0
- data/app/views/admin/shop/categories/edit.html.haml +9 -10
- data/app/views/admin/shop/categories/edit/_foot.html.haml +9 -0
- data/app/views/admin/shop/categories/edit/_form.html.haml +14 -0
- data/app/views/admin/shop/categories/edit/_head.html.haml +4 -2
- data/app/views/admin/shop/categories/edit/_inputs.html.haml +2 -0
- data/app/views/admin/shop/categories/edit/_meta.html.haml +8 -7
- data/app/views/admin/shop/categories/edit/_parts.html.haml +9 -0
- data/app/views/admin/shop/categories/edit/_popups.html.haml +4 -0
- data/app/views/admin/shop/categories/edit/inputs/_name.html.haml +4 -0
- data/app/views/admin/shop/categories/edit/meta/_handle.html.haml +6 -5
- data/app/views/admin/shop/categories/edit/meta/_layouts.html.haml +6 -5
- data/app/views/admin/shop/categories/edit/meta/_page.html.haml +3 -0
- data/app/views/admin/shop/categories/edit/parts/_description.html.haml +4 -1
- data/app/views/admin/shop/categories/index/_category.html.haml +11 -10
- data/app/views/admin/shop/categories/new.html.haml +10 -9
- data/app/views/admin/shop/customers/edit.html.haml +8 -10
- data/app/views/admin/shop/customers/edit/_foot.html.haml +9 -0
- data/app/views/admin/shop/customers/edit/_form.html.haml +13 -0
- data/app/views/admin/shop/customers/edit/_head.html.haml +4 -2
- data/app/views/admin/shop/customers/edit/_inputs.html.haml +2 -0
- data/app/views/admin/shop/customers/edit/_parts.html.haml +9 -4
- data/app/views/admin/shop/customers/edit/inputs/_email.html.haml +3 -0
- data/app/views/admin/shop/customers/edit/inputs/_name.html.haml +3 -0
- data/app/views/admin/shop/customers/edit/parts/_orders.html.haml +10 -6
- data/app/views/admin/shop/customers/index.html.haml +4 -1
- data/app/views/admin/shop/customers/index/_customer.html.haml +3 -3
- data/app/views/admin/shop/customers/index/_foot.html.haml +4 -0
- data/app/views/admin/shop/customers/index/_head.html.haml +4 -0
- data/app/views/admin/shop/customers/new.html.haml +9 -9
- data/app/views/admin/shop/orders/edit.html.haml +11 -0
- data/app/views/admin/shop/orders/edit/_foot.html.haml +9 -0
- data/app/views/admin/shop/orders/edit/_form.html.haml +13 -0
- data/app/views/admin/shop/orders/edit/_head.html.haml +4 -0
- data/app/views/admin/shop/orders/edit/_inputs.html.haml +2 -0
- data/app/views/admin/shop/orders/edit/_meta.html.haml +8 -0
- data/app/views/admin/shop/orders/edit/_parts.html.haml +9 -0
- data/app/views/admin/shop/orders/edit/_popups.html.haml +4 -0
- data/app/views/admin/shop/orders/edit/parts/_address.html.haml +7 -0
- data/app/views/admin/shop/orders/edit/parts/_addresses.html.haml +9 -0
- data/app/views/admin/shop/orders/edit/parts/_customer.html.haml +3 -0
- data/app/views/admin/shop/orders/edit/parts/_items.html.haml +8 -0
- data/app/views/admin/shop/orders/index.html.haml +10 -30
- data/app/views/admin/shop/orders/index/_foot.html.haml +3 -0
- data/app/views/admin/shop/orders/index/_head.html.haml +4 -0
- data/app/views/admin/shop/orders/index/_order.html.haml +13 -0
- data/app/views/admin/shop/orders/index/buttons/_all.html.haml +1 -0
- data/app/views/admin/shop/orders/index/buttons/_new.html.haml +1 -0
- data/app/views/admin/shop/orders/index/buttons/_paid.html.haml +1 -0
- data/app/views/admin/shop/orders/index/buttons/_shipped.html.haml +1 -0
- data/app/views/admin/shop/packages/edit.html.haml +11 -0
- data/app/views/admin/shop/packages/edit/_foot.html.haml +17 -0
- data/app/views/admin/shop/packages/edit/_form.html.haml +15 -0
- data/app/views/admin/shop/packages/edit/_head.html.haml +4 -0
- data/app/views/admin/shop/packages/edit/_inputs.html.haml +2 -0
- data/app/views/admin/shop/packages/edit/_meta.html.haml +8 -0
- data/app/views/admin/shop/packages/edit/_parts.html.haml +9 -0
- data/app/views/admin/shop/packages/edit/_popups.html.haml +4 -0
- data/app/views/admin/shop/packages/edit/buttons/_browse_products.html.haml +1 -0
- data/app/views/admin/shop/packages/edit/inputs/_name.html.haml +3 -0
- data/app/views/admin/shop/packages/edit/inputs/_price.html.haml +3 -0
- data/app/views/admin/shop/packages/edit/meta/_sku.html.haml +5 -0
- data/app/views/admin/shop/packages/edit/parts/_description.html.haml +1 -0
- data/app/views/admin/shop/packages/edit/parts/_products.html.haml +3 -0
- data/app/views/admin/shop/packages/edit/popups/_browse_products.html.haml +7 -0
- data/app/views/admin/shop/packages/edit/shared/_product.html.haml +8 -0
- data/app/views/admin/shop/packages/index.html.haml +13 -0
- data/app/views/admin/shop/packages/index/_foot.html.haml +7 -0
- data/app/views/admin/shop/packages/index/_head.html.haml +4 -0
- data/app/views/admin/shop/packages/index/_package.html.haml +9 -0
- data/app/views/admin/shop/packages/new.html.haml +11 -0
- data/app/views/admin/shop/packages/remove.html.haml +12 -0
- data/app/views/admin/shop/products/edit.html.haml +9 -12
- data/app/views/admin/shop/products/edit/_foot.html.haml +19 -0
- data/app/views/admin/shop/products/edit/_form.html.haml +15 -0
- data/app/views/admin/shop/products/edit/_head.html.haml +4 -2
- data/app/views/admin/shop/products/edit/_inputs.html.haml +2 -0
- data/app/views/admin/shop/products/edit/_meta.html.haml +8 -8
- data/app/views/admin/shop/products/edit/_parts.html.haml +9 -0
- data/app/views/admin/shop/products/edit/_popups.html.haml +4 -0
- data/app/views/admin/shop/products/edit/buttons/_browse_images.html.haml +1 -1
- data/app/views/admin/shop/products/edit/buttons/_browse_templates.html.haml +1 -0
- data/app/views/admin/shop/products/edit/buttons/_new_image.html.haml +1 -1
- data/app/views/admin/shop/products/edit/buttons/_new_variant.html.haml +1 -0
- data/app/views/admin/shop/products/edit/inputs/_name.html.haml +4 -0
- data/app/views/admin/shop/products/edit/inputs/_price.html.haml +3 -0
- data/app/views/admin/shop/products/edit/meta/_category.html.haml +6 -5
- data/app/views/admin/shop/products/edit/meta/_page.html.haml +2 -0
- data/app/views/admin/shop/products/edit/meta/_sku.html.haml +6 -5
- data/app/views/admin/shop/products/edit/parts/_customers.html.haml +5 -0
- data/app/views/admin/shop/products/edit/parts/_description.html.haml +4 -1
- data/app/views/admin/shop/products/edit/parts/_images.html.haml +1 -1
- data/app/views/admin/shop/products/edit/parts/_variants.html.haml +3 -0
- data/app/views/admin/shop/products/edit/popups/_browse_images.html.haml +1 -1
- data/app/views/admin/shop/products/edit/popups/_browse_templates.html.haml +6 -0
- data/app/views/admin/shop/products/edit/popups/_new_image.html.haml +4 -4
- data/app/views/admin/shop/products/edit/popups/_new_variant.html.haml +16 -0
- data/app/views/admin/shop/products/edit/{_image.html.haml → shared/_image.html.haml} +0 -0
- data/app/views/admin/shop/products/edit/shared/_template.html.haml +6 -0
- data/app/views/admin/shop/products/edit/shared/_variant.html.haml +10 -0
- data/app/views/admin/shop/products/index.html.haml +6 -3
- data/app/views/admin/shop/products/index/_foot.html.haml +10 -0
- data/app/views/admin/shop/products/index/_head.html.haml +4 -0
- data/app/views/admin/shop/products/index/_product.html.haml +18 -10
- data/app/views/admin/shop/products/index/buttons/_discounts.html.haml +1 -0
- data/app/views/admin/shop/products/index/buttons/_packages.html.haml +1 -0
- data/app/views/admin/shop/products/index/buttons/_variants.html.haml +1 -0
- data/app/views/admin/shop/products/new.html.haml +10 -9
- data/app/views/admin/shop/variants/edit.html.haml +11 -0
- data/app/views/admin/shop/variants/edit/_foot.html.haml +9 -0
- data/app/views/admin/shop/variants/edit/_form.html.haml +13 -0
- data/app/views/admin/shop/variants/edit/_head.html.haml +4 -0
- data/app/views/admin/shop/variants/edit/_inputs.html.haml +2 -0
- data/app/views/admin/shop/variants/edit/_meta.html.haml +8 -0
- data/app/views/admin/shop/variants/edit/_parts.html.haml +9 -0
- data/app/views/admin/shop/variants/edit/_popups.html.haml +4 -0
- data/app/views/admin/shop/variants/edit/inputs/_name.html.haml +3 -0
- data/app/views/admin/shop/variants/edit/inputs/_options.html.haml +3 -0
- data/app/views/admin/shop/variants/index.html.haml +13 -0
- data/app/views/admin/shop/variants/index/_foot.html.haml +4 -0
- data/app/views/admin/shop/variants/index/_head.html.haml +4 -0
- data/app/views/admin/shop/variants/index/_variant.html.haml +9 -0
- data/app/views/admin/shop/variants/new.html.haml +11 -0
- data/app/views/admin/shop/variants/remove.html.haml +12 -0
- data/config/locales/en.yml +8 -1
- data/config/routes.rb +11 -22
- data/db/migrate/20100929011106_fix_relationship_foreign_keys.rb +101 -0
- data/db/migrate/20100929011607_drop_shop_addressables.rb +25 -0
- data/db/migrate/20100929030510_create_shop_groups.rb +19 -0
- data/db/migrate/20100929080301_shop_groups_change_add_description.rb +11 -0
- data/db/migrate/20100929081200_create_variants.rb +20 -0
- data/db/migrate/20100929143531_change_variants_add_updated_by.rb +25 -0
- data/db/migrate/20100929145641_change_created_by_to_id.rb +75 -0
- data/db/migrate/20100929235221_change_category_add_variant_id.rb +9 -0
- data/db/migrate/20100930235221_create_packages.rb +31 -0
- data/db/migrate/20101005231713_create_page_ids.rb +11 -0
- data/db/migrate/20101006051214_create_pages_for_products_and_categories.rb +73 -0
- data/db/migrate/20101007111845_add_default_position_to_attachment.rb +9 -0
- data/lib/shop/controllers/application_controller.rb +1 -1
- data/lib/shop/interface/categories.rb +29 -0
- data/lib/shop/interface/customers.rb +15 -15
- data/lib/shop/interface/orders.rb +34 -0
- data/lib/shop/interface/packages.rb +34 -0
- data/lib/shop/interface/products.rb +18 -31
- data/lib/shop/interface/variants.rb +34 -0
- data/lib/shop/models/form_extension.rb +23 -0
- data/lib/shop/models/page.rb +3 -2
- data/lib/shop/tags/address.rb +3 -3
- data/lib/shop/tags/cart.rb +12 -16
- data/lib/shop/tags/category.rb +4 -6
- data/lib/shop/tags/helpers.rb +131 -30
- data/lib/shop/tags/item.rb +16 -33
- data/lib/shop/tags/package.rb +95 -0
- data/lib/shop/tags/product.rb +11 -16
- data/lib/shop/tags/product_variant.rb +52 -0
- data/mockups/discounts/new-edit.bmml +492 -0
- data/public/javascripts/admin/extensions/shop/edit.js +20 -0
- data/public/javascripts/admin/extensions/shop/packages/edit.js +109 -0
- data/public/javascripts/admin/extensions/shop/products/edit.js +64 -65
- data/public/javascripts/admin/extensions/shop/products/index.js +31 -36
- data/public/stylesheets/sass/admin/extensions/shop/edit.sass +58 -11
- data/public/stylesheets/sass/admin/extensions/shop/index.sass +104 -53
- data/public/stylesheets/sass/admin/extensions/shop/packages/edit.sass +162 -0
- data/public/stylesheets/sass/admin/extensions/shop/products/edit.sass +115 -36
- data/public/stylesheets/sass/admin/extensions/shop/products/index.sass +12 -20
- data/radiant-shop-extension.gemspec +182 -38
- data/shop_extension.rb +29 -25
- data/spec/controllers/admin/shop/categories_controller_spec.rb +76 -191
- data/spec/controllers/admin/shop/customers_controller_spec.rb +67 -0
- data/spec/controllers/admin/shop/orders_controller_spec.rb +85 -0
- data/spec/controllers/admin/shop/packages/packings_controller_spec.rb +188 -0
- data/spec/controllers/admin/shop/packages_controller_spec.rb +32 -0
- data/spec/controllers/admin/shop/products/images_controller_spec.rb +10 -15
- data/spec/controllers/admin/shop/products/variant_templates_controller_spec.rb +53 -0
- data/spec/controllers/admin/shop/products/variants_controller_spec.rb +116 -0
- data/spec/controllers/admin/shop/products_controller_spec.rb +80 -148
- data/spec/controllers/admin/shop/variants_controller_spec.rb +67 -0
- data/spec/datasets/forms.rb +23 -8
- data/spec/datasets/shop_addresses.rb +1 -4
- data/spec/datasets/shop_categories.rb +25 -4
- data/spec/datasets/shop_groups.rb +15 -0
- data/spec/datasets/shop_line_items.rb +4 -3
- data/spec/datasets/shop_orders.rb +6 -15
- data/spec/datasets/shop_packages.rb +25 -0
- data/spec/datasets/shop_payments.rb +12 -0
- data/spec/datasets/{images.rb → shop_product_attachments.rb} +9 -1
- data/spec/datasets/shop_product_variants.rb +22 -0
- data/spec/datasets/shop_products.rb +28 -18
- data/spec/datasets/shop_variants.rb +17 -0
- data/spec/lib/shop/models/image_spec.rb +4 -4
- data/spec/lib/shop/tags/address_spec.rb +3 -3
- data/spec/lib/shop/tags/cart_spec.rb +32 -43
- data/spec/lib/shop/tags/category_spec.rb +58 -93
- data/spec/lib/shop/tags/helpers_spec.rb +162 -69
- data/spec/lib/shop/tags/item_spec.rb +116 -158
- data/spec/lib/shop/tags/package_spec.rb +342 -0
- data/spec/lib/shop/tags/product_spec.rb +29 -26
- data/spec/lib/shop/tags/product_variant_spec.rb +175 -0
- data/spec/models/form_address_spec.rb +166 -0
- data/spec/models/form_checkout_spec.rb +27 -157
- data/spec/models/shop_address_spec.rb +81 -0
- data/spec/models/shop_category_spec.rb +114 -31
- data/spec/models/shop_customer_spec.rb +105 -0
- data/spec/models/shop_group_spec.rb +38 -0
- data/spec/models/shop_line_item_spec.rb +5 -5
- data/spec/models/shop_order_spec.rb +89 -83
- data/spec/models/shop_package_spec.rb +117 -0
- data/spec/models/shop_packing_spec.rb +67 -0
- data/spec/models/shop_payment_spec.rb +19 -0
- data/spec/models/shop_product_attachment_spec.rb +4 -3
- data/spec/models/shop_product_spec.rb +171 -92
- data/spec/models/shop_product_variant_spec.rb +92 -0
- data/spec/models/shop_variant_spec.rb +47 -0
- metadata +183 -39
- data/app/controllers/shop/categories_controller.rb +0 -45
- data/app/controllers/shop/line_items_controller.rb +0 -165
- data/app/controllers/shop/orders_controller.rb +0 -16
- data/app/controllers/shop/products_controller.rb +0 -48
- data/app/models/shop_addressable.rb +0 -11
- data/app/views/admin/shop/categories/edit/_fields.html.haml +0 -28
- data/app/views/admin/shop/categories/edit/_part.html.haml +0 -3
- data/app/views/admin/shop/categories/edit/_popup.html.haml +0 -3
- data/app/views/admin/shop/customers/edit/_fields.html.haml +0 -33
- data/app/views/admin/shop/customers/index/_bottom.html.haml +0 -4
- data/app/views/admin/shop/products/edit/_fields.html.haml +0 -38
- data/app/views/admin/shop/products/edit/_part.html.haml +0 -3
- data/app/views/admin/shop/products/edit/_popup.html.haml +0 -3
- data/app/views/admin/shop/products/index/_bottom.html.haml +0 -5
- data/spec/controllers/shop/categories_controller_spec.rb +0 -42
- data/spec/controllers/shop/line_items_controller_spec.rb +0 -256
- data/spec/controllers/shop/orders_controller_specs.rb +0 -37
- data/spec/controllers/shop/products_controller_spec.rb +0 -51
- data/vendor/plugins/json_fields/.gitignore +0 -3
- data/vendor/plugins/json_fields/MIT-LICENSE +0 -20
- data/vendor/plugins/json_fields/README.rdoc +0 -65
- data/vendor/plugins/json_fields/Rakefile +0 -55
- data/vendor/plugins/json_fields/init.rb +0 -2
- data/vendor/plugins/json_fields/lib/json_fields.rb +0 -99
- data/vendor/plugins/json_fields/spec/lib/json_fields_spec.rb +0 -124
- data/vendor/plugins/json_fields/spec/spec.opts +0 -6
- data/vendor/plugins/json_fields/spec/spec_helper.rb +0 -29
- data/vendor/plugins/json_fields/spec/test_models.rb +0 -12
@@ -0,0 +1,10 @@
|
|
1
|
+
%ul
|
2
|
+
- render_region :foot do |foot|
|
3
|
+
- foot.add do
|
4
|
+
%li= link_to image('plus') + " " + t("add_category"), new_admin_shop_category_path
|
5
|
+
|
6
|
+
:javascript
|
7
|
+
if(typeof(ROUTES) === 'undefined') ROUTES = new Array();
|
8
|
+
|
9
|
+
ROUTES['sort_admin_shop_categories_path'] = "#{sort_admin_shop_categories_path}";
|
10
|
+
ROUTES['sort_admin_shop_products_path'] = "#{sort_admin_shop_products_path}";
|
@@ -1,13 +1,21 @@
|
|
1
|
-
%li.product{:id => "
|
1
|
+
%li.product.object{:id => "product_#{product.id}", :'data-id' => product.id}
|
2
2
|
.attributes
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
- render_region :product do |body|
|
4
|
+
- body.move do
|
5
|
+
%span.move.attribute
|
6
|
+
- body.icon do
|
7
|
+
- link_to [:edit_admin, product], :class => 'icon' do
|
7
8
|
- unless product.attachments.empty?
|
8
|
-
|
9
|
-
|
10
|
-
%span.
|
11
|
-
|
9
|
+
= image_tag product.attachments.first.image.url(:preview)
|
10
|
+
- body.name do
|
11
|
+
%span.name.attribute
|
12
|
+
- link_to [:edit_admin, product] do
|
13
|
+
= number_to_currency(product.price)
|
14
|
+
= product.name
|
15
|
+
- body.sku do
|
16
|
+
%span.sku.attribute
|
17
|
+
= product.sku
|
18
|
+
- body.modify do
|
12
19
|
.modify
|
13
|
-
%span.remove
|
20
|
+
%span.remove
|
21
|
+
= link_to t('remove'), [:remove_admin, product]
|
@@ -0,0 +1 @@
|
|
1
|
+
=# link_to t("discounts"), admin_shop_packages_path, :class => 'button'
|
@@ -0,0 +1 @@
|
|
1
|
+
= link_to t("packages"), admin_shop_packages_path, :class => "button #{controller.controller_name == 'packages' ? 'active' : ''}"
|
@@ -0,0 +1 @@
|
|
1
|
+
= link_to t("variants"), admin_shop_variants_path, :class => "button #{controller.controller_name == 'variants' ? 'active' : ''}"
|
@@ -1,10 +1,11 @@
|
|
1
|
+
- @page_title = t('new_product')
|
2
|
+
|
1
3
|
- render_region :main do |main|
|
2
|
-
- main.
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
- #empty
|
4
|
+
- main.head do
|
5
|
+
= render 'admin/shop/products/edit/head'
|
6
|
+
|
7
|
+
- main.popups do
|
8
|
+
= render 'admin/shop/products/edit/popups'
|
9
|
+
|
10
|
+
- main.form do
|
11
|
+
= render 'admin/shop/products/edit/form'
|
@@ -0,0 +1,11 @@
|
|
1
|
+
- @page_title = @shop_variant.name
|
2
|
+
|
3
|
+
- render_region :main do |main|
|
4
|
+
- main.head do
|
5
|
+
= render 'admin/shop/variants/edit/head'
|
6
|
+
|
7
|
+
- main.popups do
|
8
|
+
= render 'admin/shop/variants/edit/popups'
|
9
|
+
|
10
|
+
- main.form do
|
11
|
+
= render 'admin/shop/variants/edit/form'
|
@@ -0,0 +1,9 @@
|
|
1
|
+
- render_region :foot do |foot|
|
2
|
+
- foot.buttons do
|
3
|
+
%p.buttons
|
4
|
+
= save_model_button(@shop_variant)
|
5
|
+
= save_model_and_continue_editing_button(@shop_variant)
|
6
|
+
= t('or')
|
7
|
+
= link_to t('cancel'), admin_shop_variants_path
|
8
|
+
- foot.timestamp do
|
9
|
+
= updated_stamp @shop_variant
|
@@ -0,0 +1,13 @@
|
|
1
|
+
- form_for [:admin, @shop_variant], :html => {'data-onsubmit_status'=>"Saving Changes…"} do |f|
|
2
|
+
- render_region :form do |form|
|
3
|
+
- form.inputs do
|
4
|
+
= render :partial => '/admin/shop/variants/edit/inputs', :locals => { :f => f }
|
5
|
+
|
6
|
+
- form.meta do
|
7
|
+
= render :partial => '/admin/shop/variants/edit/meta', :locals => { :f => f }
|
8
|
+
|
9
|
+
- form.parts do
|
10
|
+
= render :partial => '/admin/shop/variants/edit/parts', :locals => { :f => f }
|
11
|
+
|
12
|
+
- form.foot do
|
13
|
+
= render :partial => 'admin/shop/variants/edit/foot', :locals => { :f => f }
|
@@ -0,0 +1,8 @@
|
|
1
|
+
- if @meta.present?
|
2
|
+
.drawer
|
3
|
+
.drawer_contents#attributes
|
4
|
+
%table.fieldset
|
5
|
+
- @meta.each do |meta|
|
6
|
+
= render :partial => "admin/shop/variants/edit/meta/#{meta}", :locals => { :f => f }
|
7
|
+
.drawer_handle
|
8
|
+
%a.toggle{:href=>'#attributes', :rel=>"toggle[attributes]", :class=>"#{(meta_errors? ? 'less' : 'more')}"}= meta_label
|
@@ -0,0 +1,9 @@
|
|
1
|
+
#tab_control
|
2
|
+
#tabs.tabs
|
3
|
+
#tab_toolbar
|
4
|
+
#pages.pages
|
5
|
+
= hidden_field_tag 'page_part_index_field' #important
|
6
|
+
- @parts.each do |part|
|
7
|
+
.page{:id => "variant_page_#{part}", 'data-caption'=>h(part)}
|
8
|
+
.part{:id => "variant_part_#{part}"}
|
9
|
+
= render :partial => "admin/shop/variants/edit/parts/#{part}", :locals => { :f => f }
|
@@ -0,0 +1,13 @@
|
|
1
|
+
- @page_title = t('variants') + ' - ' + default_page_title
|
2
|
+
|
3
|
+
.outset
|
4
|
+
|
5
|
+
#head{ :class => "#{@buttons.empty? ? 'min' : 'full'}"}
|
6
|
+
= render :partial => '/admin/shop/variants/index/head'
|
7
|
+
|
8
|
+
#variants_map.map
|
9
|
+
%ul#variants
|
10
|
+
= render :partial => '/admin/shop/variants/index/variant', :collection => @shop_variants
|
11
|
+
|
12
|
+
#actions
|
13
|
+
= render :partial => '/admin/shop/variants/index/foot'
|
@@ -0,0 +1,9 @@
|
|
1
|
+
%li.variant.object{:id => "variant_#{variant.id}", :'data-id' => variant.id}
|
2
|
+
.attributes
|
3
|
+
%span.name.attribute
|
4
|
+
- render_region :body do |body|
|
5
|
+
- body.name do
|
6
|
+
%span.name.attribute= link_to variant.name, edit_admin_shop_variant_path(variant)
|
7
|
+
- body.modify do
|
8
|
+
.modify
|
9
|
+
%span.remove= link_to t('remove'), remove_admin_shop_variant_path(variant)
|
@@ -0,0 +1,12 @@
|
|
1
|
+
%h1
|
2
|
+
= t('remove_variant')
|
3
|
+
|
4
|
+
%p
|
5
|
+
= t('text.remove_variant.warning')
|
6
|
+
|
7
|
+
- form_for [:admin, @shop_variant.becomes(ShopVariant)], :html => {:method => :delete, 'data-onsubmit_status'=>"Removing Variant…"} do
|
8
|
+
|
9
|
+
%p.buttons
|
10
|
+
%input.button{:type=>"submit", :value => t('delete_variant') }/
|
11
|
+
= t('or')
|
12
|
+
= link_to t('cancel'), admin_shop_variants_path
|
data/config/locales/en.yml
CHANGED
@@ -48,7 +48,14 @@ en:
|
|
48
48
|
browse_images: "Browse Images"
|
49
49
|
caption: "Caption"
|
50
50
|
price: "Price"
|
51
|
-
sku: "
|
51
|
+
sku: "sku"
|
52
|
+
variant_templates: "Variant Templates"
|
53
|
+
product_groups: "Product Groups"
|
54
|
+
variant: "Variant"
|
55
|
+
new_variant: "New Variant"
|
56
|
+
price_variation: "Price Variation"
|
57
|
+
templates: "Templates"
|
58
|
+
apply_template: "Apply Template"
|
52
59
|
text:
|
53
60
|
remove_customer:
|
54
61
|
warning: "Deleting a customer is irreversible and will also delete their orders and addresses, make sure you're sure."
|
data/config/routes.rb
CHANGED
@@ -1,40 +1,29 @@
|
|
1
1
|
ActionController::Routing::Routes.draw do |map|
|
2
2
|
|
3
3
|
map.namespace :admin do |admin|
|
4
|
-
admin.namespace :shop, :member => { :remove => :get } do |shop|
|
5
|
-
|
6
|
-
shop.resources :customers
|
7
|
-
|
4
|
+
admin.namespace :shop, :member => { :remove => :get } do |shop|
|
8
5
|
shop.resources :categories, :collection => { :sort => :put }, :member => { :products => :get } do |category|
|
9
6
|
category.resources :products, :only => :new
|
10
7
|
end
|
11
8
|
|
12
9
|
shop.resources :products, :except => :new, :collection => { :sort => :put } do |product|
|
13
|
-
product.resources :images,
|
10
|
+
product.resources :images, :controller => 'products/images', :collection => { :sort => :put }, :only => [:index, :create, :destroy]
|
11
|
+
product.resources :variants, :controller => 'products/variants', :only => [ :create, :destroy]
|
12
|
+
product.resources :variant_templates, :controller => 'products/variant_templates', :only => [ :update ]
|
14
13
|
end
|
15
14
|
|
15
|
+
shop.resources :packages, :member => { :remove => :get } do |packages|
|
16
|
+
packages.resources :packings, :controller => 'packages/packings', :collection => { :sort => :put }, :only => [:create, :update, :destroy]
|
17
|
+
end
|
18
|
+
|
19
|
+
shop.resources :variants
|
20
|
+
|
16
21
|
shop.resources :customers
|
22
|
+
|
17
23
|
shop.resources :orders
|
18
24
|
end
|
19
25
|
|
20
26
|
admin.resources :shops, :as => 'shop', :only => [ :index ]
|
21
27
|
end
|
22
28
|
|
23
|
-
# Maps the following routes within a prefix scope of either the configured shop.url_prefix or shop
|
24
|
-
shop_prefix = Radiant::Config['shop.url_prefix'].blank? ? 'shop' : Radiant::Config['shop.url_prefix']
|
25
|
-
map.with_options(:path_prefix => shop_prefix) do |prefix|
|
26
|
-
prefix.namespace :shop do |shop|
|
27
|
-
shop.cart_finalize 'finalize', :controller => 'orders', :action => 'finalize', :conditions => { :method => :get }
|
28
|
-
shop.product_search 'search.:format', :controller => 'products', :action => 'index', :conditions => { :method => :post }
|
29
|
-
shop.product_search 'search/:query.:format', :controller => 'products', :action => 'index', :conditions => { :method => :get }
|
30
|
-
shop.shop_product ':handle/:sku.:format', :controller => 'products', :action => 'show', :conditions => { :method => :get }
|
31
|
-
shop.shop_category ':handle.:format', :controller => 'categories',:action => 'show', :conditions => { :method => :get }
|
32
|
-
shop.shop_categories 'categories', :controller => 'categories',:action => 'index', :conditions => { :method => :get }
|
33
|
-
|
34
|
-
shop.with_options :path_prefix => "#{shop_prefix}/cart" do |cart|
|
35
|
-
cart.resources :line_items, :as => :items, :member => { :destroy => :get }
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
29
|
end
|
@@ -0,0 +1,101 @@
|
|
1
|
+
class FixRelationshipForeignKeys < ActiveRecord::Migration
|
2
|
+
class ShopProduct < ActiveRecord::Base; end
|
3
|
+
class ShopProductAttachment < ActiveRecord::Base; end
|
4
|
+
class ShopLineItem < ActiveRecord::Base; end
|
5
|
+
class ShopOrder < ActiveRecord::Base; end
|
6
|
+
class ShopPayment < ActiveRecord::Base; end
|
7
|
+
|
8
|
+
def self.up
|
9
|
+
# Product - Category
|
10
|
+
add_column :shop_products, :category_id, :integer
|
11
|
+
add_index :shop_products, :category_id
|
12
|
+
ShopProduct.all.each do |p|
|
13
|
+
p.update_attribute(:category_id, p.shop_category_id)
|
14
|
+
end
|
15
|
+
remove_column :shop_products, :shop_category_id
|
16
|
+
remove_index :shop_products, :shop_category_id
|
17
|
+
|
18
|
+
# ProductAttachment - Product
|
19
|
+
add_column :shop_product_attachments, :product_id, :integer
|
20
|
+
add_index :shop_product_attachments, :product_id
|
21
|
+
ShopProductAttachment.all.each do |a|
|
22
|
+
a.update_attribute(:product_id, a.shop_product_id)
|
23
|
+
end
|
24
|
+
remove_column :shop_product_attachments, :shop_product_id
|
25
|
+
remove_index :shop_product_attachments, :shop_product_id
|
26
|
+
|
27
|
+
# LineItem - Order
|
28
|
+
add_column :shop_line_items, :order_id, :integer
|
29
|
+
add_index :shop_line_items, :order_id
|
30
|
+
ShopLineItem.all.each do |i|
|
31
|
+
i.update_attribute(:order_id, i.shop_order_id)
|
32
|
+
end
|
33
|
+
remove_column :shop_line_items, :shop_order_id
|
34
|
+
remove_index :shop_line_items, :shop_order_id
|
35
|
+
|
36
|
+
# Order - Customer
|
37
|
+
add_column :shop_orders, :customer_id, :integer
|
38
|
+
add_index :shop_orders, :customer_id
|
39
|
+
ShopOrder.all.each do |o|
|
40
|
+
o.update_attribute(:customer_id, o.shop_customer_id)
|
41
|
+
end
|
42
|
+
remove_column :shop_orders, :shop_customer_id
|
43
|
+
remove_index :shop_orders, :shop_customer_id
|
44
|
+
|
45
|
+
# Payment - Order
|
46
|
+
add_column :shop_payments, :order_id, :integer
|
47
|
+
add_index :shop_payments, :order_id
|
48
|
+
ShopPayment.all.each do |p|
|
49
|
+
p.update_attribute(:order_id, p.shop_order_id)
|
50
|
+
end
|
51
|
+
remove_column :shop_payments, :shop_order_id
|
52
|
+
remove_index :shop_payments, :shop_order_id
|
53
|
+
end
|
54
|
+
|
55
|
+
def self.down
|
56
|
+
# Product - Category
|
57
|
+
add_column :shop_products, :shop_category_id, :integer
|
58
|
+
add_index :shop_products, :shop_category_id
|
59
|
+
ShopProduct.all.each do |p|
|
60
|
+
p.update_attribute(:shop_category_id, p.category_id)
|
61
|
+
end
|
62
|
+
remove_column :shop_products, :category_id
|
63
|
+
remove_index :shop_products, :category_id
|
64
|
+
|
65
|
+
# ProductAttachment - Product
|
66
|
+
add_column :shop_product_attachments, :shop_product_id, :integer
|
67
|
+
add_index :shop_product_attachments, :shop_product_id
|
68
|
+
ShopProductAttachment.all.each do |a|
|
69
|
+
a.update_attribute(:shop_product_id, a.product_id)
|
70
|
+
end
|
71
|
+
remove_column :shop_product_attachments, :product_id
|
72
|
+
remove_index :shop_product_attachments, :product_id
|
73
|
+
|
74
|
+
# LineItem - Order
|
75
|
+
add_column :shop_line_items, :shop_order_id, :integer
|
76
|
+
add_index :shop_line_items, :shop_order_id
|
77
|
+
ShopLineItem.all.each do |i|
|
78
|
+
i.update_attribute(:shop_order_id, i.order_id)
|
79
|
+
end
|
80
|
+
remove_column :shop_line_items, :order_id
|
81
|
+
remove_index :shop_line_items, :order_id
|
82
|
+
|
83
|
+
# Order - Customer
|
84
|
+
add_column :shop_orders, :shop_customer_id, :integer
|
85
|
+
add_index :shop_orders, :shop_customer_id
|
86
|
+
ShopOrder.all.each do |o|
|
87
|
+
o.update_attribute(:shop_customer_id, o.customer_id)
|
88
|
+
end
|
89
|
+
remove_column :shop_orders, :customer_id
|
90
|
+
remove_index :shop_orders, :customer_id
|
91
|
+
|
92
|
+
# Payment - Order
|
93
|
+
add_column :shop_payments, :shop_order_id, :integer
|
94
|
+
add_index :shop_payments, :shop_order_id
|
95
|
+
ShopPayment.all.each do |p|
|
96
|
+
p.update_attribute(:shop_order_id, p.order_id)
|
97
|
+
end
|
98
|
+
remove_column :shop_payments, :order_id
|
99
|
+
remove_index :shop_payments, :order_id
|
100
|
+
end
|
101
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class DropShopAddressables < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
drop_table :shop_addressables
|
4
|
+
drop_table :shop_address_billings
|
5
|
+
drop_table :shop_address_shippings
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.down
|
9
|
+
create_table :shop_addressables do |t|
|
10
|
+
t.references :address, :polymorphic => true
|
11
|
+
t.references :addresser, :polymorphic => true
|
12
|
+
end
|
13
|
+
add_index :shop_addressables, :address_id
|
14
|
+
add_index :shop_addressables, :addresser_id
|
15
|
+
|
16
|
+
create_table :shop_address_billings do |t|
|
17
|
+
t.references :shop_address
|
18
|
+
end
|
19
|
+
add_index :shop_address_billings, :shop_address_id
|
20
|
+
|
21
|
+
create_table :shop_address_shippings do |t|
|
22
|
+
t.references :shop_address
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class CreateShopGroups < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :shop_groups do |t|
|
4
|
+
t.string :name
|
5
|
+
end
|
6
|
+
|
7
|
+
create_table :shop_groupings do |t|
|
8
|
+
t.integer :product_id
|
9
|
+
t.string :group_id
|
10
|
+
end
|
11
|
+
add_index :shop_groupings, :product_id
|
12
|
+
add_index :shop_groupings, :group_id
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.down
|
16
|
+
remove_table :shop_groups
|
17
|
+
remove_table :shop_groupings
|
18
|
+
end
|
19
|
+
end
|