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.
Files changed (227) hide show
  1. data/HISTORY.md +21 -3
  2. data/LICENSE +42 -0
  3. data/README.md +62 -25
  4. data/Rakefile +4 -5
  5. data/VERSION +1 -1
  6. data/app/controllers/admin/shop/categories_controller.rb +1 -0
  7. data/app/controllers/admin/shop/orders_controller.rb +1 -1
  8. data/app/controllers/admin/shop/products_controller.rb +18 -7
  9. data/app/helpers/shop_helper.rb +8 -0
  10. data/app/models/form_address.rb +5 -5
  11. data/app/models/form_checkout.rb +25 -17
  12. data/app/models/form_line_item.rb +1 -1
  13. data/app/models/shop_category.rb +22 -7
  14. data/app/models/shop_customer.rb +1 -1
  15. data/app/models/shop_line_item.rb +26 -26
  16. data/app/models/shop_order.rb +0 -2
  17. data/app/models/shop_product.rb +15 -18
  18. data/app/views/.DS_Store +0 -0
  19. data/app/views/admin/shop/categories/edit/meta/_status.html.haml +3 -0
  20. data/app/views/admin/shop/products/edit/_foot.html.haml +1 -8
  21. data/app/views/admin/shop/products/edit/meta/_layout.html.haml +6 -0
  22. data/app/views/admin/shop/products/edit/meta/_status.html.haml +3 -0
  23. data/app/views/admin/shop/products/index/_product.html.haml +1 -1
  24. data/config/locales/en.yml +8 -7
  25. data/config/routes.rb +4 -16
  26. data/db/migrate/20101011063133_setup_shop.rb +94 -0
  27. data/db/seeds/forms.rb +113 -154
  28. data/db/seeds/layouts.rb +67 -103
  29. data/db/seeds/pages.rb +101 -0
  30. data/db/seeds/products.rb +29 -0
  31. data/db/seeds/snippets.rb +36 -21
  32. data/lib/shop/controllers/application_controller.rb +5 -3
  33. data/lib/shop/models/form_extension.rb +1 -2
  34. data/lib/shop/models/page.rb +0 -1
  35. data/lib/shop/models/user.rb +0 -1
  36. data/lib/shop/tags/card.rb +8 -2
  37. data/lib/shop/tags/cart.rb +5 -1
  38. data/lib/shop/tags/helpers.rb +35 -60
  39. data/lib/shop/tags/item.rb +2 -16
  40. data/lib/shop/tags/product.rb +7 -0
  41. data/lib/tasks/shop_extension_tasks.rake +9 -4
  42. data/public/javascripts/admin/extensions/shop/products/edit.js +0 -25
  43. data/radiant-shop-extension.gemspec +25 -201
  44. data/shop_extension.rb +18 -19
  45. data/spec/datasets/forms.rb +25 -28
  46. data/spec/datasets/shop_categories.rb +2 -2
  47. data/spec/datasets/shop_config.rb +24 -0
  48. data/spec/datasets/shop_customers.rb +1 -0
  49. data/spec/datasets/shop_line_items.rb +21 -3
  50. data/spec/datasets/shop_products.rb +4 -1
  51. data/spec/datasets/tags.rb +19 -0
  52. data/spec/lib/shop/models/page_spec.rb +1 -1
  53. data/spec/lib/shop/tags/card_spec.rb +30 -4
  54. data/spec/lib/shop/tags/cart_spec.rb +29 -12
  55. data/spec/lib/shop/tags/helpers_spec.rb +45 -66
  56. data/spec/lib/shop/tags/item_spec.rb +6 -10
  57. data/spec/lib/shop/tags/product_spec.rb +27 -2
  58. data/spec/models/form_address_spec.rb +9 -8
  59. data/spec/models/form_checkout_spec.rb +28 -22
  60. data/spec/models/shop_category_spec.rb +2 -10
  61. data/spec/models/shop_line_item_spec.rb +71 -34
  62. data/spec/models/shop_order_spec.rb +5 -5
  63. data/spec/models/shop_product_attachment_spec.rb +1 -0
  64. data/spec/models/shop_product_spec.rb +4 -47
  65. data/spec/spec.opts +3 -5
  66. metadata +60 -248
  67. data/Gemfile +0 -26
  68. data/Gemfile.lock +0 -75
  69. data/MIT-LICENSE +0 -20
  70. data/app/controllers/admin/shop/discounts/discountables_controller.rb +0 -44
  71. data/app/controllers/admin/shop/discounts_controller.rb +0 -64
  72. data/app/controllers/admin/shop/packages/packings_controller.rb +0 -90
  73. data/app/controllers/admin/shop/packages_controller.rb +0 -63
  74. data/app/controllers/admin/shop/products/variant_templates_controller.rb +0 -27
  75. data/app/controllers/admin/shop/products/variants_controller.rb +0 -60
  76. data/app/controllers/admin/shop/variants_controller.rb +0 -48
  77. data/app/models/form_discount.rb +0 -39
  78. data/app/models/shop_discount.rb +0 -37
  79. data/app/models/shop_discountable.rb +0 -64
  80. data/app/models/shop_group.rb +0 -15
  81. data/app/models/shop_grouping.rb +0 -6
  82. data/app/models/shop_package.rb +0 -74
  83. data/app/models/shop_packing.rb +0 -22
  84. data/app/models/shop_product_variant.rb +0 -34
  85. data/app/models/shop_variant.rb +0 -23
  86. data/app/views/admin/pages/_shop_category.html.haml +0 -4
  87. data/app/views/admin/pages/_shop_product.html.haml +0 -4
  88. data/app/views/admin/shop/discounts/edit/_foot.html.haml +0 -16
  89. data/app/views/admin/shop/discounts/edit/_form.html.haml +0 -15
  90. data/app/views/admin/shop/discounts/edit/_head.html.haml +0 -4
  91. data/app/views/admin/shop/discounts/edit/_inputs.html.haml +0 -2
  92. data/app/views/admin/shop/discounts/edit/_meta.html.haml +0 -8
  93. data/app/views/admin/shop/discounts/edit/_parts.html.haml +0 -9
  94. data/app/views/admin/shop/discounts/edit/_popups.html.haml +0 -4
  95. data/app/views/admin/shop/discounts/edit/buttons/_browse_categories.html.haml +0 -1
  96. data/app/views/admin/shop/discounts/edit/buttons/_browse_products.html.haml +0 -1
  97. data/app/views/admin/shop/discounts/edit/inputs/_amount.html.haml +0 -3
  98. data/app/views/admin/shop/discounts/edit/inputs/_code.html.haml +0 -3
  99. data/app/views/admin/shop/discounts/edit/inputs/_name.html.haml +0 -3
  100. data/app/views/admin/shop/discounts/edit/meta/_finish.html.haml +0 -5
  101. data/app/views/admin/shop/discounts/edit/meta/_start.html.haml +0 -5
  102. data/app/views/admin/shop/discounts/edit/parts/_categories.html.haml +0 -3
  103. data/app/views/admin/shop/discounts/edit/parts/_products.html.haml +0 -3
  104. data/app/views/admin/shop/discounts/edit/popups/_browse_categories.html.haml +0 -6
  105. data/app/views/admin/shop/discounts/edit/popups/_browse_products.html.haml +0 -6
  106. data/app/views/admin/shop/discounts/edit/shared/_category.html.haml +0 -11
  107. data/app/views/admin/shop/discounts/edit/shared/_product.html.haml +0 -12
  108. data/app/views/admin/shop/discounts/edit.html.haml +0 -11
  109. data/app/views/admin/shop/discounts/index/_discount.html.haml +0 -13
  110. data/app/views/admin/shop/discounts/index/_foot.html.haml +0 -5
  111. data/app/views/admin/shop/discounts/index/_head.html.haml +0 -2
  112. data/app/views/admin/shop/discounts/index/buttons/_new_discount.html.haml +0 -1
  113. data/app/views/admin/shop/discounts/index.html.haml +0 -13
  114. data/app/views/admin/shop/discounts/new.html.haml +0 -11
  115. data/app/views/admin/shop/discounts/remove.html.haml +0 -12
  116. data/app/views/admin/shop/packages/edit/_foot.html.haml +0 -17
  117. data/app/views/admin/shop/packages/edit/_form.html.haml +0 -15
  118. data/app/views/admin/shop/packages/edit/_head.html.haml +0 -4
  119. data/app/views/admin/shop/packages/edit/_inputs.html.haml +0 -2
  120. data/app/views/admin/shop/packages/edit/_meta.html.haml +0 -8
  121. data/app/views/admin/shop/packages/edit/_parts.html.haml +0 -9
  122. data/app/views/admin/shop/packages/edit/_popups.html.haml +0 -4
  123. data/app/views/admin/shop/packages/edit/buttons/_browse_products.html.haml +0 -1
  124. data/app/views/admin/shop/packages/edit/inputs/_name.html.haml +0 -3
  125. data/app/views/admin/shop/packages/edit/inputs/_price.html.haml +0 -3
  126. data/app/views/admin/shop/packages/edit/meta/_sku.html.haml +0 -5
  127. data/app/views/admin/shop/packages/edit/parts/_description.html.haml +0 -1
  128. data/app/views/admin/shop/packages/edit/parts/_products.html.haml +0 -3
  129. data/app/views/admin/shop/packages/edit/popups/_browse_products.html.haml +0 -7
  130. data/app/views/admin/shop/packages/edit/shared/_product.html.haml +0 -8
  131. data/app/views/admin/shop/packages/edit.html.haml +0 -11
  132. data/app/views/admin/shop/packages/index/_foot.html.haml +0 -8
  133. data/app/views/admin/shop/packages/index/_head.html.haml +0 -2
  134. data/app/views/admin/shop/packages/index/_package.html.haml +0 -9
  135. data/app/views/admin/shop/packages/index/buttons/_new_package.html.haml +0 -1
  136. data/app/views/admin/shop/packages/index.html.haml +0 -13
  137. data/app/views/admin/shop/packages/new.html.haml +0 -11
  138. data/app/views/admin/shop/packages/remove.html.haml +0 -12
  139. data/app/views/admin/shop/products/edit/buttons/_browse_templates.html.haml +0 -1
  140. data/app/views/admin/shop/products/edit/buttons/_new_variant.html.haml +0 -1
  141. data/app/views/admin/shop/products/edit/parts/_variants.html.haml +0 -3
  142. data/app/views/admin/shop/products/edit/popups/_browse_templates.html.haml +0 -6
  143. data/app/views/admin/shop/products/edit/popups/_new_variant.html.haml +0 -16
  144. data/app/views/admin/shop/products/edit/shared/_template.html.haml +0 -6
  145. data/app/views/admin/shop/products/edit/shared/_variant.html.haml +0 -10
  146. data/app/views/admin/shop/products/index/buttons/_variants.html.haml +0 -1
  147. data/app/views/admin/shop/variants/edit/_foot.html.haml +0 -9
  148. data/app/views/admin/shop/variants/edit/_form.html.haml +0 -13
  149. data/app/views/admin/shop/variants/edit/_head.html.haml +0 -4
  150. data/app/views/admin/shop/variants/edit/_inputs.html.haml +0 -2
  151. data/app/views/admin/shop/variants/edit/_meta.html.haml +0 -8
  152. data/app/views/admin/shop/variants/edit/_parts.html.haml +0 -9
  153. data/app/views/admin/shop/variants/edit/_popups.html.haml +0 -4
  154. data/app/views/admin/shop/variants/edit/inputs/_name.html.haml +0 -3
  155. data/app/views/admin/shop/variants/edit/inputs/_options.html.haml +0 -3
  156. data/app/views/admin/shop/variants/edit.html.haml +0 -11
  157. data/app/views/admin/shop/variants/index/_foot.html.haml +0 -5
  158. data/app/views/admin/shop/variants/index/_head.html.haml +0 -2
  159. data/app/views/admin/shop/variants/index/_variant.html.haml +0 -9
  160. data/app/views/admin/shop/variants/index/buttons/_add_variant.html.haml +0 -1
  161. data/app/views/admin/shop/variants/index/buttons/_categories.html.haml +0 -1
  162. data/app/views/admin/shop/variants/index.html.haml +0 -13
  163. data/app/views/admin/shop/variants/new.html.haml +0 -11
  164. data/app/views/admin/shop/variants/remove.html.haml +0 -12
  165. data/app/views/shop/categories/show.html.haml +0 -1
  166. data/app/views/shop/orders/show.html.haml +0 -1
  167. data/app/views/shop/products/index.html.haml +0 -1
  168. data/app/views/shop/products/show.html.haml +0 -1
  169. data/cucumber.yml +0 -1
  170. data/db/migrate/20100311053701_initial.rb +0 -153
  171. data/db/migrate/20100927041219_remove_payment_methods.rb +0 -16
  172. data/db/migrate/20100927041624_change_payments_add_gateway.rb +0 -11
  173. data/db/migrate/20100927140446_change_payment_add_card_type_card_number.rb +0 -11
  174. data/db/migrate/20100929011106_fix_relationship_foreign_keys.rb +0 -101
  175. data/db/migrate/20100929011607_drop_shop_addressables.rb +0 -25
  176. data/db/migrate/20100929030510_create_shop_groups.rb +0 -19
  177. data/db/migrate/20100929080301_shop_groups_change_add_description.rb +0 -11
  178. data/db/migrate/20100929081200_create_variants.rb +0 -20
  179. data/db/migrate/20100929143531_change_variants_add_updated_by.rb +0 -25
  180. data/db/migrate/20100929145641_change_created_by_to_id.rb +0 -75
  181. data/db/migrate/20100929235221_change_category_add_variant_id.rb +0 -9
  182. data/db/migrate/20100930235221_create_packages.rb +0 -31
  183. data/db/migrate/20101005231713_create_page_ids.rb +0 -11
  184. data/db/migrate/20101006051214_create_pages_for_products_and_categories.rb +0 -73
  185. data/db/migrate/20101007111845_add_default_position_to_attachment.rb +0 -9
  186. data/db/migrate/20101010071143_create_discounts.rb +0 -29
  187. data/db/migrate/20101010072225_modify_categories_remove_variant.rb +0 -9
  188. data/db/migrate/20101010130034_change_discountables_add_observer.rb +0 -15
  189. data/db/migrate/20101011063133_change_orders_set_limits_to_null.rb +0 -11
  190. data/features/support/env.rb +0 -16
  191. data/features/support/paths.rb +0 -14
  192. data/lib/shop/interface/packages.rb +0 -34
  193. data/lib/shop/interface/variants.rb +0 -34
  194. data/lib/shop/tags/package.rb +0 -95
  195. data/lib/shop/tags/product_variant.rb +0 -52
  196. data/lib/shop/tags/responses.rb +0 -34
  197. data/mockups/balsamiq/products-retro_fun_tshirt-more.bmml +0 -0
  198. data/mockups/balsamiq/products-retro_fun_tshirt.bmml +0 -0
  199. data/mockups/discounts/new-edit.bmml +0 -492
  200. data/public/javascripts/admin/extensions/shop/discounts/edit.js +0 -76
  201. data/public/javascripts/admin/extensions/shop/packages/edit.js +0 -109
  202. data/public/stylesheets/sass/admin/extensions/shop/discounts/edit.sass +0 -125
  203. data/public/stylesheets/sass/admin/extensions/shop/packages/edit.sass +0 -162
  204. data/spec/controllers/admin/shop/discounts/discountables_controller_spec.rb +0 -73
  205. data/spec/controllers/admin/shop/discounts_controller_spec.rb +0 -81
  206. data/spec/controllers/admin/shop/packages/packings_controller_spec.rb +0 -188
  207. data/spec/controllers/admin/shop/packages_controller_spec.rb +0 -32
  208. data/spec/controllers/admin/shop/products/variant_templates_controller_spec.rb +0 -53
  209. data/spec/controllers/admin/shop/products/variants_controller_spec.rb +0 -116
  210. data/spec/controllers/admin/shop/variants_controller_spec.rb +0 -67
  211. data/spec/datasets/shop_discountables.rb +0 -22
  212. data/spec/datasets/shop_discounts.rb +0 -29
  213. data/spec/datasets/shop_groups.rb +0 -15
  214. data/spec/datasets/shop_packages.rb +0 -25
  215. data/spec/datasets/shop_product_variants.rb +0 -22
  216. data/spec/datasets/shop_variants.rb +0 -17
  217. data/spec/lib/shop/tags/package_spec.rb +0 -342
  218. data/spec/lib/shop/tags/product_variant_spec.rb +0 -175
  219. data/spec/lib/shop/tags/responses_spec.rb +0 -129
  220. data/spec/models/form_discount_spec.rb +0 -63
  221. data/spec/models/shop_discount_spec.rb +0 -130
  222. data/spec/models/shop_discountable_spec.rb +0 -114
  223. data/spec/models/shop_group_spec.rb +0 -38
  224. data/spec/models/shop_package_spec.rb +0 -117
  225. data/spec/models/shop_packing_spec.rb +0 -67
  226. data/spec/models/shop_product_variant_spec.rb +0 -92
  227. data/spec/models/shop_variant_spec.rb +0 -32
