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,492 +0,0 @@
1
- <mockup version="1.0" skin="sketch" measuredW="2141" measuredH="1573" mockupW="2100" mockupH="1531">
2
- <controls>
3
- <control controlID="0" controlTypeID="com.balsamiq.mockups::BrowserWindow" x="31" y="32" w="1024" h="732" measuredW="450" measuredH="400" zOrder="0" locked="false" isInGroup="-1">
4
- <controlProperties>
5
- <text>A%20Web%20Page%0Ahttp%3A//admin/shop/discounts/new</text>
6
- </controlProperties>
7
- </control>
8
- <control controlID="1" controlTypeID="com.balsamiq.mockups::TextInput" x="78" y="290" w="930" h="-1" measuredW="118" measuredH="36" zOrder="3" locked="false" isInGroup="-1">
9
- <controlProperties>
10
- <size>20</size>
11
- <text>Free%20Friday</text>
12
- </controlProperties>
13
- </control>
14
- <control controlID="2" controlTypeID="com.balsamiq.mockups::Label" x="78" y="267" w="-1" h="-1" measuredW="38" measuredH="23" zOrder="4" locked="false" isInGroup="-1">
15
- <controlProperties>
16
- <text>Name</text>
17
- </controlProperties>
18
- </control>
19
- <control controlID="3" controlTypeID="com.balsamiq.mockups::TextInput" x="78" y="364" w="930" h="-1" measuredW="79" measuredH="36" zOrder="6" locked="false" isInGroup="-1">
20
- <controlProperties>
21
- <size>20</size>
22
- <text/>
23
- </controlProperties>
24
- </control>
25
- <control controlID="4" controlTypeID="com.balsamiq.mockups::Label" x="78" y="341" w="-1" h="-1" measuredW="71" measuredH="23" zOrder="7" locked="false" isInGroup="-1">
26
- <controlProperties>
27
- <text>Discount%20%25</text>
28
- </controlProperties>
29
- </control>
30
- <control controlID="6" controlTypeID="com.balsamiq.mockups::TextInput" x="78" y="438" w="930" h="-1" measuredW="79" measuredH="36" zOrder="8" locked="false" isInGroup="-1">
31
- <controlProperties>
32
- <size>20</size>
33
- <text/>
34
- </controlProperties>
35
- </control>
36
- <control controlID="7" controlTypeID="com.balsamiq.mockups::Label" x="78" y="415" w="-1" h="-1" measuredW="85" measuredH="23" zOrder="9" locked="false" isInGroup="-1">
37
- <controlProperties>
38
- <text>Voucher%20Code</text>
39
- </controlProperties>
40
- </control>
41
- <control controlID="8" controlTypeID="com.balsamiq.mockups::Canvas" x="78" y="471" w="87" h="27" measuredW="100" measuredH="70" zOrder="10" locked="false" isInGroup="-1">
42
- <controlProperties>
43
- <color>5263440</color>
44
- </controlProperties>
45
- </control>
46
- <control controlID="9" controlTypeID="com.balsamiq.mockups::Label" x="80" y="474" w="85" h="19" measuredW="27" measuredH="19" zOrder="11" locked="false" isInGroup="-1">
47
- <controlProperties>
48
- <align>center</align>
49
- <color>16777215</color>
50
- <size>10</size>
51
- <text>more</text>
52
- </controlProperties>
53
- </control>
54
- <control controlID="10" controlTypeID="com.balsamiq.mockups::Canvas" x="78" y="662" w="930" h="49" measuredW="100" measuredH="70" zOrder="12" locked="false" isInGroup="-1"/>
55
- <control controlID="12" controlTypeID="com.balsamiq.mockups::Button" x="88" y="672" w="-1" h="-1" measuredW="52" measuredH="28" zOrder="13" locked="false" isInGroup="-1">
56
- <controlProperties>
57
- <text>Save</text>
58
- </controlProperties>
59
- </control>
60
- <control controlID="13" controlTypeID="com.balsamiq.mockups::Button" x="155" y="672" w="193" h="28" measuredW="179" measuredH="28" zOrder="14" locked="false" isInGroup="-1">
61
- <controlProperties>
62
- <text>Save%20and%20Continue%20Editing</text>
63
- </controlProperties>
64
- </control>
65
- <control controlID="14" controlTypeID="com.balsamiq.mockups::Link" x="358" y="675" w="-1" h="-1" measuredW="42" measuredH="23" zOrder="15" locked="false" isInGroup="-1">
66
- <controlProperties>
67
- <text>cancel</text>
68
- </controlProperties>
69
- </control>
70
- <control controlID="16" controlTypeID="com.balsamiq.mockups::TabBar" x="38" y="113" w="1017" h="625" measuredW="364" measuredH="100" zOrder="2" locked="false" isInGroup="-1">
71
- <controlProperties>
72
- <selectedIndex>3</selectedIndex>
73
- <size>18</size>
74
- <text>content%2C%20Design%2C%20Settings%2C%20Shop</text>
75
- </controlProperties>
76
- </control>
77
- <control controlID="20" controlTypeID="com.balsamiq.mockups::Canvas" x="36" y="101" w="1019" h="637" measuredW="100" measuredH="70" zOrder="1" locked="false" isInGroup="-1">
78
- <controlProperties>
79
- <color>10027008</color>
80
- </controlProperties>
81
- </control>
82
- <control controlID="21" controlTypeID="com.balsamiq.mockups::Canvas" x="38" y="185" w="1017" h="49" measuredW="100" measuredH="70" zOrder="16" locked="false" isInGroup="-1">
83
- <controlProperties>
84
- <color>5263440</color>
85
- </controlProperties>
86
- </control>
87
- <control controlID="22" controlTypeID="com.balsamiq.mockups::Button" x="771" y="195" w="111" h="28" measuredW="79" measuredH="28" zOrder="17" locked="false" isInGroup="-1">
88
- <controlProperties>
89
- <color>16777215</color>
90
- <text>Packages</text>
91
- </controlProperties>
92
- </control>
93
- <control controlID="23" controlTypeID="com.balsamiq.mockups::Button" x="645" y="195" w="111" h="28" measuredW="74" measuredH="28" zOrder="18" locked="false" isInGroup="-1">
94
- <controlProperties>
95
- <color>16777215</color>
96
- <text>Variants</text>
97
- </controlProperties>
98
- </control>
99
- <control controlID="24" controlTypeID="com.balsamiq.mockups::Button" x="897" y="195" w="111" h="28" measuredW="80" measuredH="28" zOrder="19" locked="false" isInGroup="-1">
100
- <controlProperties>
101
- <color>13421772</color>
102
- <text>Discounts</text>
103
- </controlProperties>
104
- </control>
105
- <control controlID="28" controlTypeID="com.balsamiq.mockups::VRule" x="262" y="145" w="-1" h="40" measuredW="5" measuredH="100" zOrder="20" locked="false" isInGroup="-1"/>
106
- <control controlID="29" controlTypeID="com.balsamiq.mockups::VRule" x="384" y="145" w="-1" h="40" measuredW="5" measuredH="100" zOrder="21" locked="false" isInGroup="-1"/>
107
- <control controlID="30" controlTypeID="com.balsamiq.mockups::Label" x="38" y="150" w="117" h="29" measuredW="77" measuredH="29" zOrder="22" locked="false" isInGroup="-1">
108
- <controlProperties>
109
- <align>center</align>
110
- <size>18</size>
111
- <text>Products</text>
112
- </controlProperties>
113
- </control>
114
- <control controlID="31" controlTypeID="com.balsamiq.mockups::Label" x="155" y="150" w="109" h="29" measuredW="60" measuredH="29" zOrder="23" locked="false" isInGroup="-1">
115
- <controlProperties>
116
- <align>center</align>
117
- <size>18</size>
118
- <text>Orders</text>
119
- </controlProperties>
120
- </control>
121
- <control controlID="32" controlTypeID="com.balsamiq.mockups::Label" x="262" y="150" w="122" h="29" measuredW="90" measuredH="29" zOrder="24" locked="false" isInGroup="-1">
122
- <controlProperties>
123
- <align>center</align>
124
- <size>18</size>
125
- <text>Customers</text>
126
- </controlProperties>
127
- </control>
128
- <control controlID="33" controlTypeID="com.balsamiq.mockups::Canvas" x="38" y="141" w="117" h="44" measuredW="100" measuredH="70" zOrder="5" locked="false" isInGroup="-1">
129
- <controlProperties>
130
- <borderStyle>none</borderStyle>
131
- <color>13421772</color>
132
- </controlProperties>
133
- </control>
134
- <control controlID="34" controlTypeID="com.balsamiq.mockups::TabBar" x="78" y="517" w="930" h="124" measuredW="167" measuredH="100" zOrder="25" locked="false" isInGroup="-1">
135
- <controlProperties>
136
- <selectedIndex>0</selectedIndex>
137
- <text>categories</text>
138
- </controlProperties>
139
- </control>
140
- <control controlID="35" controlTypeID="com.balsamiq.mockups::CheckBoxGroup" x="95" y="558" w="899" h="115" measuredW="80" measuredH="69" zOrder="26" locked="false" isInGroup="-1">
141
- <controlProperties>
142
- <text>%5B%20%5D%20books%0A%5Bx%5D%20movies%0A%5B%20%5D%20figurines</text>
143
- </controlProperties>
144
- </control>
145
- <control controlID="36" controlTypeID="com.balsamiq.mockups::BrowserWindow" x="1107" y="32" w="1024" h="867" measuredW="450" measuredH="400" zOrder="27" locked="false" isInGroup="-1">
146
- <controlProperties>
147
- <text>A%20Web%20Page%0Ahttp%3A//admin/shop/discounts/1/edit</text>
148
- </controlProperties>
149
- </control>
150
- <control controlID="37" controlTypeID="com.balsamiq.mockups::Canvas" x="1112" y="101" w="1019" h="766" measuredW="100" measuredH="70" zOrder="28" locked="false" isInGroup="-1">
151
- <controlProperties>
152
- <color>10027008</color>
153
- </controlProperties>
154
- </control>
155
- <control controlID="38" controlTypeID="com.balsamiq.mockups::TabBar" x="1114" y="113" w="1017" h="758" measuredW="364" measuredH="100" zOrder="29" locked="false" isInGroup="-1">
156
- <controlProperties>
157
- <selectedIndex>3</selectedIndex>
158
- <size>18</size>
159
- <text>content%2C%20Design%2C%20Settings%2C%20Shop</text>
160
- </controlProperties>
161
- </control>
162
- <control controlID="39" controlTypeID="com.balsamiq.mockups::TextInput" x="1154" y="290" w="930" h="-1" measuredW="118" measuredH="36" zOrder="30" locked="false" isInGroup="-1">
163
- <controlProperties>
164
- <size>20</size>
165
- <text>Free%20Friday</text>
166
- </controlProperties>
167
- </control>
168
- <control controlID="40" controlTypeID="com.balsamiq.mockups::Label" x="1154" y="267" w="-1" h="-1" measuredW="38" measuredH="23" zOrder="31" locked="false" isInGroup="-1">
169
- <controlProperties>
170
- <text>Name</text>
171
- </controlProperties>
172
- </control>
173
- <control controlID="41" controlTypeID="com.balsamiq.mockups::Canvas" x="1114" y="141" w="117" h="44" measuredW="100" measuredH="70" zOrder="32" locked="false" isInGroup="-1">
174
- <controlProperties>
175
- <borderStyle>none</borderStyle>
176
- <color>13421772</color>
177
- </controlProperties>
178
- </control>
179
- <control controlID="42" controlTypeID="com.balsamiq.mockups::TextInput" x="1154" y="364" w="930" h="-1" measuredW="35" measuredH="36" zOrder="33" locked="false" isInGroup="-1">
180
- <controlProperties>
181
- <size>20</size>
182
- <text>25</text>
183
- </controlProperties>
184
- </control>
185
- <control controlID="43" controlTypeID="com.balsamiq.mockups::Label" x="1154" y="341" w="-1" h="-1" measuredW="71" measuredH="23" zOrder="34" locked="false" isInGroup="-1">
186
- <controlProperties>
187
- <text>Discount%20%25</text>
188
- </controlProperties>
189
- </control>
190
- <control controlID="44" controlTypeID="com.balsamiq.mockups::TextInput" x="1154" y="438" w="930" h="-1" measuredW="53" measuredH="36" zOrder="35" locked="false" isInGroup="-1">
191
- <controlProperties>
192
- <size>20</size>
193
- <text>ff25</text>
194
- </controlProperties>
195
- </control>
196
- <control controlID="45" controlTypeID="com.balsamiq.mockups::Label" x="1154" y="415" w="-1" h="-1" measuredW="85" measuredH="23" zOrder="36" locked="false" isInGroup="-1">
197
- <controlProperties>
198
- <text>Voucher%20Code</text>
199
- </controlProperties>
200
- </control>
201
- <control controlID="46" controlTypeID="com.balsamiq.mockups::Canvas" x="1154" y="573" w="87" h="27" measuredW="100" measuredH="70" zOrder="37" locked="false" isInGroup="-1">
202
- <controlProperties>
203
- <color>5263440</color>
204
- </controlProperties>
205
- </control>
206
- <control controlID="47" controlTypeID="com.balsamiq.mockups::Label" x="1156" y="576" w="85" h="19" measuredW="27" measuredH="19" zOrder="38" locked="false" isInGroup="-1">
207
- <controlProperties>
208
- <align>center</align>
209
- <color>16777215</color>
210
- <size>10</size>
211
- <text>more</text>
212
- </controlProperties>
213
- </control>
214
- <control controlID="48" controlTypeID="com.balsamiq.mockups::Canvas" x="1154" y="793" w="930" h="49" measuredW="100" measuredH="70" zOrder="39" locked="false" isInGroup="-1"/>
215
- <control controlID="49" controlTypeID="com.balsamiq.mockups::Button" x="1164" y="803" w="-1" h="-1" measuredW="52" measuredH="28" zOrder="40" locked="false" isInGroup="-1">
216
- <controlProperties>
217
- <text>Save</text>
218
- </controlProperties>
219
- </control>
220
- <control controlID="50" controlTypeID="com.balsamiq.mockups::Button" x="1231" y="803" w="193" h="28" measuredW="179" measuredH="28" zOrder="41" locked="false" isInGroup="-1">
221
- <controlProperties>
222
- <text>Save%20and%20Continue%20Editing</text>
223
- </controlProperties>
224
- </control>
225
- <control controlID="51" controlTypeID="com.balsamiq.mockups::Link" x="1434" y="806" w="-1" h="-1" measuredW="42" measuredH="23" zOrder="42" locked="false" isInGroup="-1">
226
- <controlProperties>
227
- <text>cancel</text>
228
- </controlProperties>
229
- </control>
230
- <control controlID="52" controlTypeID="com.balsamiq.mockups::Canvas" x="1114" y="185" w="1017" h="49" measuredW="100" measuredH="70" zOrder="43" locked="false" isInGroup="-1">
231
- <controlProperties>
232
- <color>5263440</color>
233
- </controlProperties>
234
- </control>
235
- <control controlID="53" controlTypeID="com.balsamiq.mockups::Button" x="1852" y="195" w="111" h="28" measuredW="79" measuredH="28" zOrder="44" locked="false" isInGroup="-1">
236
- <controlProperties>
237
- <color>16777215</color>
238
- <text>Packages</text>
239
- </controlProperties>
240
- </control>
241
- <control controlID="54" controlTypeID="com.balsamiq.mockups::Button" x="1726" y="195" w="111" h="28" measuredW="74" measuredH="28" zOrder="45" locked="false" isInGroup="-1">
242
- <controlProperties>
243
- <color>16777215</color>
244
- <text>Variants</text>
245
- </controlProperties>
246
- </control>
247
- <control controlID="55" controlTypeID="com.balsamiq.mockups::Button" x="1973" y="195" w="111" h="28" measuredW="80" measuredH="28" zOrder="46" locked="false" isInGroup="-1">
248
- <controlProperties>
249
- <color>13421772</color>
250
- <text>Discounts</text>
251
- </controlProperties>
252
- </control>
253
- <control controlID="56" controlTypeID="com.balsamiq.mockups::VRule" x="1338" y="145" w="-1" h="40" measuredW="5" measuredH="100" zOrder="47" locked="false" isInGroup="-1"/>
254
- <control controlID="57" controlTypeID="com.balsamiq.mockups::VRule" x="1460" y="145" w="-1" h="40" measuredW="5" measuredH="100" zOrder="48" locked="false" isInGroup="-1"/>
255
- <control controlID="58" controlTypeID="com.balsamiq.mockups::Label" x="1114" y="150" w="117" h="29" measuredW="77" measuredH="29" zOrder="49" locked="false" isInGroup="-1">
256
- <controlProperties>
257
- <align>center</align>
258
- <size>18</size>
259
- <text>Products</text>
260
- </controlProperties>
261
- </control>
262
- <control controlID="59" controlTypeID="com.balsamiq.mockups::Label" x="1231" y="150" w="109" h="29" measuredW="60" measuredH="29" zOrder="50" locked="false" isInGroup="-1">
263
- <controlProperties>
264
- <align>center</align>
265
- <size>18</size>
266
- <text>Orders</text>
267
- </controlProperties>
268
- </control>
269
- <control controlID="60" controlTypeID="com.balsamiq.mockups::Label" x="1338" y="150" w="122" h="29" measuredW="90" measuredH="29" zOrder="51" locked="false" isInGroup="-1">
270
- <controlProperties>
271
- <align>center</align>
272
- <size>18</size>
273
- <text>Customers</text>
274
- </controlProperties>
275
- </control>
276
- <control controlID="61" controlTypeID="com.balsamiq.mockups::TabBar" x="1154" y="626" w="930" h="138" measuredW="167" measuredH="100" zOrder="52" locked="false" isInGroup="-1">
277
- <controlProperties>
278
- <selectedIndex>0</selectedIndex>
279
- <text>categories</text>
280
- </controlProperties>
281
- </control>
282
- <control controlID="62" controlTypeID="com.balsamiq.mockups::CheckBoxGroup" x="1171" y="672" w="899" h="77" measuredW="80" measuredH="69" zOrder="53" locked="false" isInGroup="-1">
283
- <controlProperties>
284
- <text>%5B%20%5D%20books%0A%5Bx%5D%20movies%0A%5B%20%5D%20figurines</text>
285
- </controlProperties>
286
- </control>
287
- <control controlID="63" controlTypeID="com.balsamiq.mockups::Canvas" x="1155" y="470" w="930" h="105" measuredW="100" measuredH="70" zOrder="54" locked="false" isInGroup="-1">
288
- <controlProperties>
289
- <color>5263440</color>
290
- </controlProperties>
291
- </control>
292
- <control controlID="64" controlTypeID="com.balsamiq.mockups::Label" x="1171" y="483" w="100" h="24" measuredW="72" measuredH="23" zOrder="55" locked="false" isInGroup="-1">
293
- <controlProperties>
294
- <color>16777215</color>
295
- <text>Start%20Date</text>
296
- </controlProperties>
297
- </control>
298
- <control controlID="65" controlTypeID="com.balsamiq.mockups::Label" x="1171" y="533" w="100" h="24" measuredW="60" measuredH="23" zOrder="56" locked="false" isInGroup="-1">
299
- <controlProperties>
300
- <color>16777215</color>
301
- <text>End%20Date</text>
302
- </controlProperties>
303
- </control>
304
- <control controlID="66" controlTypeID="com.balsamiq.mockups::TextInput" x="1258" y="481" w="186" h="-1" measuredW="79" measuredH="27" zOrder="57" locked="false" isInGroup="-1">
305
- <controlProperties>
306
- <size>13</size>
307
- <text/>
308
- </controlProperties>
309
- </control>
310
- <control controlID="67" controlTypeID="com.balsamiq.mockups::TextInput" x="1258" y="531" w="186" h="-1" measuredW="79" measuredH="27" zOrder="58" locked="false" isInGroup="-1">
311
- <controlProperties>
312
- <size>13</size>
313
- <text/>
314
- </controlProperties>
315
- </control>
316
- <control controlID="68" controlTypeID="com.balsamiq.mockups::Icon" x="1447" y="479" w="-1" h="-1" measuredW="32" measuredH="32" zOrder="59" locked="false" isInGroup="-1">
317
- <controlProperties>
318
- <color>0</color>
319
- <icon>CalendarIcon%7Cmedium</icon>
320
- </controlProperties>
321
- </control>
322
- <control controlID="69" controlTypeID="com.balsamiq.mockups::Icon" x="1446" y="529" w="-1" h="-1" measuredW="32" measuredH="32" zOrder="60" locked="false" isInGroup="-1">
323
- <controlProperties>
324
- <color>0</color>
325
- <icon>CalendarIcon%7Cmedium</icon>
326
- </controlProperties>
327
- </control>
328
- <control controlID="70" controlTypeID="com.balsamiq.mockups::Label" x="75" y="194" w="-1" h="-1" measuredW="109" measuredH="29" zOrder="61" locked="false" isInGroup="-1">
329
- <controlProperties>
330
- <color>16777215</color>
331
- <size>18</size>
332
- <text>New%20Product</text>
333
- </controlProperties>
334
- </control>
335
- <control controlID="71" controlTypeID="com.balsamiq.mockups::Label" x="1154" y="194" w="-1" h="-1" measuredW="98" measuredH="29" zOrder="62" locked="false" isInGroup="-1">
336
- <controlProperties>
337
- <color>16777215</color>
338
- <size>18</size>
339
- <text>Free%20Friday</text>
340
- </controlProperties>
341
- </control>
342
- <control controlID="72" controlTypeID="com.balsamiq.mockups::BrowserWindow" x="38" y="831" w="1024" h="732" measuredW="450" measuredH="400" zOrder="63" locked="false" isInGroup="-1">
343
- <controlProperties>
344
- <text>A%20Web%20Page%0Ahttp%3A//admin/shop/discounts/new</text>
345
- </controlProperties>
346
- </control>
347
- <control controlID="73" controlTypeID="com.balsamiq.mockups::Canvas" x="43" y="900" w="1019" h="637" measuredW="100" measuredH="70" zOrder="64" locked="false" isInGroup="-1">
348
- <controlProperties>
349
- <color>10027008</color>
350
- </controlProperties>
351
- </control>
352
- <control controlID="74" controlTypeID="com.balsamiq.mockups::TabBar" x="45" y="912" w="1017" h="625" measuredW="364" measuredH="100" zOrder="65" locked="false" isInGroup="-1">
353
- <controlProperties>
354
- <selectedIndex>3</selectedIndex>
355
- <size>18</size>
356
- <text>content%2C%20Design%2C%20Settings%2C%20Shop</text>
357
- </controlProperties>
358
- </control>
359
- <control controlID="75" controlTypeID="com.balsamiq.mockups::TextInput" x="85" y="1089" w="930" h="-1" measuredW="118" measuredH="36" zOrder="66" locked="false" isInGroup="-1">
360
- <controlProperties>
361
- <size>20</size>
362
- <text>Free%20Friday</text>
363
- </controlProperties>
364
- </control>
365
- <control controlID="76" controlTypeID="com.balsamiq.mockups::Label" x="85" y="1066" w="-1" h="-1" measuredW="38" measuredH="23" zOrder="67" locked="false" isInGroup="-1">
366
- <controlProperties>
367
- <text>Name</text>
368
- </controlProperties>
369
- </control>
370
- <control controlID="77" controlTypeID="com.balsamiq.mockups::Canvas" x="45" y="940" w="117" h="44" measuredW="100" measuredH="70" zOrder="68" locked="false" isInGroup="-1">
371
- <controlProperties>
372
- <borderStyle>none</borderStyle>
373
- <color>13421772</color>
374
- </controlProperties>
375
- </control>
376
- <control controlID="78" controlTypeID="com.balsamiq.mockups::TextInput" x="85" y="1163" w="930" h="-1" measuredW="79" measuredH="36" zOrder="69" locked="false" isInGroup="-1">
377
- <controlProperties>
378
- <size>20</size>
379
- <text/>
380
- </controlProperties>
381
- </control>
382
- <control controlID="79" controlTypeID="com.balsamiq.mockups::Label" x="85" y="1140" w="-1" h="-1" measuredW="71" measuredH="23" zOrder="70" locked="false" isInGroup="-1">
383
- <controlProperties>
384
- <text>Discount%20%25</text>
385
- </controlProperties>
386
- </control>
387
- <control controlID="80" controlTypeID="com.balsamiq.mockups::TextInput" x="85" y="1237" w="930" h="-1" measuredW="79" measuredH="36" zOrder="71" locked="false" isInGroup="-1">
388
- <controlProperties>
389
- <size>20</size>
390
- <text/>
391
- </controlProperties>
392
- </control>
393
- <control controlID="81" controlTypeID="com.balsamiq.mockups::Label" x="85" y="1214" w="-1" h="-1" measuredW="85" measuredH="23" zOrder="72" locked="false" isInGroup="-1">
394
- <controlProperties>
395
- <text>Voucher%20Code</text>
396
- </controlProperties>
397
- </control>
398
- <control controlID="82" controlTypeID="com.balsamiq.mockups::Canvas" x="85" y="1270" w="87" h="27" measuredW="100" measuredH="70" zOrder="73" locked="false" isInGroup="-1">
399
- <controlProperties>
400
- <color>5263440</color>
401
- </controlProperties>
402
- </control>
403
- <control controlID="83" controlTypeID="com.balsamiq.mockups::Label" x="87" y="1273" w="85" h="19" measuredW="27" measuredH="19" zOrder="74" locked="false" isInGroup="-1">
404
- <controlProperties>
405
- <align>center</align>
406
- <color>16777215</color>
407
- <size>10</size>
408
- <text>more</text>
409
- </controlProperties>
410
- </control>
411
- <control controlID="84" controlTypeID="com.balsamiq.mockups::Canvas" x="85" y="1461" w="930" h="49" measuredW="100" measuredH="70" zOrder="75" locked="false" isInGroup="-1"/>
412
- <control controlID="85" controlTypeID="com.balsamiq.mockups::Button" x="95" y="1471" w="-1" h="-1" measuredW="52" measuredH="28" zOrder="76" locked="false" isInGroup="-1">
413
- <controlProperties>
414
- <text>Save</text>
415
- </controlProperties>
416
- </control>
417
- <control controlID="86" controlTypeID="com.balsamiq.mockups::Button" x="162" y="1471" w="193" h="28" measuredW="179" measuredH="28" zOrder="77" locked="false" isInGroup="-1">
418
- <controlProperties>
419
- <text>Save%20and%20Continue%20Editing</text>
420
- </controlProperties>
421
- </control>
422
- <control controlID="87" controlTypeID="com.balsamiq.mockups::Link" x="365" y="1474" w="-1" h="-1" measuredW="42" measuredH="23" zOrder="78" locked="false" isInGroup="-1">
423
- <controlProperties>
424
- <text>cancel</text>
425
- </controlProperties>
426
- </control>
427
- <control controlID="88" controlTypeID="com.balsamiq.mockups::Canvas" x="45" y="984" w="1017" h="49" measuredW="100" measuredH="70" zOrder="79" locked="false" isInGroup="-1">
428
- <controlProperties>
429
- <color>5263440</color>
430
- </controlProperties>
431
- </control>
432
- <control controlID="89" controlTypeID="com.balsamiq.mockups::Button" x="778" y="994" w="111" h="28" measuredW="79" measuredH="28" zOrder="80" locked="false" isInGroup="-1">
433
- <controlProperties>
434
- <color>16777215</color>
435
- <text>Packages</text>
436
- </controlProperties>
437
- </control>
438
- <control controlID="90" controlTypeID="com.balsamiq.mockups::Button" x="652" y="994" w="111" h="28" measuredW="74" measuredH="28" zOrder="81" locked="false" isInGroup="-1">
439
- <controlProperties>
440
- <color>16777215</color>
441
- <text>Variants</text>
442
- </controlProperties>
443
- </control>
444
- <control controlID="91" controlTypeID="com.balsamiq.mockups::Button" x="904" y="994" w="111" h="28" measuredW="80" measuredH="28" zOrder="82" locked="false" isInGroup="-1">
445
- <controlProperties>
446
- <color>13421772</color>
447
- <text>Discounts</text>
448
- </controlProperties>
449
- </control>
450
- <control controlID="92" controlTypeID="com.balsamiq.mockups::VRule" x="269" y="944" w="-1" h="40" measuredW="5" measuredH="100" zOrder="83" locked="false" isInGroup="-1"/>
451
- <control controlID="93" controlTypeID="com.balsamiq.mockups::VRule" x="391" y="944" w="-1" h="40" measuredW="5" measuredH="100" zOrder="84" locked="false" isInGroup="-1"/>
452
- <control controlID="94" controlTypeID="com.balsamiq.mockups::Label" x="45" y="949" w="117" h="29" measuredW="77" measuredH="29" zOrder="85" locked="false" isInGroup="-1">
453
- <controlProperties>
454
- <align>center</align>
455
- <size>18</size>
456
- <text>Products</text>
457
- </controlProperties>
458
- </control>
459
- <control controlID="95" controlTypeID="com.balsamiq.mockups::Label" x="162" y="949" w="109" h="29" measuredW="60" measuredH="29" zOrder="86" locked="false" isInGroup="-1">
460
- <controlProperties>
461
- <align>center</align>
462
- <size>18</size>
463
- <text>Orders</text>
464
- </controlProperties>
465
- </control>
466
- <control controlID="96" controlTypeID="com.balsamiq.mockups::Label" x="269" y="949" w="122" h="29" measuredW="90" measuredH="29" zOrder="87" locked="false" isInGroup="-1">
467
- <controlProperties>
468
- <align>center</align>
469
- <size>18</size>
470
- <text>Customers</text>
471
- </controlProperties>
472
- </control>
473
- <control controlID="97" controlTypeID="com.balsamiq.mockups::TabBar" x="85" y="1316" w="930" h="124" measuredW="167" measuredH="100" zOrder="88" locked="false" isInGroup="-1">
474
- <controlProperties>
475
- <selectedIndex>0</selectedIndex>
476
- <text>categories</text>
477
- </controlProperties>
478
- </control>
479
- <control controlID="98" controlTypeID="com.balsamiq.mockups::CheckBoxGroup" x="102" y="1357" w="899" h="115" measuredW="80" measuredH="69" zOrder="89" locked="false" isInGroup="-1">
480
- <controlProperties>
481
- <text>%5B%20%5D%20books%0A%5Bx%5D%20movies%0A%5B%20%5D%20figurines</text>
482
- </controlProperties>
483
- </control>
484
- <control controlID="99" controlTypeID="com.balsamiq.mockups::Label" x="82" y="993" w="-1" h="-1" measuredW="109" measuredH="29" zOrder="90" locked="false" isInGroup="-1">
485
- <controlProperties>
486
- <color>16777215</color>
487
- <size>18</size>
488
- <text>New%20Product</text>
489
- </controlProperties>
490
- </control>
491
- </controls>
492
- </mockup>
@@ -1,76 +0,0 @@
1
- /* <li
2
- class="discountable product" || class="discountable discounted"
3
- id="product_1"
4
- data-discounted_type_human="Product"
5
- data-discounted_id="1"
6
- data-discounted_type="ShopProduct"
7
- data-success_element="discount_products"
8
- />
9
- */
10
-
11
- document.observe("dom:loaded", function() {
12
- shop_discount_edit = new ShopDiscountEdit();
13
- shop_discount_edit.initialize();
14
-
15
- Event.addBehavior({
16
- '.discountable.available:click': function(e) { shop_discount_edit.discountedAttach($(this)) },
17
- '.discountable.discounted .delete:click': function(e) { shop_discount_edit.discountedRemove($(this)) },
18
- })
19
- });
20
-
21
- var ShopDiscountEdit = Class.create({
22
-
23
- initialize: function() {
24
- },
25
-
26
- discountedAttach: function(element) {
27
- var route = shop.getRoute('admin_shop_discount_discountables_path');
28
-
29
- showStatus('Adding '+element.getAttribute('data-discounted_type_human')+'...');
30
- new Ajax.Request(route, {
31
- method: 'post',
32
- parameters: {
33
- 'discounted_id': element.getAttribute('data-discounted_id'),
34
- 'discounted_type': element.getAttribute('data-discounted_type'),
35
- },
36
- onSuccess: function(data) {
37
- $(element.getAttribute('data-success_element')).insert({ 'bottom' : data.responseText});
38
- shop_discount_edit.postChanges(element);
39
- }.bind(element),
40
- onFailure: function() {
41
- shop_discount_edit.errorStatus();
42
- }
43
- });
44
- },
45
-
46
- discountedRemove: function(element) {
47
- var element = element.up('.discounted');
48
- var discountable_id = element.readAttribute('data-discountable_id');
49
- var route = shop.getRoute('admin_shop_discount_discountable_path', 'js', discountable_id);
50
-
51
- showStatus('Removing '+element.getAttribute('data-discounted_type_human')+'...');
52
- element.hide();
53
- new Ajax.Request(route, {
54
- method: 'delete',
55
- onSuccess: function(data) {
56
- $(element.getAttribute('data-success_element')).insert({ 'bottom' : data.responseText });
57
- shop_discount_edit.postChanges(element);
58
- },
59
- onFailure: function(data) {
60
- shop_discount_edit.errorStatus();
61
- }
62
- });
63
- },
64
-
65
- postChanges: function(element) {
66
- element.remove();
67
-
68
- hideStatus();
69
- },
70
-
71
- errorStatus: function() {
72
- setStatus('Something went wrong, refreshing.');
73
- location.reload(true);
74
- }
75
-
76
- });