radiant-shop-extension 0.11.6 → 0.90.0
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY.md +21 -3
- data/LICENSE +42 -0
- data/README.md +62 -25
- data/Rakefile +4 -5
- data/VERSION +1 -1
- data/app/controllers/admin/shop/categories_controller.rb +1 -0
- data/app/controllers/admin/shop/orders_controller.rb +1 -1
- data/app/controllers/admin/shop/products_controller.rb +18 -7
- data/app/helpers/shop_helper.rb +8 -0
- data/app/models/form_address.rb +5 -5
- data/app/models/form_checkout.rb +25 -17
- data/app/models/form_line_item.rb +1 -1
- data/app/models/shop_category.rb +22 -7
- data/app/models/shop_customer.rb +1 -1
- data/app/models/shop_line_item.rb +26 -26
- data/app/models/shop_order.rb +0 -2
- data/app/models/shop_product.rb +15 -18
- data/app/views/.DS_Store +0 -0
- data/app/views/admin/shop/categories/edit/meta/_status.html.haml +3 -0
- data/app/views/admin/shop/products/edit/_foot.html.haml +1 -8
- data/app/views/admin/shop/products/edit/meta/_layout.html.haml +6 -0
- data/app/views/admin/shop/products/edit/meta/_status.html.haml +3 -0
- data/app/views/admin/shop/products/index/_product.html.haml +1 -1
- data/config/locales/en.yml +8 -7
- data/config/routes.rb +4 -16
- data/db/migrate/20101011063133_setup_shop.rb +94 -0
- data/db/seeds/forms.rb +113 -154
- data/db/seeds/layouts.rb +67 -103
- data/db/seeds/pages.rb +101 -0
- data/db/seeds/products.rb +29 -0
- data/db/seeds/snippets.rb +36 -21
- data/lib/shop/controllers/application_controller.rb +5 -3
- data/lib/shop/models/form_extension.rb +1 -2
- data/lib/shop/models/page.rb +0 -1
- data/lib/shop/models/user.rb +0 -1
- data/lib/shop/tags/card.rb +8 -2
- data/lib/shop/tags/cart.rb +5 -1
- data/lib/shop/tags/helpers.rb +35 -60
- data/lib/shop/tags/item.rb +2 -16
- data/lib/shop/tags/product.rb +7 -0
- data/lib/tasks/shop_extension_tasks.rake +9 -4
- data/public/javascripts/admin/extensions/shop/products/edit.js +0 -25
- data/radiant-shop-extension.gemspec +25 -201
- data/shop_extension.rb +18 -19
- data/spec/datasets/forms.rb +25 -28
- data/spec/datasets/shop_categories.rb +2 -2
- data/spec/datasets/shop_config.rb +24 -0
- data/spec/datasets/shop_customers.rb +1 -0
- data/spec/datasets/shop_line_items.rb +21 -3
- data/spec/datasets/shop_products.rb +4 -1
- data/spec/datasets/tags.rb +19 -0
- data/spec/lib/shop/models/page_spec.rb +1 -1
- data/spec/lib/shop/tags/card_spec.rb +30 -4
- data/spec/lib/shop/tags/cart_spec.rb +29 -12
- data/spec/lib/shop/tags/helpers_spec.rb +45 -66
- data/spec/lib/shop/tags/item_spec.rb +6 -10
- data/spec/lib/shop/tags/product_spec.rb +27 -2
- data/spec/models/form_address_spec.rb +9 -8
- data/spec/models/form_checkout_spec.rb +28 -22
- data/spec/models/shop_category_spec.rb +2 -10
- data/spec/models/shop_line_item_spec.rb +71 -34
- data/spec/models/shop_order_spec.rb +5 -5
- data/spec/models/shop_product_attachment_spec.rb +1 -0
- data/spec/models/shop_product_spec.rb +4 -47
- data/spec/spec.opts +3 -5
- metadata +60 -248
- data/Gemfile +0 -26
- data/Gemfile.lock +0 -75
- data/MIT-LICENSE +0 -20
- data/app/controllers/admin/shop/discounts/discountables_controller.rb +0 -44
- data/app/controllers/admin/shop/discounts_controller.rb +0 -64
- data/app/controllers/admin/shop/packages/packings_controller.rb +0 -90
- data/app/controllers/admin/shop/packages_controller.rb +0 -63
- data/app/controllers/admin/shop/products/variant_templates_controller.rb +0 -27
- data/app/controllers/admin/shop/products/variants_controller.rb +0 -60
- data/app/controllers/admin/shop/variants_controller.rb +0 -48
- data/app/models/form_discount.rb +0 -39
- data/app/models/shop_discount.rb +0 -37
- data/app/models/shop_discountable.rb +0 -64
- data/app/models/shop_group.rb +0 -15
- data/app/models/shop_grouping.rb +0 -6
- data/app/models/shop_package.rb +0 -74
- data/app/models/shop_packing.rb +0 -22
- data/app/models/shop_product_variant.rb +0 -34
- data/app/models/shop_variant.rb +0 -23
- data/app/views/admin/pages/_shop_category.html.haml +0 -4
- data/app/views/admin/pages/_shop_product.html.haml +0 -4
- data/app/views/admin/shop/discounts/edit/_foot.html.haml +0 -16
- data/app/views/admin/shop/discounts/edit/_form.html.haml +0 -15
- data/app/views/admin/shop/discounts/edit/_head.html.haml +0 -4
- data/app/views/admin/shop/discounts/edit/_inputs.html.haml +0 -2
- data/app/views/admin/shop/discounts/edit/_meta.html.haml +0 -8
- data/app/views/admin/shop/discounts/edit/_parts.html.haml +0 -9
- data/app/views/admin/shop/discounts/edit/_popups.html.haml +0 -4
- data/app/views/admin/shop/discounts/edit/buttons/_browse_categories.html.haml +0 -1
- data/app/views/admin/shop/discounts/edit/buttons/_browse_products.html.haml +0 -1
- data/app/views/admin/shop/discounts/edit/inputs/_amount.html.haml +0 -3
- data/app/views/admin/shop/discounts/edit/inputs/_code.html.haml +0 -3
- data/app/views/admin/shop/discounts/edit/inputs/_name.html.haml +0 -3
- data/app/views/admin/shop/discounts/edit/meta/_finish.html.haml +0 -5
- data/app/views/admin/shop/discounts/edit/meta/_start.html.haml +0 -5
- data/app/views/admin/shop/discounts/edit/parts/_categories.html.haml +0 -3
- data/app/views/admin/shop/discounts/edit/parts/_products.html.haml +0 -3
- data/app/views/admin/shop/discounts/edit/popups/_browse_categories.html.haml +0 -6
- data/app/views/admin/shop/discounts/edit/popups/_browse_products.html.haml +0 -6
- data/app/views/admin/shop/discounts/edit/shared/_category.html.haml +0 -11
- data/app/views/admin/shop/discounts/edit/shared/_product.html.haml +0 -12
- data/app/views/admin/shop/discounts/edit.html.haml +0 -11
- data/app/views/admin/shop/discounts/index/_discount.html.haml +0 -13
- data/app/views/admin/shop/discounts/index/_foot.html.haml +0 -5
- data/app/views/admin/shop/discounts/index/_head.html.haml +0 -2
- data/app/views/admin/shop/discounts/index/buttons/_new_discount.html.haml +0 -1
- data/app/views/admin/shop/discounts/index.html.haml +0 -13
- data/app/views/admin/shop/discounts/new.html.haml +0 -11
- data/app/views/admin/shop/discounts/remove.html.haml +0 -12
- data/app/views/admin/shop/packages/edit/_foot.html.haml +0 -17
- data/app/views/admin/shop/packages/edit/_form.html.haml +0 -15
- data/app/views/admin/shop/packages/edit/_head.html.haml +0 -4
- data/app/views/admin/shop/packages/edit/_inputs.html.haml +0 -2
- data/app/views/admin/shop/packages/edit/_meta.html.haml +0 -8
- data/app/views/admin/shop/packages/edit/_parts.html.haml +0 -9
- data/app/views/admin/shop/packages/edit/_popups.html.haml +0 -4
- data/app/views/admin/shop/packages/edit/buttons/_browse_products.html.haml +0 -1
- data/app/views/admin/shop/packages/edit/inputs/_name.html.haml +0 -3
- data/app/views/admin/shop/packages/edit/inputs/_price.html.haml +0 -3
- data/app/views/admin/shop/packages/edit/meta/_sku.html.haml +0 -5
- data/app/views/admin/shop/packages/edit/parts/_description.html.haml +0 -1
- data/app/views/admin/shop/packages/edit/parts/_products.html.haml +0 -3
- data/app/views/admin/shop/packages/edit/popups/_browse_products.html.haml +0 -7
- data/app/views/admin/shop/packages/edit/shared/_product.html.haml +0 -8
- data/app/views/admin/shop/packages/edit.html.haml +0 -11
- data/app/views/admin/shop/packages/index/_foot.html.haml +0 -8
- data/app/views/admin/shop/packages/index/_head.html.haml +0 -2
- data/app/views/admin/shop/packages/index/_package.html.haml +0 -9
- data/app/views/admin/shop/packages/index/buttons/_new_package.html.haml +0 -1
- data/app/views/admin/shop/packages/index.html.haml +0 -13
- data/app/views/admin/shop/packages/new.html.haml +0 -11
- data/app/views/admin/shop/packages/remove.html.haml +0 -12
- data/app/views/admin/shop/products/edit/buttons/_browse_templates.html.haml +0 -1
- data/app/views/admin/shop/products/edit/buttons/_new_variant.html.haml +0 -1
- data/app/views/admin/shop/products/edit/parts/_variants.html.haml +0 -3
- data/app/views/admin/shop/products/edit/popups/_browse_templates.html.haml +0 -6
- data/app/views/admin/shop/products/edit/popups/_new_variant.html.haml +0 -16
- data/app/views/admin/shop/products/edit/shared/_template.html.haml +0 -6
- data/app/views/admin/shop/products/edit/shared/_variant.html.haml +0 -10
- data/app/views/admin/shop/products/index/buttons/_variants.html.haml +0 -1
- data/app/views/admin/shop/variants/edit/_foot.html.haml +0 -9
- data/app/views/admin/shop/variants/edit/_form.html.haml +0 -13
- data/app/views/admin/shop/variants/edit/_head.html.haml +0 -4
- data/app/views/admin/shop/variants/edit/_inputs.html.haml +0 -2
- data/app/views/admin/shop/variants/edit/_meta.html.haml +0 -8
- data/app/views/admin/shop/variants/edit/_parts.html.haml +0 -9
- data/app/views/admin/shop/variants/edit/_popups.html.haml +0 -4
- data/app/views/admin/shop/variants/edit/inputs/_name.html.haml +0 -3
- data/app/views/admin/shop/variants/edit/inputs/_options.html.haml +0 -3
- data/app/views/admin/shop/variants/edit.html.haml +0 -11
- data/app/views/admin/shop/variants/index/_foot.html.haml +0 -5
- data/app/views/admin/shop/variants/index/_head.html.haml +0 -2
- data/app/views/admin/shop/variants/index/_variant.html.haml +0 -9
- data/app/views/admin/shop/variants/index/buttons/_add_variant.html.haml +0 -1
- data/app/views/admin/shop/variants/index/buttons/_categories.html.haml +0 -1
- data/app/views/admin/shop/variants/index.html.haml +0 -13
- data/app/views/admin/shop/variants/new.html.haml +0 -11
- data/app/views/admin/shop/variants/remove.html.haml +0 -12
- data/app/views/shop/categories/show.html.haml +0 -1
- data/app/views/shop/orders/show.html.haml +0 -1
- data/app/views/shop/products/index.html.haml +0 -1
- data/app/views/shop/products/show.html.haml +0 -1
- data/cucumber.yml +0 -1
- data/db/migrate/20100311053701_initial.rb +0 -153
- data/db/migrate/20100927041219_remove_payment_methods.rb +0 -16
- data/db/migrate/20100927041624_change_payments_add_gateway.rb +0 -11
- data/db/migrate/20100927140446_change_payment_add_card_type_card_number.rb +0 -11
- data/db/migrate/20100929011106_fix_relationship_foreign_keys.rb +0 -101
- data/db/migrate/20100929011607_drop_shop_addressables.rb +0 -25
- data/db/migrate/20100929030510_create_shop_groups.rb +0 -19
- data/db/migrate/20100929080301_shop_groups_change_add_description.rb +0 -11
- data/db/migrate/20100929081200_create_variants.rb +0 -20
- data/db/migrate/20100929143531_change_variants_add_updated_by.rb +0 -25
- data/db/migrate/20100929145641_change_created_by_to_id.rb +0 -75
- data/db/migrate/20100929235221_change_category_add_variant_id.rb +0 -9
- data/db/migrate/20100930235221_create_packages.rb +0 -31
- data/db/migrate/20101005231713_create_page_ids.rb +0 -11
- data/db/migrate/20101006051214_create_pages_for_products_and_categories.rb +0 -73
- data/db/migrate/20101007111845_add_default_position_to_attachment.rb +0 -9
- data/db/migrate/20101010071143_create_discounts.rb +0 -29
- data/db/migrate/20101010072225_modify_categories_remove_variant.rb +0 -9
- data/db/migrate/20101010130034_change_discountables_add_observer.rb +0 -15
- data/db/migrate/20101011063133_change_orders_set_limits_to_null.rb +0 -11
- data/features/support/env.rb +0 -16
- data/features/support/paths.rb +0 -14
- data/lib/shop/interface/packages.rb +0 -34
- data/lib/shop/interface/variants.rb +0 -34
- data/lib/shop/tags/package.rb +0 -95
- data/lib/shop/tags/product_variant.rb +0 -52
- data/lib/shop/tags/responses.rb +0 -34
- data/mockups/balsamiq/products-retro_fun_tshirt-more.bmml +0 -0
- data/mockups/balsamiq/products-retro_fun_tshirt.bmml +0 -0
- data/mockups/discounts/new-edit.bmml +0 -492
- data/public/javascripts/admin/extensions/shop/discounts/edit.js +0 -76
- data/public/javascripts/admin/extensions/shop/packages/edit.js +0 -109
- data/public/stylesheets/sass/admin/extensions/shop/discounts/edit.sass +0 -125
- data/public/stylesheets/sass/admin/extensions/shop/packages/edit.sass +0 -162
- data/spec/controllers/admin/shop/discounts/discountables_controller_spec.rb +0 -73
- data/spec/controllers/admin/shop/discounts_controller_spec.rb +0 -81
- data/spec/controllers/admin/shop/packages/packings_controller_spec.rb +0 -188
- data/spec/controllers/admin/shop/packages_controller_spec.rb +0 -32
- data/spec/controllers/admin/shop/products/variant_templates_controller_spec.rb +0 -53
- data/spec/controllers/admin/shop/products/variants_controller_spec.rb +0 -116
- data/spec/controllers/admin/shop/variants_controller_spec.rb +0 -67
- data/spec/datasets/shop_discountables.rb +0 -22
- data/spec/datasets/shop_discounts.rb +0 -29
- data/spec/datasets/shop_groups.rb +0 -15
- data/spec/datasets/shop_packages.rb +0 -25
- data/spec/datasets/shop_product_variants.rb +0 -22
- data/spec/datasets/shop_variants.rb +0 -17
- data/spec/lib/shop/tags/package_spec.rb +0 -342
- data/spec/lib/shop/tags/product_variant_spec.rb +0 -175
- data/spec/lib/shop/tags/responses_spec.rb +0 -129
- data/spec/models/form_discount_spec.rb +0 -63
- data/spec/models/shop_discount_spec.rb +0 -130
- data/spec/models/shop_discountable_spec.rb +0 -114
- data/spec/models/shop_group_spec.rb +0 -38
- data/spec/models/shop_package_spec.rb +0 -117
- data/spec/models/shop_packing_spec.rb +0 -67
- data/spec/models/shop_product_variant_spec.rb +0 -92
- data/spec/models/shop_variant_spec.rb +0 -32
data/app/models/shop_package.rb
DELETED
@@ -1,74 +0,0 @@
|
|
1
|
-
class ShopPackage < ActiveRecord::Base
|
2
|
-
|
3
|
-
belongs_to :created_by, :class_name => 'User'
|
4
|
-
belongs_to :updated_by, :class_name => 'User'
|
5
|
-
|
6
|
-
has_many :packings, :class_name => 'ShopPacking', :foreign_key => :package_id, :dependent => :destroy
|
7
|
-
has_many :products, :class_name => 'ShopProduct', :foreign_key => :product_id, :through => :packings
|
8
|
-
|
9
|
-
has_many :line_items, :class_name => 'ShopLineItem', :as => :item
|
10
|
-
has_many :orders, :class_name => 'ShopOrder', :through => :line_items
|
11
|
-
|
12
|
-
before_validation :assign_sku
|
13
|
-
|
14
|
-
validates_presence_of :name, :sku
|
15
|
-
|
16
|
-
validates_uniqueness_of :name, :sku
|
17
|
-
|
18
|
-
validates_numericality_of :price, :greater_than => 0.00, :allow_nil => true, :precisions => 2
|
19
|
-
|
20
|
-
# Returns the products not attached to the category
|
21
|
-
def available_products; ShopProduct.all - self.products; end
|
22
|
-
|
23
|
-
# Returns the slug of the first product
|
24
|
-
def slug; products.first.slug; end
|
25
|
-
|
26
|
-
# Overloads the base to_json to return what we want
|
27
|
-
def to_json(*attrs); super self.class.params; end
|
28
|
-
|
29
|
-
# Returns the aggregate value of the products in the package
|
30
|
-
def value
|
31
|
-
value = 0
|
32
|
-
self.packings.map { |pkg| value += (pkg.product.price.to_f * pkg.quantity) }
|
33
|
-
value
|
34
|
-
end
|
35
|
-
|
36
|
-
# Returns the aggregate weight of the products in the package
|
37
|
-
def weight
|
38
|
-
weight = 0
|
39
|
-
self.packings.map { |pkg| weight += (pkg.product.weight.to_f * pkg.quantity) }
|
40
|
-
weight
|
41
|
-
end
|
42
|
-
|
43
|
-
class << self
|
44
|
-
|
45
|
-
# Returns attributes attached to the product
|
46
|
-
def attrs
|
47
|
-
[ :id, :name, :price, :sku, :description, :created_at, :updated_at ]
|
48
|
-
end
|
49
|
-
|
50
|
-
# Returns methods with usefuly information
|
51
|
-
def methds
|
52
|
-
[]
|
53
|
-
end
|
54
|
-
|
55
|
-
# Returns the objects to include
|
56
|
-
def inclde
|
57
|
-
[ :category, :products ]
|
58
|
-
end
|
59
|
-
|
60
|
-
# Returns a custom hash of attributes on the product
|
61
|
-
def params
|
62
|
-
{ :only => self.attrs, :methods => self.methds, :include => self.inclde }
|
63
|
-
end
|
64
|
-
|
65
|
-
end
|
66
|
-
|
67
|
-
private
|
68
|
-
|
69
|
-
# Assigns an sku based off the name
|
70
|
-
def assign_sku
|
71
|
-
self.sku = ShopProduct.to_sku(sku.present? ? sku : name)
|
72
|
-
end
|
73
|
-
|
74
|
-
end
|
data/app/models/shop_packing.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
class ShopPacking < ActiveRecord::Base
|
2
|
-
|
3
|
-
default_scope :order => 'shop_packings.position ASC'
|
4
|
-
|
5
|
-
belongs_to :package, :class_name => 'ShopPackage', :foreign_key => :package_id
|
6
|
-
belongs_to :product, :class_name => 'ShopProduct', :foreign_key => :product_id
|
7
|
-
|
8
|
-
before_validation :set_quantity
|
9
|
-
|
10
|
-
validates_uniqueness_of :product_id, :scope => :package_id
|
11
|
-
|
12
|
-
def value
|
13
|
-
self.product.price.to_f * self.quantity
|
14
|
-
end
|
15
|
-
|
16
|
-
private
|
17
|
-
|
18
|
-
def set_quantity
|
19
|
-
self.quantity = [1,self.quantity].max
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
@@ -1,34 +0,0 @@
|
|
1
|
-
class ShopProductVariant < ActiveRecord::Base
|
2
|
-
|
3
|
-
belongs_to :product, :class_name => 'ShopProduct', :foreign_key => :product_id
|
4
|
-
|
5
|
-
validates_presence_of :product
|
6
|
-
validates_presence_of :name
|
7
|
-
validates_uniqueness_of :name, :scope => :product_id
|
8
|
-
|
9
|
-
belongs_to :created_by, :class_name => 'User'
|
10
|
-
belongs_to :updated_by, :class_name => 'User'
|
11
|
-
|
12
|
-
has_many :line_items, :class_name => 'ShopLineItem', :foreign_key => :item_id, :dependent => :destroy
|
13
|
-
has_many :orders, :class_name => 'ShopOrder', :through => :line_items, :uniq => true
|
14
|
-
|
15
|
-
# Returns the price of the variant plus the product price
|
16
|
-
def price
|
17
|
-
price = product.price
|
18
|
-
if read_attribute(:price).present?
|
19
|
-
price = read_attribute(:price) + product.price
|
20
|
-
end
|
21
|
-
price
|
22
|
-
end
|
23
|
-
|
24
|
-
# Returns a mixed sku of product and variant name
|
25
|
-
def sku
|
26
|
-
%{#{product.sku}-#{ShopProduct.to_sku(name)}}
|
27
|
-
end
|
28
|
-
|
29
|
-
# Returns slug of the product
|
30
|
-
def slug
|
31
|
-
product.slug
|
32
|
-
end
|
33
|
-
|
34
|
-
end
|
data/app/models/shop_variant.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
class ShopVariant < ActiveRecord::Base
|
2
|
-
|
3
|
-
belongs_to :created_by, :class_name => 'User'
|
4
|
-
belongs_to :updated_by, :class_name => 'User'
|
5
|
-
|
6
|
-
validates_presence_of :name
|
7
|
-
validates_uniqueness_of :name
|
8
|
-
validates_presence_of :options_json
|
9
|
-
|
10
|
-
def options
|
11
|
-
options = {}
|
12
|
-
if self.options_json.present?
|
13
|
-
options = ActiveSupport::JSON.decode(self.options_json)
|
14
|
-
options = Forms::Config.deep_symbolize_keys(options)
|
15
|
-
end
|
16
|
-
options
|
17
|
-
end
|
18
|
-
|
19
|
-
def options=(options)
|
20
|
-
self.options_json = ActiveSupport::JSON.encode(options)
|
21
|
-
end
|
22
|
-
|
23
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
- render_region :foot do |foot|
|
2
|
-
- foot.buttons do
|
3
|
-
%p.buttons
|
4
|
-
= save_model_button(@shop_discount)
|
5
|
-
= save_model_and_continue_editing_button(@shop_discount)
|
6
|
-
= t('or')
|
7
|
-
= link_to t('cancel'), admin_shop_discounts_path
|
8
|
-
- foot.timestamp do
|
9
|
-
= updated_stamp @shop_discount
|
10
|
-
|
11
|
-
- unless @shop_discount.new_record?
|
12
|
-
:javascript
|
13
|
-
if(typeof(ROUTES) === 'undefined') ROUTES = new Array();
|
14
|
-
|
15
|
-
ROUTES['admin_shop_discount_discountables_path'] = "#{admin_shop_discount_discountables_path(@shop_discount)}";
|
16
|
-
ROUTES['admin_shop_discount_discountable_path'] = "#{admin_shop_discount_discountable_path(@shop_discount, ':id')}";
|
@@ -1,15 +0,0 @@
|
|
1
|
-
- form_for [:admin, @shop_discount], :html => {'data-onsubmit_status'=>"Saving Changes…"} do |f|
|
2
|
-
= hidden_field_tag 'shop_discount_id',@shop_discount.id
|
3
|
-
|
4
|
-
- render_region :form do |form|
|
5
|
-
- form.inputs do
|
6
|
-
= render :partial => '/admin/shop/discounts/edit/inputs', :locals => { :f => f }
|
7
|
-
|
8
|
-
- form.meta do
|
9
|
-
= render :partial => '/admin/shop/discounts/edit/meta', :locals => { :f => f }
|
10
|
-
|
11
|
-
- form.parts do
|
12
|
-
= render :partial => '/admin/shop/discounts/edit/parts', :locals => { :f => f }
|
13
|
-
|
14
|
-
- form.foot do
|
15
|
-
= render :partial => 'admin/shop/discounts/edit/foot', :locals => { :f => f }
|
@@ -1,8 +0,0 @@
|
|
1
|
-
- if @meta.present?
|
2
|
-
.drawer
|
3
|
-
.drawer_contents#attributes
|
4
|
-
%table.fieldset
|
5
|
-
- @meta.each do |meta|
|
6
|
-
= render :partial => "admin/shop/discounts/edit/meta/#{meta}", :locals => { :f => f }
|
7
|
-
.drawer_handle
|
8
|
-
%a.toggle{:href=>'#attributes', :rel=>"toggle[attributes]", :class=>"#{(meta_errors? ? 'less' : 'more')}"}= meta_label
|
@@ -1,9 +0,0 @@
|
|
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 => "product_page_#{part}", 'data-caption'=>h(part)}
|
8
|
-
.part{:id => "product_part_#{part}"}
|
9
|
-
= render :partial => "admin/shop/discounts/edit/parts/#{part}", :locals => { :f => f }
|
@@ -1 +0,0 @@
|
|
1
|
-
= link_to t('browse_categories'), '#browse_categories_popup', :class => 'popup button'
|
@@ -1 +0,0 @@
|
|
1
|
-
= link_to t('browse_products'), '#browse_products_popup', :class => 'popup button'
|
@@ -1,6 +0,0 @@
|
|
1
|
-
%h3.title Browse Categories
|
2
|
-
|
3
|
-
%ul#available_categories.availables
|
4
|
-
= render :partial => '/admin/shop/discounts/edit/shared/category', :collection => @shop_discount.available_categories
|
5
|
-
|
6
|
-
%a#browse_categories_popup_close.close{ :href => '#browse_categories_popup_close' }
|
@@ -1,11 +0,0 @@
|
|
1
|
-
- discounted_type = category.class.to_s
|
2
|
-
- discounted_id = discounted_type == "ShopCategory" ? category.id : category.discounted_id
|
3
|
-
- discountable_id = discounted_type == "ShopCategory" ? nil : category.id
|
4
|
-
- success_element = discounted_type == "ShopCategory" ? 'discount_categories' : 'available_categories'
|
5
|
-
- class_type = discounted_type == "ShopCategory" ? "available" : "discounted"
|
6
|
-
|
7
|
-
%li.category{:class => "discountable #{class_type} category", :id => "#{discounted_type}_#{category.id}", :'data-discounted_id' => discounted_id, :'data-discounted_type' => discounted_type, :'data-discounted_type_human' => 'Category', :'data-discountable_id' => discountable_id, :'data-success_element' => success_element }
|
8
|
-
%span.name= truncate((category.name rescue category.discounted.name), 30, '...')
|
9
|
-
%span.handle= (category.handle rescue category.discounted.handle)
|
10
|
-
.actions
|
11
|
-
%span.delete
|
@@ -1,12 +0,0 @@
|
|
1
|
-
- discounted_type = product.class.to_s
|
2
|
-
|
3
|
-
- discounted_id = discounted_type == "ShopProduct" ? product.id : product.discounted_id
|
4
|
-
- discountable_id = discounted_type == "ShopProduct" ? nil : product.id
|
5
|
-
- success_element = discounted_type == "ShopProduct" ? 'discount_products' : 'available_products'
|
6
|
-
- class_type = discounted_type == "ShopProduct" ? "available" : "discounted"
|
7
|
-
|
8
|
-
%li.product{:class => "discountable #{class_type} product", :id => "#{class_type}_#{product.id}", :'data-discounted_id' => discounted_id, :'data-discounted_type' => discounted_type, :'data-discounted_type_human' => 'Product', :'data-discountable_id' => discountable_id, :'data-success_element' => success_element }
|
9
|
-
%span.name= truncate((product.name rescue product.discounted.name), 30, '...')
|
10
|
-
%span.sku= (product.sku rescue product.discounted.sku)
|
11
|
-
.actions
|
12
|
-
%span.delete
|
@@ -1,11 +0,0 @@
|
|
1
|
-
- @page_title = @shop_discount.name
|
2
|
-
|
3
|
-
- render_region :main do |main|
|
4
|
-
- main.head do
|
5
|
-
= render 'admin/shop/discounts/edit/head'
|
6
|
-
|
7
|
-
- main.popups do
|
8
|
-
= render 'admin/shop/discounts/edit/popups'
|
9
|
-
|
10
|
-
- main.form do
|
11
|
-
= render 'admin/shop/discounts/edit/form'
|
@@ -1,13 +0,0 @@
|
|
1
|
-
%li.discount.object{:id => "discount_#{discount.id}", :'data-id' => discount.id}
|
2
|
-
.attributes
|
3
|
-
%span.name.attribute
|
4
|
-
- render_region :body do |body|
|
5
|
-
- body.name do
|
6
|
-
%span.name.attribute= link_to discount.name, [:edit_admin, discount]
|
7
|
-
- body.code do
|
8
|
-
%span.code.attribute= discount.code
|
9
|
-
- body.amount do
|
10
|
-
%span.amount.attribute= discount.amount
|
11
|
-
- body.modify do
|
12
|
-
.modify
|
13
|
-
%span.remove= link_to t('remove'), [:remove_admin, discount]
|
@@ -1 +0,0 @@
|
|
1
|
-
= link_to image('plus') + " " + t("add_discount"), new_admin_shop_discount_path
|
@@ -1,13 +0,0 @@
|
|
1
|
-
- @page_title = t('discounts') + ' - ' + default_page_title
|
2
|
-
|
3
|
-
.outset
|
4
|
-
|
5
|
-
#head.min
|
6
|
-
= render :partial => '/admin/shop/discounts/index/head'
|
7
|
-
|
8
|
-
#discounts_map.map
|
9
|
-
%ul#discounts
|
10
|
-
= render :partial => '/admin/shop/discounts/index/discount', :collection => @shop_discounts
|
11
|
-
|
12
|
-
#actions
|
13
|
-
= render :partial => '/admin/shop/discounts/index/foot'
|
@@ -1,11 +0,0 @@
|
|
1
|
-
- @page_title = t('new_discount')
|
2
|
-
|
3
|
-
- render_region :main do |main|
|
4
|
-
- main.head do
|
5
|
-
= render 'admin/shop/discounts/edit/head'
|
6
|
-
|
7
|
-
- main.popups do
|
8
|
-
= render 'admin/shop/discounts/edit/popups'
|
9
|
-
|
10
|
-
- main.form do
|
11
|
-
= render 'admin/shop/discounts/edit/form'
|
@@ -1,12 +0,0 @@
|
|
1
|
-
%h1
|
2
|
-
= t('remove_discount')
|
3
|
-
|
4
|
-
%p
|
5
|
-
= t('text.remove_discount.warning')
|
6
|
-
|
7
|
-
- form_for [:admin, @shop_discount.becomes(ShopDiscount)], :html => {:method => :delete, 'data-onsubmit_status'=>"Removing Discount…"} do
|
8
|
-
|
9
|
-
%p.buttons
|
10
|
-
%input.button{:type=>"submit", :value => t('delete_variant') }/
|
11
|
-
= t('or')
|
12
|
-
= link_to t('cancel'), admin_shop_discounts_path
|
@@ -1,17 +0,0 @@
|
|
1
|
-
- render_region :foot do |foot|
|
2
|
-
- foot.buttons do
|
3
|
-
%p.buttons
|
4
|
-
= save_model_button(@shop_package)
|
5
|
-
= save_model_and_continue_editing_button(@shop_package)
|
6
|
-
= t('or')
|
7
|
-
= link_to t('cancel'), admin_shop_packages_path
|
8
|
-
- foot.timestamp do
|
9
|
-
= updated_stamp @shop_package
|
10
|
-
|
11
|
-
- unless @shop_package.new_record?
|
12
|
-
:javascript
|
13
|
-
if(typeof(ROUTES) === 'undefined') ROUTES = new Array();
|
14
|
-
|
15
|
-
ROUTES['sort_admin_shop_package_packings_path'] = "#{sort_admin_shop_package_packings_path(@shop_package)}";
|
16
|
-
ROUTES['admin_shop_package_packings_path'] = "#{admin_shop_package_packings_path(@shop_package)}";
|
17
|
-
ROUTES['admin_shop_package_packing_path'] = "#{admin_shop_package_packing_path(@shop_package,':d')}";
|
@@ -1,15 +0,0 @@
|
|
1
|
-
- form_for [:admin, @shop_package], :html => {'data-onsubmit_status'=>"Saving Changes…"} do |f|
|
2
|
-
= hidden_field_tag 'shop_package_id',@shop_package.id
|
3
|
-
|
4
|
-
- render_region :form do |form|
|
5
|
-
- form.inputs do
|
6
|
-
= render :partial => '/admin/shop/packages/edit/inputs', :locals => { :f => f }
|
7
|
-
|
8
|
-
- form.meta do
|
9
|
-
= render :partial => '/admin/shop/packages/edit/meta', :locals => { :f => f }
|
10
|
-
|
11
|
-
- form.parts do
|
12
|
-
= render :partial => '/admin/shop/packages/edit/parts', :locals => { :f => f }
|
13
|
-
|
14
|
-
- form.foot do
|
15
|
-
= render :partial => '/admin/shop/packages/edit/foot', :locals => { :f => f }
|
@@ -1,8 +0,0 @@
|
|
1
|
-
- if @meta.present?
|
2
|
-
.drawer
|
3
|
-
.drawer_contents#attributes
|
4
|
-
%table.fieldset
|
5
|
-
- @meta.each do |meta|
|
6
|
-
= render :partial => "admin/shop/packages/edit/meta/#{meta}", :locals => { :f => f }
|
7
|
-
.drawer_handle
|
8
|
-
%a.toggle{:href=>'#attributes', :rel=>"toggle[attributes]", :class=>"#{(meta_errors? ? 'less' : 'more')}"}= meta_label
|
@@ -1,9 +0,0 @@
|
|
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 => "package_page_#{part}", 'data-caption'=>h(part)}
|
8
|
-
.part{:id => "package_part_#{part}"}
|
9
|
-
= render :partial => "admin/shop/packages/edit/parts/#{part}", :locals => { :f => f }
|
@@ -1 +0,0 @@
|
|
1
|
-
= link_to "#{image('plus')} #{t('browse_products')}", '#browse_products_popup', :class => 'popup button'
|
@@ -1 +0,0 @@
|
|
1
|
-
~ f.text_area :description, :class => "textarea large", :style => "width: 100%"
|
@@ -1,7 +0,0 @@
|
|
1
|
-
%h3.title Available Products
|
2
|
-
|
3
|
-
%ul#available_products
|
4
|
-
- @shop_package.available_products.each do |product|
|
5
|
-
= render :partial => 'admin/shop/packages/edit/shared/product', :locals => { :product => product }
|
6
|
-
|
7
|
-
%a#browse_products_popup_close.close{ :href => '#' }
|
@@ -1,8 +0,0 @@
|
|
1
|
-
%li.product{ :id => "product_#{packing.id rescue product.id}", :'data-packing_id' => (packing.id rescue nil), :'data-product_id' => product.id }
|
2
|
-
.wrapper
|
3
|
-
= image_tag(product.images.first.url(:preview)) unless product.images.empty?
|
4
|
-
%span.title= product.sku
|
5
|
-
%input.quantity{ :id => "packing_#{packing.id rescue nil }_quantity", :value => (packing.quantity rescue nil), :'data-packing_id' => (packing.id rescue nil) }
|
6
|
-
%button.save_quantity{ :onclick => 'return false' } save
|
7
|
-
.actions
|
8
|
-
%span.delete
|
@@ -1,11 +0,0 @@
|
|
1
|
-
- @page_title = @shop_package.name
|
2
|
-
|
3
|
-
- render_region :main do |main|
|
4
|
-
- main.head do
|
5
|
-
= render 'admin/shop/packages/edit/head'
|
6
|
-
|
7
|
-
- main.popups do
|
8
|
-
= render 'admin/shop/packages/edit/popups'
|
9
|
-
|
10
|
-
- main.form do
|
11
|
-
= render 'admin/shop/packages/edit/form'
|
@@ -1,9 +0,0 @@
|
|
1
|
-
%li.package.object{:id => "package_#{package.id}", :'data-id' => package.id}
|
2
|
-
.attributes
|
3
|
-
- render_region :body do |body|
|
4
|
-
- body.name do
|
5
|
-
%span.name.attribute
|
6
|
-
= link_to package.name, [:edit_admin, package]
|
7
|
-
- body.modify do
|
8
|
-
.modify
|
9
|
-
%span.remove= link_to t('remove'), [:remove_admin, package]
|
@@ -1 +0,0 @@
|
|
1
|
-
= link_to image('plus') + " " + t("add_package"), new_admin_shop_package_path
|
@@ -1,13 +0,0 @@
|
|
1
|
-
- @page_title = t('packages') + ' - ' + default_page_title
|
2
|
-
|
3
|
-
.outset
|
4
|
-
|
5
|
-
#head.min
|
6
|
-
= render :partial => '/admin/shop/packages/index/head'
|
7
|
-
|
8
|
-
#packages_map.map
|
9
|
-
%ul#packages
|
10
|
-
= render :partial => '/admin/shop/packages/index/package', :collection => @shop_packages
|
11
|
-
|
12
|
-
#actions
|
13
|
-
= render :partial => '/admin/shop/packages/index/foot'
|
@@ -1,12 +0,0 @@
|
|
1
|
-
%h1
|
2
|
-
= t('remove_package')
|
3
|
-
|
4
|
-
%p
|
5
|
-
= t('text.remove_package.warning')
|
6
|
-
|
7
|
-
- form_for [:admin, @shop_package.becomes(ShopPackage)], :html => {:method => :delete, 'data-onsubmit_status'=>"Removing Package…"} do
|
8
|
-
|
9
|
-
%p.buttons
|
10
|
-
%input.button{:type=>"submit", :value => t('delete_package') }/
|
11
|
-
= t('or')
|
12
|
-
= link_to t('cancel'), admin_shop_packages_path
|
@@ -1 +0,0 @@
|
|
1
|
-
= link_to t('apply_template'), '#browse_templates_popup', :class => 'popup button'
|
@@ -1 +0,0 @@
|
|
1
|
-
= link_to "#{image('plus')} #{t('new_variant')}", '#new_variant_popup', :class => 'popup button'
|