@@ -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
@@ -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
@@ -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,4 +0,0 @@
1
- - if @page.class_name == "ShopCategoryPage"
2
- %p
3
- %label{:for => 'page_shop_category_id'} Category
4
- = collection_select :page, :shop_category_id, ShopCategory.all, :id, :name
@@ -1,4 +0,0 @@
1
- - if @page.class_name == "ShopProductPage"
2
- %p
3
- %label{:for => 'page_shop_product_id'} Product
4
- = collection_select :page, :shop_product_id, ShopProduct.all, :id, :name
@@ -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&#8230;"} 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,4 +0,0 @@
1
- %h1
2
- = @page_title
3
- - @buttons.each do |button|
4
- = render :partial => "admin/shop/discounts/edit/buttons/#{button}"
@@ -1,2 +0,0 @@
1
- - @inputs.each do |input|
2
- = render :partial => "admin/shop/discounts/edit/inputs/#{input}", :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,4 +0,0 @@
1
- #popups
2
- - @popups.each do |popup|
3
- .popup{ :id => "#{popup}_popup"}
4
- = render :partial => "admin/shop/discounts/edit/popups/#{popup}"
@@ -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,3 +0,0 @@
1
- %p.title
2
- = f.label :amount, t('amount')
3
- = f.text_field :amount, :class => 'textbox', :maxlenth => 255
@@ -1,3 +0,0 @@
1
- %p.title
2
- = f.label :code, t('code')
3
- = f.text_field :code, :class => 'textbox', :maxlenth => 255
@@ -1,3 +0,0 @@
1
- %p.title
2
- = f.label :name, t('name')
3
- = f.text_field :name, :class => 'textbox', :maxlenth => 255
@@ -1,5 +0,0 @@
1
- %tr
2
- %th.label
3
- = f.label :finishes_at, t('finishes')
4
- %td.field
5
- = f.text_field :finishes_at, :class => 'date'
@@ -1,5 +0,0 @@
1
- %tr
2
- %th.label
3
- = f.label :starts_at, t('starts')
4
- %td.field
5
- = f.text_field :starts_at, :class => 'date'
@@ -1,3 +0,0 @@
1
- %ul#discount_categories.categories.discounteds
2
- - @shop_discount.discountables.for('ShopCategory').each do |category|
3
- = render :partial => 'admin/shop/discounts/edit/shared/category', :locals => { :category => category }
@@ -1,3 +0,0 @@
1
- %ul#discount_products.products.discounteds
2
- - @shop_discount.discountables.for('ShopProduct').each do |product|
3
- = render :partial => 'admin/shop/discounts/edit/shared/product', :locals => { :product => product }
@@ -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,6 +0,0 @@
1
- %h3.title Browse Products
2
-
3
- %ul#available_products.availables
4
- = render :partial => '/admin/shop/discounts/edit/shared/product', :collection => @shop_discount.available_products
5
-
6
- %a#browse_products_popup_close.close{ :href => '#browse_products_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,5 +0,0 @@
1
- %ul
2
- - render_region :foot do |foot|
3
- - foot.buttons do
4
- - @buttons.each do |button|
5
- %li= render :partial => "admin/shop/discounts/index/buttons/#{button}"
@@ -1,2 +0,0 @@
1
- - render_region :head do |head|
2
- - nil
@@ -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&#8230;"} 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&#8230;"} 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,4 +0,0 @@
1
- %h1
2
- = @page_title
3
- - @buttons.each do |button|
4
- = render :partial => "admin/shop/packages/edit/buttons/#{button}"
@@ -1,2 +0,0 @@
1
- - @inputs.each do |input|
2
- = render :partial => "admin/shop/packages/edit/inputs/#{input}", :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,4 +0,0 @@
1
- #popups
2
- - @popups.each do |popup|
3
- .popup{ :id => "#{popup}_popup"}
4
- = render :partial => "admin/shop/packages/edit/popups/#{popup}"
@@ -1 +0,0 @@
1
- = link_to "#{image('plus')} #{t('browse_products')}", '#browse_products_popup', :class => 'popup button'
@@ -1,3 +0,0 @@
1
- %p.title
2
- = f.label :name
3
- = f.text_field :name, :class => 'textbox', :maxlenth => 255
@@ -1,3 +0,0 @@
1
- %p.title
2
- = f.label :price
3
- = f.text_field :price, :class => 'textbox', :maxlenth => 255, :value => input_currency(@shop_package.price)
@@ -1,5 +0,0 @@
1
- %tr
2
- %th.label
3
- %label{:for=>"shop_package[sku]"}= t('sku')
4
- %td.field
5
- = f.text_field :sku, :class =>'textbox'
@@ -1 +0,0 @@
1
- ~ f.text_area :description, :class => "textarea large", :style => "width: 100%"
@@ -1,3 +0,0 @@
1
- %ol#package_products
2
- - @shop_package.packings.each do |packing|
3
- = render :partial => 'admin/shop/packages/edit/shared/product', :locals => { :product => packing.product, :packing => packing }
@@ -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,8 +0,0 @@
1
- %ul
2
- - render_region :foot do |foot|
3
- - foot.buttons do
4
- - @buttons.each do |button|
5
- %li= render :partial => "admin/shop/packages/index/buttons/#{button}"
6
-
7
- :javascript
8
- if(typeof(ROUTES) === 'undefined') ROUTES = new Array();
@@ -1,2 +0,0 @@
1
- - render_region :head do |head|
2
- - nil
@@ -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,11 +0,0 @@
1
- - @page_title = t('new_package')
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,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&#8230;"} 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'
@@ -1,3 +0,0 @@
1
- %ul#variants
2
- - f.fields_for :variants do |vf|
3
- = render :partial => 'admin/shop/products/edit/shared/variant', :locals => { :vf => vf }