caboose-cms 0.7.85 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (193) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/caboose/{admin_edit_order.js → admin_edit_invoice.js} +332 -189
  3. data/app/assets/javascripts/caboose/cart.js +15 -15
  4. data/app/assets/javascripts/caboose/cart_old.js +2 -2
  5. data/app/assets/javascripts/caboose/checkout/authnet_payment_method_controller.js +120 -0
  6. data/app/assets/javascripts/caboose/checkout/billing_address_controller.js +85 -0
  7. data/app/assets/javascripts/caboose/checkout/cart_controller.js +257 -0
  8. data/app/assets/javascripts/caboose/checkout/checkout_controller.js +258 -0
  9. data/app/assets/javascripts/caboose/checkout/gift_cards_controller.js +57 -0
  10. data/app/assets/javascripts/caboose/checkout/shipping_address_controller.js +86 -0
  11. data/app/assets/javascripts/caboose/checkout/shipping_method_controller.js +121 -0
  12. data/app/assets/javascripts/caboose/checkout/stripe_payment_method_controller.js +155 -0
  13. data/app/assets/javascripts/caboose/checkout_login_register.js +2 -2
  14. data/app/assets/javascripts/caboose/checkout_module.js +8 -8
  15. data/app/assets/javascripts/caboose/checkout_old.js +151 -0
  16. data/app/assets/javascripts/caboose/{checkout_payment.js → checkout_payment_authnet.js} +1 -1
  17. data/app/assets/javascripts/caboose/checkout_payment_stripe.js +212 -0
  18. data/app/assets/javascripts/caboose/checkout_shipping.js +1 -1
  19. data/app/assets/javascripts/caboose/jquery.payment.js +1 -0
  20. data/app/assets/javascripts/caboose/model/attribute.js +3 -2
  21. data/app/assets/javascripts/caboose/model/bound_control.js +56 -14
  22. data/app/assets/javascripts/caboose/model/bound_select.js +9 -11
  23. data/app/assets/javascripts/caboose/model/bound_select_simple.js +215 -0
  24. data/app/assets/javascripts/caboose/model/bound_text.js +7 -8
  25. data/app/assets/javascripts/caboose/{my_account_edit_order.js → my_account_edit_invoice.js} +55 -55
  26. data/app/assets/javascripts/caboose/united_states.js +65 -0
  27. data/app/assets/stylesheets/caboose/{my_account_edit_order.css.scss → my_account_edit_invoice.css.scss} +1 -1
  28. data/app/assets/templates/caboose/cart/line_items.jst.ejs +3 -3
  29. data/app/assets/templates/caboose/checkout/line_items.jst.ejs +7 -7
  30. data/app/controllers/caboose/ab_options_controller.rb +4 -4
  31. data/app/controllers/caboose/ab_variants_controller.rb +5 -5
  32. data/app/controllers/caboose/admin_controller.rb +0 -6
  33. data/app/controllers/caboose/application_controller.rb +16 -15
  34. data/app/controllers/caboose/billing_addresses_controller.rb +22 -22
  35. data/app/controllers/caboose/block_type_sources_controller.rb +8 -8
  36. data/app/controllers/caboose/block_types_controller.rb +2 -42
  37. data/app/controllers/caboose/blocks_controller.rb +26 -26
  38. data/app/controllers/caboose/calendars_controller.rb +5 -5
  39. data/app/controllers/caboose/cart_controller.rb +55 -36
  40. data/app/controllers/caboose/categories_controller.rb +78 -76
  41. data/app/controllers/caboose/checkout_controller.rb +313 -340
  42. data/app/controllers/caboose/checkout_controller_bak.rb +620 -0
  43. data/app/controllers/caboose/domains_controller.rb +5 -5
  44. data/app/controllers/caboose/event_groups_controller.rb +26 -4
  45. data/app/controllers/caboose/events_controller.rb +7 -6
  46. data/app/controllers/caboose/fonts_controller.rb +2 -2
  47. data/app/controllers/caboose/gift_cards_controller.rb +113 -139
  48. data/app/controllers/caboose/google_spreadsheets_controller.rb +1 -1
  49. data/app/controllers/caboose/{order_packages_controller.rb → invoice_packages_controller.rb} +49 -49
  50. data/app/controllers/caboose/{order_reports_controller.rb → invoice_reports_controller.rb} +11 -13
  51. data/app/controllers/caboose/invoice_transactions_controller.rb +35 -0
  52. data/app/controllers/caboose/invoices_controller.rb +328 -0
  53. data/app/controllers/caboose/line_items_controller.rb +35 -34
  54. data/app/controllers/caboose/login_controller.rb +7 -7
  55. data/app/controllers/caboose/login_logs_controller.rb +4 -4
  56. data/app/controllers/caboose/logout_controller.rb +3 -1
  57. data/app/controllers/caboose/media_categories_controller.rb +9 -9
  58. data/app/controllers/caboose/media_controller.rb +21 -46
  59. data/app/controllers/caboose/modal_controller.rb +4 -3
  60. data/app/controllers/caboose/modification_values_controller.rb +6 -6
  61. data/app/controllers/caboose/modifications_controller.rb +7 -6
  62. data/app/controllers/caboose/my_account_controller.rb +2 -2
  63. data/app/controllers/caboose/my_account_invoices_controller.rb +166 -0
  64. data/app/controllers/caboose/my_account_line_items_controller.rb +15 -13
  65. data/app/controllers/caboose/page_custom_fields_controller.rb +9 -8
  66. data/app/controllers/caboose/page_permissions_controller.rb +3 -3
  67. data/app/controllers/caboose/pages_controller.rb +132 -135
  68. data/app/controllers/caboose/permissions_controller.rb +8 -7
  69. data/app/controllers/caboose/post_categories_controller.rb +22 -7
  70. data/app/controllers/caboose/post_custom_fields_controller.rb +9 -8
  71. data/app/controllers/caboose/posts_controller.rb +35 -43
  72. data/app/controllers/caboose/product_images_controller.rb +5 -5
  73. data/app/controllers/caboose/products_controller.rb +53 -47
  74. data/app/controllers/caboose/redirects_controller.rb +7 -7
  75. data/app/controllers/caboose/register_controller.rb +2 -2
  76. data/app/controllers/caboose/retargeting_controller.rb +2 -61
  77. data/app/controllers/caboose/reviews_controller.rb +1 -0
  78. data/app/controllers/caboose/roles_controller.rb +10 -9
  79. data/app/controllers/caboose/settings_controller.rb +9 -7
  80. data/app/controllers/caboose/shipping_addresses_controller.rb +18 -18
  81. data/app/controllers/caboose/shipping_packages_controller.rb +24 -21
  82. data/app/controllers/caboose/sites_controller.rb +35 -25
  83. data/app/controllers/caboose/smtp_controller.rb +3 -3
  84. data/app/controllers/caboose/sns_controller.rb +6 -6
  85. data/app/controllers/caboose/social_controller.rb +5 -6
  86. data/app/controllers/caboose/stackable_groups_controller.rb +10 -8
  87. data/app/controllers/caboose/station_controller.rb +3 -3
  88. data/app/controllers/caboose/store_controller.rb +93 -87
  89. data/app/controllers/caboose/subscriptions_controller.rb +153 -0
  90. data/app/controllers/caboose/users_controller.rb +25 -22
  91. data/app/controllers/caboose/variants_controller.rb +72 -93
  92. data/app/controllers/caboose/vendors_controller.rb +35 -32
  93. data/app/mailers/caboose/{orders_mailer.rb → invoices_mailer.rb} +21 -21
  94. data/app/mailers/caboose/login_mailer.rb +3 -3
  95. data/app/models/caboose/authnet.rb +295 -195
  96. data/app/models/caboose/comment_routes.rb +68 -41
  97. data/app/models/caboose/core_plugin.rb +1 -1
  98. data/app/models/caboose/discount.rb +14 -3
  99. data/app/models/caboose/domain_constraint.rb +11 -3
  100. data/app/models/caboose/gift_card.rb +8 -8
  101. data/app/models/caboose/invoice.rb +706 -0
  102. data/app/models/caboose/invoice_discount.rb +10 -0
  103. data/app/models/caboose/invoice_package.rb +76 -0
  104. data/app/models/caboose/{order_package_calculator.rb → invoice_package_calculator.rb} +20 -20
  105. data/app/models/caboose/{order_pdf.rb → invoice_pdf.rb} +30 -30
  106. data/app/models/caboose/{order_reporter.rb → invoice_reporter.rb} +5 -5
  107. data/app/models/caboose/invoice_transaction.rb +169 -0
  108. data/app/models/caboose/line_item.rb +11 -8
  109. data/app/models/caboose/payment_processors/authorizenet.rb +15 -15
  110. data/app/models/caboose/payment_processors/base.rb +3 -3
  111. data/app/models/caboose/{pending_orders_pdf.rb → pending_invoices_pdf.rb} +31 -31
  112. data/app/models/caboose/product.rb +2 -4
  113. data/app/models/caboose/schema.rb +159 -111
  114. data/app/models/caboose/shipping_calculator.rb +41 -139
  115. data/app/models/caboose/smtp_config.rb +2 -1
  116. data/app/models/caboose/store_config.rb +7 -7
  117. data/app/models/caboose/subscription.rb +32 -0
  118. data/app/models/caboose/tax_calculator.rb +36 -36
  119. data/app/models/caboose/user.rb +6 -0
  120. data/app/models/caboose/user_subscription.rb +142 -0
  121. data/app/models/caboose/wish_list.rb +14 -0
  122. data/app/models/caboose/wish_list_line_item.rb +13 -0
  123. data/app/views/caboose/blocks/_products.html.erb +10 -13
  124. data/app/views/caboose/checkout/_address_form.html.erb +14 -14
  125. data/app/views/caboose/checkout/_billing_form.html.erb +3 -3
  126. data/app/views/caboose/checkout/_cart.html.erb +7 -7
  127. data/app/views/caboose/checkout/_cart_old.html.erb +9 -9
  128. data/app/views/caboose/checkout/_confirm.html.erb +9 -9
  129. data/app/views/caboose/checkout/_order_discount.html.erb +3 -3
  130. data/app/views/caboose/checkout/_shipping_address.html.erb +1 -1
  131. data/app/views/caboose/checkout/_shipping_method.html.erb +1 -1
  132. data/app/views/caboose/checkout/addresses.html.erb +10 -10
  133. data/app/views/caboose/checkout/authnet.html.erb +34 -0
  134. data/app/views/caboose/checkout/authnet_response_handler.html.erb +3 -0
  135. data/app/views/caboose/checkout/checkout.html.erb +100 -0
  136. data/app/views/caboose/checkout/confirm_without_payment.html.erb +6 -6
  137. data/app/views/caboose/checkout/discount.html.erb +1 -1
  138. data/app/views/caboose/checkout/index.html.erb +4 -4
  139. data/app/views/caboose/checkout/payment_authnet.html.erb +140 -0
  140. data/app/views/caboose/checkout/payment_stripe.html.erb +95 -0
  141. data/app/views/caboose/checkout/shipping.html.erb +4 -4
  142. data/app/views/caboose/checkout/thanks.html.erb +3 -3
  143. data/app/views/caboose/gift_cards/admin_edit.html.erb +19 -19
  144. data/app/views/caboose/gift_cards/admin_index.html.erb +9 -9
  145. data/app/views/caboose/{orders → invoices}/_admin_footer.html.erb +0 -0
  146. data/app/views/caboose/{orders → invoices}/_admin_header.html.erb +0 -0
  147. data/app/views/caboose/{orders/_quickbooks_order.html.erb → invoices/_quickbooks_invoice.html.erb} +0 -0
  148. data/app/views/caboose/{orders → invoices}/admin_city_report.html.erb +1 -1
  149. data/app/views/caboose/invoices/admin_delete_form.html.erb +18 -0
  150. data/app/views/caboose/{orders → invoices}/admin_edit.html.erb +14 -14
  151. data/app/views/caboose/{orders → invoices}/admin_index.html.erb +24 -24
  152. data/app/views/caboose/{orders → invoices}/admin_invalid_order.html.erb +2 -2
  153. data/app/views/caboose/{orders → invoices}/admin_new.html.erb +7 -7
  154. data/app/views/caboose/{orders → invoices}/admin_print.html.erb +15 -15
  155. data/app/views/caboose/{orders → invoices}/admin_summary_report.html.erb +4 -4
  156. data/app/views/caboose/{orders_mailer/customer_new_order.html.erb → invoices_mailer/customer_new_invoice.html.erb} +21 -21
  157. data/app/views/caboose/invoices_mailer/customer_payment_authorization.html.erb +5 -0
  158. data/app/views/caboose/{orders_mailer → invoices_mailer}/customer_status_updated.html.erb +22 -22
  159. data/app/views/caboose/{orders_mailer/fulfillment_new_order.html.erb → invoices_mailer/fulfillment_new_invoice.html.erb} +23 -23
  160. data/app/views/caboose/{orders_mailer/shipping_order_ready.html.erb → invoices_mailer/shipping_invoice_ready.html.erb} +0 -0
  161. data/app/views/caboose/{orders_mailer → invoices_mailer}/test_email.html.erb +0 -0
  162. data/app/views/caboose/line_items/admin_new.html.erb +1 -1
  163. data/app/views/caboose/login_mailer/forgot_password_email.html.erb +2 -3
  164. data/app/views/caboose/my_account/index.html.erb +1 -1
  165. data/app/views/caboose/{my_account_orders → my_account_invoices}/authnet_relay.html.erb +0 -0
  166. data/app/views/caboose/{my_account_orders → my_account_invoices}/authnet_response.html.erb +0 -0
  167. data/app/views/caboose/{my_account_orders → my_account_invoices}/edit.html.erb +9 -9
  168. data/app/views/caboose/my_account_invoices/index.html.erb +36 -0
  169. data/app/views/caboose/{my_account_orders → my_account_invoices}/payment_form.html.erb +10 -10
  170. data/app/views/caboose/post_categories/admin_index.html.erb +1 -1
  171. data/app/views/caboose/sites/admin_edit.html.erb +1 -1
  172. data/app/views/caboose/store/admin_edit_general.html.erb +5 -3
  173. data/app/views/caboose/store/admin_edit_packages.html.erb +6 -6
  174. data/app/views/caboose/store/admin_edit_shipping.html.erb +3 -3
  175. data/app/views/caboose/store/admin_edit_tax.html.erb +1 -1
  176. data/app/views/caboose/subscriptions/admin_edit.html.erb +82 -0
  177. data/app/views/caboose/subscriptions/admin_index.html.erb +45 -0
  178. data/config/routes.rb +1 -759
  179. data/config/routes_old.rb +759 -0
  180. data/lib/caboose/version.rb +1 -1
  181. data/lib/tasks/caboose.rake +41 -15
  182. metadata +101 -61
  183. data/app/controllers/caboose/my_account_orders_controller.rb +0 -165
  184. data/app/controllers/caboose/orders_controller.rb +0 -310
  185. data/app/models/caboose/order.rb +0 -479
  186. data/app/models/caboose/order_discount.rb +0 -10
  187. data/app/models/caboose/order_package.rb +0 -133
  188. data/app/models/caboose/order_transaction.rb +0 -41
  189. data/app/models/caboose/payment_processors/payscape.rb +0 -94
  190. data/app/views/caboose/checkout/payment.html.erb +0 -146
  191. data/app/views/caboose/my_account_orders/index.html.erb +0 -36
  192. data/app/views/caboose/orders/admin_delete_form.html.erb +0 -21
  193. data/app/views/caboose/orders_mailer/customer_payment_authorization.html.erb +0 -5
@@ -7,8 +7,9 @@ module Caboose
7
7
  def before_action
8
8
  @page = Page.page_with_uri(request.host_with_port, '/admin')
9
9
  end
10
-
11
- # GET /admin/sites
10
+
11
+ # @route_priority 9
12
+ # @route GET /admin/sites
12
13
  def admin_index
13
14
  return if !user_is_allowed('sites', 'view')
14
15
  if !@site.is_master
@@ -29,7 +30,8 @@ module Caboose
29
30
  @sites = @pager.items
30
31
  end
31
32
 
32
- # GET /admin/sites/new
33
+ # @route_priority 2
34
+ # @route GET /admin/sites/new
33
35
  def admin_new
34
36
  return if !user_is_allowed('sites', 'add')
35
37
  if !@site.is_master
@@ -40,7 +42,8 @@ module Caboose
40
42
  @site = Site.new
41
43
  end
42
44
 
43
- # GET /admin/sites/:id
45
+ # @route_priority 8
46
+ # @route GET /admin/sites/:id
44
47
  def admin_edit
45
48
  return if !user_is_allowed('sites', 'edit')
46
49
  if !@site.is_master
@@ -52,8 +55,9 @@ module Caboose
52
55
  @site.init_users_and_roles
53
56
 
54
57
  end
55
-
56
- # GET /admin/sites/:id/block-types
58
+
59
+ # @route_priority 6
60
+ # @route GET /admin/sites/:id/block-types
57
61
  def admin_edit_block_types
58
62
  return if !user_is_allowed('sites', 'edit')
59
63
  if !@site.is_master
@@ -63,8 +67,9 @@ module Caboose
63
67
 
64
68
  @site = Site.find(params[:id])
65
69
  end
66
-
67
- # GET /admin/sites/:id/css
70
+
71
+ # @route_priority 4
72
+ # @route GET /admin/sites/:id/css
68
73
  def admin_edit_css
69
74
  return if !user_is_allowed('sites', 'edit')
70
75
  if !@site.is_master
@@ -73,8 +78,9 @@ module Caboose
73
78
  end
74
79
  @site = Site.find(params[:id])
75
80
  end
76
-
77
- # GET /admin/sites/:id/js
81
+
82
+ # @route_priority 5
83
+ # @route GET /admin/sites/:id/js
78
84
  def admin_edit_js
79
85
  return if !user_is_allowed('sites', 'edit')
80
86
  if !@site.is_master
@@ -83,8 +89,9 @@ module Caboose
83
89
  end
84
90
  @site = Site.find(params[:id])
85
91
  end
86
-
87
- # GET /admin/sites/:id/delete
92
+
93
+ # @route_priority 7
94
+ # @route GET /admin/sites/:id/delete
88
95
  def admin_delete_form
89
96
  return if !user_is_allowed('sites', 'edit')
90
97
  if !@site.is_master
@@ -93,8 +100,9 @@ module Caboose
93
100
  end
94
101
  @site = Site.find(params[:id])
95
102
  end
96
-
97
- # POST /admin/sites
103
+
104
+ # @route_priority 10
105
+ # @route POST /admin/sites
98
106
  def admin_add
99
107
  return if !user_is_allowed('sites', 'add')
100
108
  render :json => { :error => "You are not allowed to manage sites." } and return if !@site.is_master
@@ -114,8 +122,8 @@ module Caboose
114
122
  site.init_users_and_roles
115
123
  render :json => resp
116
124
  end
117
-
118
- # PUT /admin/sites/:id
125
+
126
+ # @route PUT /admin/sites/:id
119
127
  def admin_update
120
128
  return if !user_is_allowed('sites', 'edit')
121
129
  render :json => { :error => "You are not allowed to manage sites." } and return if !@site.is_master
@@ -142,8 +150,8 @@ module Caboose
142
150
  resp.success = save && site.save
143
151
  render :json => resp
144
152
  end
145
-
146
- # POST /admin/sites/:id/logo
153
+
154
+ # @route POST /admin/sites/:id/logo
147
155
  def admin_update_logo
148
156
  return if !user_is_allowed('sites', 'edit')
149
157
  render :json => { :error => "You are not allowed to manage sites." } and return if !@site.is_master
@@ -157,8 +165,8 @@ module Caboose
157
165
  resp.attributes = { :image => { :value => site.logo.url(:thumb) }}
158
166
  render :json => resp
159
167
  end
160
-
161
- # DELETE /admin/sites/:id
168
+
169
+ # @route DELETE /admin/sites/:id
162
170
  def admin_delete
163
171
  return if !user_is_allowed('sites', 'delete')
164
172
  render :json => { :error => "You are not allowed to manage sites." } and return if !@site.is_master
@@ -172,7 +180,7 @@ module Caboose
172
180
  render :json => resp
173
181
  end
174
182
 
175
- # POST /admin/sites/:id/members
183
+ # @route POST /admin/sites/:id/members
176
184
  def admin_add_member
177
185
  return if !user_is_allowed('sites', 'edit')
178
186
  render :json => { :error => "You are not allowed to manage sites." } and return if !@site.is_master
@@ -184,7 +192,7 @@ module Caboose
184
192
  render :json => true
185
193
  end
186
194
 
187
- # DELETE /admin/sites/:id/members/:user_id
195
+ # @route DELETE /admin/sites/:id/members/:user_id
188
196
  def admin_remove_member
189
197
  return if !user_is_allowed('sites', 'edit')
190
198
  render :json => { :error => "You are not allowed to manage sites." } and return if !@site.is_master
@@ -193,7 +201,8 @@ module Caboose
193
201
  render :json => true
194
202
  end
195
203
 
196
- # GET /admin/sites/options
204
+ # @route_priority 1
205
+ # @route GET /admin/sites/options
197
206
  def options
198
207
  return if !user_is_allowed('sites', 'view')
199
208
  render :json => { :error => "You are not allowed to manage sites." } and return if !@site.is_master
@@ -201,8 +210,9 @@ module Caboose
201
210
  options = Site.reorder('name').all.collect { |s| { 'value' => s.id, 'text' => s.name }}
202
211
  render :json => options
203
212
  end
204
-
205
- # GET /admin/sites/:id/default-layout-options
213
+
214
+ # @route_priority 3
215
+ # @route GET /admin/sites/:id/default-layout-options
206
216
  def admin_default_layout_options
207
217
  return if !user_is_allowed('sites', 'view')
208
218
  cat_ids = Caboose::BlockTypeCategory.layouts.collect{ |cat| cat.id }
@@ -4,14 +4,14 @@ module Caboose
4
4
  class SmtpController < ApplicationController
5
5
  layout 'caboose/admin'
6
6
 
7
- # GET /admin/smtp
7
+ # @route GET /admin/smtp
8
8
  def admin_edit
9
9
  return if !user_is_allowed('smtp', 'edit')
10
10
  @smtp_config = @site.smtp_config
11
11
  @smtp_config = SmtpConfig.create(:site_id => @site.id) if @smtp_config.nil?
12
12
  end
13
13
 
14
- # PUT /admin/smtp
14
+ # @route PUT /admin/smtp
15
15
  def admin_update
16
16
  return if !user_is_allowed('sites', 'edit')
17
17
 
@@ -38,7 +38,7 @@ module Caboose
38
38
  render :json => resp
39
39
  end
40
40
 
41
- # GET /admin/smtp/auth-options
41
+ # @route GET /admin/smtp/auth-options
42
42
  def auth_options
43
43
  return if !user_is_allowed('smtp', 'view')
44
44
  options = [
@@ -3,12 +3,12 @@ module Caboose
3
3
 
4
4
  skip_before_filter :verify_authenticity_token
5
5
 
6
- # GET /admin/sns
6
+ # @route GET /admin/sns
7
7
  def admin_index
8
8
  render :json => true
9
9
  end
10
10
 
11
- # POST /admin/sns
11
+ # @route POST /admin/sns
12
12
  def admin_add
13
13
  body = JSON.parse(request.raw_post, {symbolize_names: true})
14
14
  if body[:Type] && body[:Type] == "SubscriptionConfirmation"
@@ -40,18 +40,18 @@ module Caboose
40
40
  render :json => true
41
41
  end
42
42
 
43
- # GET /admin/sns/confirm
44
- # POST /admin/sns/confirm
43
+ # @route GET /admin/sns/confirm
44
+ # @route POST /admin/sns/confirm
45
45
  def admin_confirm
46
46
  render :json => true
47
47
  end
48
48
 
49
- # PUT /admin/sns/:id
49
+ # @route PUT /admin/sns/:id
50
50
  def admin_update
51
51
  render :json => true
52
52
  end
53
53
 
54
- # DELETE /admin/sns/:id
54
+ # @route DELETE /admin/sns/:id
55
55
  def admin_delete
56
56
  render :json => true
57
57
  end
@@ -4,18 +4,18 @@ module Caboose
4
4
  class SocialController < ApplicationController
5
5
  layout 'caboose/admin'
6
6
 
7
+ # @route GET /admin/analytics
7
8
  def analytics
8
-
9
9
  end
10
10
 
11
- # GET /admin/social
11
+ # @route GET /admin/social
12
12
  def admin_edit
13
13
  return if !user_is_allowed('social', 'edit')
14
14
  @social_config = @site.social_config
15
15
  @social_config = SocialConfig.create(:site_id => @site.id) if @social_config.nil?
16
16
  end
17
17
 
18
- # PUT /admin/social
18
+ # @route PUT /admin/social
19
19
  def admin_update
20
20
  return if !user_is_allowed('sites', 'edit')
21
21
 
@@ -46,8 +46,7 @@ module Caboose
46
46
  render :json => resp
47
47
  end
48
48
 
49
-
50
- # GET /api/instagram
49
+ # @route GET /api/instagram
51
50
  def authorize_instagram
52
51
  code = params[:code]
53
52
  site_id = params[:state]
@@ -81,7 +80,7 @@ module Caboose
81
80
  end
82
81
  end
83
82
 
84
- # DELETE /api/instagram
83
+ # @route DELETE /api/instagram
85
84
  def deauthorize_instagram
86
85
  resp = StdClass.new
87
86
  site_id = params[:site_id]
@@ -1,13 +1,13 @@
1
1
  module Caboose
2
2
  class StackableGroupsController < Caboose::ApplicationController
3
3
 
4
- # GET /admin/stackable-groups
4
+ # @route GET /admin/stackable-groups
5
5
  def admin_index
6
6
  return if !user_is_allowed('products', 'view')
7
7
  render :layout => 'caboose/admin'
8
8
  end
9
9
 
10
- # GET /admin/stackable-groups/json
10
+ # @route GET /admin/stackable-groups/json
11
11
  def admin_json
12
12
  return if !user_is_allowed('products', 'view')
13
13
 
@@ -27,13 +27,13 @@ module Caboose
27
27
  }
28
28
  end
29
29
 
30
- # GET /admin/stackable-groups/:id/json
30
+ # @route GET /admin/stackable-groups/:id/json
31
31
  def admin_json_single
32
32
  sg = StackableGroup.find(params[:id])
33
33
  render :json => sg
34
34
  end
35
35
 
36
- # PUT /admin/stackable-groups/:id
36
+ # @route PUT /admin/stackable-groups/:id
37
37
  def admin_update
38
38
  return if !user_is_allowed('products', 'edit')
39
39
 
@@ -56,7 +56,7 @@ module Caboose
56
56
  render :json => resp
57
57
  end
58
58
 
59
- # POST /admin/stackable-groups
59
+ # @route POST /admin/stackable-groups
60
60
  def admin_add
61
61
  return if !user_is_allowed('products', 'add')
62
62
 
@@ -75,14 +75,15 @@ module Caboose
75
75
  render :json => resp
76
76
  end
77
77
 
78
- # DELETE /admin/stackable-groups/:id
78
+ # @route DELETE /admin/stackable-groups/:id
79
79
  def admin_delete
80
80
  return if !user_is_allowed('products', 'delete')
81
81
  StackableGroup.find(params[:id]).destroy
82
82
  render :json => true
83
83
  end
84
84
 
85
- # DELETE /admin/stackable-groups/bulk
85
+ # @route_priority 1
86
+ # @route DELETE /admin/stackable-groups/bulk
86
87
  def admin_bulk_delete
87
88
  return if !user_is_allowed('products', 'delete')
88
89
  params[:model_ids].each do |sg_id|
@@ -92,7 +93,8 @@ module Caboose
92
93
  render :json => { :success => true }
93
94
  end
94
95
 
95
- # GET /admin/stackable-groups/options
96
+ # @route_priority 2
97
+ # @route GET /admin/stackable-groups/options
96
98
  def admin_options
97
99
  options = StackableGroup.reorder(:name).all.collect do |sg|
98
100
  {
@@ -3,7 +3,7 @@ module Caboose
3
3
  class StationController < ApplicationController
4
4
  layout 'caboose/modal'
5
5
 
6
- # GET /station
6
+ # @route GET /station
7
7
  def index
8
8
  @user = logged_in_user
9
9
  page_id = params['page_id'].nil? ? Page.index_page(@site.id).id : params['page_id']
@@ -15,12 +15,12 @@ module Caboose
15
15
  end
16
16
  end
17
17
 
18
- # GET /station/plugin-count
18
+ # @route GET /station/plugin-count
19
19
  def plugin_count
20
20
  render :json => Caboose::plugins.count
21
21
  end
22
22
 
23
- # PUT /admin/station
23
+ # @route PUT /admin/station
24
24
  def index_admin
25
25
  session[:caboose_station_state] = params[:state]
26
26
  session[:caboose_station_open_tabs] = params[:open_tabs]
@@ -4,49 +4,49 @@ module Caboose
4
4
  class StoreController < ApplicationController
5
5
  layout 'caboose/admin'
6
6
 
7
- # GET /admin/store/json
7
+ # @route GET /admin/store/json
8
8
  def admin_json_single
9
- return if !user_is_allowed('orders', 'view')
9
+ return if !user_is_allowed('invoices', 'view')
10
10
  sc = @site.store_config
11
11
  render :json => sc
12
12
  end
13
13
 
14
- # GET /admin/store
14
+ # @route GET /admin/store
15
15
  def admin_edit_general
16
16
  return if !user_is_allowed('sites', 'edit')
17
17
  @store_config = @site.store_config
18
18
  @store_config = StoreConfig.create(:site_id => @site.id) if @store_config.nil?
19
19
  end
20
20
 
21
- # GET /admin/store/payment
21
+ # @route GET /admin/store/payment
22
22
  def admin_edit_payment
23
23
  return if !user_is_allowed('sites', 'edit')
24
24
  @store_config = @site.store_config
25
25
  @store_config = StoreConfig.create(:site_id => @site.id) if @store_config.nil?
26
26
  end
27
27
 
28
- # GET /admin/store/shipping
28
+ # @route GET /admin/store/shipping
29
29
  def admin_edit_shipping
30
30
  return if !user_is_allowed('sites', 'edit')
31
31
  @store_config = @site.store_config
32
32
  @store_config = StoreConfig.create(:site_id => @site.id) if @store_config.nil?
33
33
  end
34
34
 
35
- # GET /admin/store/tax
35
+ # @route GET /admin/store/tax
36
36
  def admin_edit_tax
37
37
  return if !user_is_allowed('sites', 'edit')
38
38
  @store_config = @site.store_config
39
39
  @store_config = StoreConfig.create(:site_id => @site.id) if @store_config.nil?
40
40
  end
41
41
 
42
- # GET /admin/store/packages
42
+ # @route GET /admin/store/packages
43
43
  def admin_edit_packages
44
44
  return if !user_is_allowed('sites', 'edit')
45
45
  @store_config = @site.store_config
46
46
  @store_config = StoreConfig.create(:site_id => @site.id) if @store_config.nil?
47
47
  end
48
48
 
49
- # PUT /admin/store
49
+ # @route PUT /admin/store
50
50
  def admin_update
51
51
  return if !user_is_allowed('sites', 'edit')
52
52
 
@@ -57,53 +57,54 @@ module Caboose
57
57
  save = true
58
58
  params.each do |name,value|
59
59
  case name
60
- when 'site_id' then sc.site_id = value
61
- when 'pp_name' then sc.pp_name = value
62
- when 'pp_testing' then sc.pp_testing = value
63
- when 'authnet_api_login_id' then sc.authnet_api_login_id = value
64
- when 'authnet_api_transaction_key' then sc.authnet_api_transaction_key = value
65
- when 'authnet_relay_domain' then sc.authnet_relay_domain = value
66
- when 'stripe_secret_key' then sc.stripe_secret_key = value
67
- when 'stripe_publishable_key' then sc.stripe_publishable_key = value
68
- when 'ups_username' then sc.ups_username = value
69
- when 'ups_password' then sc.ups_password = value
70
- when 'ups_key' then sc.ups_key = value
71
- when 'ups_origin_account' then sc.ups_origin_account = value
72
- when 'usps_username' then sc.usps_username = value
73
- when 'usps_secret_key' then sc.usps_secret_key = value
74
- when 'usps_publishable_key' then sc.usps_publishable_key = value
75
- when 'fedex_username' then sc.fedex_username = value
76
- when 'fedex_password' then sc.fedex_password = value
77
- when 'fedex_key' then sc.fedex_key = value
78
- when 'fedex_account' then sc.fedex_account = value
79
- when 'ups_min' then sc.ups_min = value
80
- when 'ups_max' then sc.ups_max = value
81
- when 'usps_min' then sc.usps_min = value
82
- when 'usps_max' then sc.usps_max = value
83
- when 'fedex_min' then sc.fedex_min = value
84
- when 'fedex_max' then sc.fedex_max = value
85
- when 'taxcloud_api_id' then sc.taxcloud_api_id = value
86
- when 'taxcloud_api_key' then sc.taxcloud_api_key = value
87
- when 'origin_address1' then sc.origin_address1 = value
88
- when 'origin_address2' then sc.origin_address2 = value
89
- when 'origin_state' then sc.origin_state = value
90
- when 'origin_city' then sc.origin_city = value
91
- when 'origin_zip' then sc.origin_zip = value
92
- when 'origin_country' then sc.origin_country = value
93
- when 'fulfillment_email' then sc.fulfillment_email = value
94
- when 'shipping_email' then sc.shipping_email = value
95
- when 'handling_percentage' then sc.handling_percentage = value
96
- when 'auto_calculate_packages' then sc.auto_calculate_packages = value
97
- when 'auto_calculate_shipping' then sc.auto_calculate_shipping = value
98
- when 'auto_calculate_tax' then sc.auto_calculate_tax = value
99
- when 'custom_packages_function' then sc.custom_packages_function = value
100
- when 'custom_shipping_function' then sc.custom_shipping_function = value
101
- when 'custom_tax_function' then sc.custom_tax_function = value
102
- when 'length_unit' then sc.length_unit = value
103
- when 'weight_unit' then sc.weight_unit = value
104
- when 'download_instructions' then sc.download_instructions = value
105
- when 'download_url_expires_in' then sc.download_url_expires_in = value
106
- when 'starting_order_number' then sc.starting_order_number = value
60
+ when 'site_id' then sc.site_id = value
61
+ when 'pp_name' then sc.pp_name = value
62
+ when 'pp_testing' then sc.pp_testing = value
63
+ when 'authnet_api_login_id' then sc.authnet_api_login_id = value
64
+ when 'authnet_api_transaction_key' then sc.authnet_api_transaction_key = value
65
+ when 'authnet_relay_domain' then sc.authnet_relay_domain = value
66
+ when 'stripe_secret_key' then sc.stripe_secret_key = value
67
+ when 'stripe_publishable_key' then sc.stripe_publishable_key = value
68
+ when 'ups_username' then sc.ups_username = value
69
+ when 'ups_password' then sc.ups_password = value
70
+ when 'ups_key' then sc.ups_key = value
71
+ when 'ups_origin_account' then sc.ups_origin_account = value
72
+ when 'usps_username' then sc.usps_username = value
73
+ when 'usps_secret_key' then sc.usps_secret_key = value
74
+ when 'usps_publishable_key' then sc.usps_publishable_key = value
75
+ when 'fedex_username' then sc.fedex_username = value
76
+ when 'fedex_password' then sc.fedex_password = value
77
+ when 'fedex_key' then sc.fedex_key = value
78
+ when 'fedex_account' then sc.fedex_account = value
79
+ when 'ups_min' then sc.ups_min = value
80
+ when 'ups_max' then sc.ups_max = value
81
+ when 'usps_min' then sc.usps_min = value
82
+ when 'usps_max' then sc.usps_max = value
83
+ when 'fedex_min' then sc.fedex_min = value
84
+ when 'fedex_max' then sc.fedex_max = value
85
+ when 'taxcloud_api_id' then sc.taxcloud_api_id = value
86
+ when 'taxcloud_api_key' then sc.taxcloud_api_key = value
87
+ when 'origin_address1' then sc.origin_address1 = value
88
+ when 'origin_address2' then sc.origin_address2 = value
89
+ when 'origin_state' then sc.origin_state = value
90
+ when 'origin_city' then sc.origin_city = value
91
+ when 'origin_zip' then sc.origin_zip = value
92
+ when 'origin_country' then sc.origin_country = value
93
+ when 'fulfillment_email' then sc.fulfillment_email = value
94
+ when 'shipping_email' then sc.shipping_email = value
95
+ when 'handling_percentage' then sc.handling_percentage = value
96
+ when 'auto_calculate_packages' then sc.auto_calculate_packages = value
97
+ when 'auto_calculate_shipping' then sc.auto_calculate_shipping = value
98
+ when 'auto_calculate_tax' then sc.auto_calculate_tax = value
99
+ when 'custom_packages_function' then sc.custom_packages_function = value
100
+ when 'custom_shipping_function' then sc.custom_shipping_function = value
101
+ when 'custom_tax_function' then sc.custom_tax_function = value
102
+ when 'length_unit' then sc.length_unit = value
103
+ when 'weight_unit' then sc.weight_unit = value
104
+ when 'download_instructions' then sc.download_instructions = value
105
+ when 'download_url_expires_in' then sc.download_url_expires_in = value
106
+ when 'starting_invoice_number' then sc.starting_invoice_number = value
107
+ when 'default_payment_terms' then sc.default_payment_terms = value
107
108
  end
108
109
  end
109
110
 
@@ -111,40 +112,45 @@ module Caboose
111
112
  render :json => resp
112
113
  end
113
114
 
114
- # GET /admin/store/payment-processor-options
115
- def payment_processor_options
115
+ # @route GET /admin/store/:field-options
116
+ def admin_options
116
117
  return if !user_is_allowed('sites', 'view')
117
- options = [
118
- { 'value' => 'authorize.net' , 'text' => 'Authorize.net' },
119
- { 'value' => 'stripe' , 'text' => 'Stripe' }
120
- ]
118
+
119
+ options = []
120
+ case params[:field]
121
+ when 'payment-processor'
122
+ options = [
123
+ { 'value' => 'authorize.net' , 'text' => 'Authorize.net' },
124
+ { 'value' => 'stripe' , 'text' => 'Stripe' }
125
+ ]
126
+ when 'length-unit'
127
+ options = [
128
+ { 'value' => 'in' , 'text' => 'Inches (in)' },
129
+ { 'value' => 'ft' , 'text' => 'Feet (ft)' },
130
+ { 'value' => 'mm' , 'text' => 'Millimeter (mm)' },
131
+ { 'value' => 'cm' , 'text' => 'Centimeter (cm)' },
132
+ { 'value' => 'm' , 'text' => 'Meter (m)' }
133
+ ]
134
+ when 'weight-unit'
135
+ options = [
136
+ { 'value' => 'oz' , 'text' => 'Ounces (oz)' },
137
+ { 'value' => 'lb' , 'text' => 'Pounds (lb)' },
138
+ { 'value' => 'g' , 'text' => 'Grams (g)' },
139
+ { 'value' => 'kg' , 'text' => 'Kilograms (kg)' }
140
+ ]
141
+ when 'default-payment-terms'
142
+ options = [
143
+ { 'value' => Invoice::PAYMENT_TERMS_PIA , 'text' => 'Pay In Advance' },
144
+ { 'value' => Invoice::PAYMENT_TERMS_NET7 , 'text' => 'Net 7' },
145
+ { 'value' => Invoice::PAYMENT_TERMS_NET10 , 'text' => 'Net 10' },
146
+ { 'value' => Invoice::PAYMENT_TERMS_NET30 , 'text' => 'Net 30' },
147
+ { 'value' => Invoice::PAYMENT_TERMS_NET60 , 'text' => 'Net 60' },
148
+ { 'value' => Invoice::PAYMENT_TERMS_NET90 , 'text' => 'Net 90' },
149
+ { 'value' => Invoice::PAYMENT_TERMS_EOM , 'text' => 'End of Month' }
150
+ ]
151
+ end
121
152
  render :json => options
122
153
  end
123
-
124
- # GET /admin/store/length-unit-options
125
- def length_unit_options
126
- return if !user_is_allowed('sites', 'view')
127
- options = [
128
- { 'value' => 'in' , 'text' => 'Inches (in)' },
129
- { 'value' => 'ft' , 'text' => 'Feet (ft)' },
130
- { 'value' => 'mm' , 'text' => 'Millimeter (mm)' },
131
- { 'value' => 'cm' , 'text' => 'Centimeter (cm)' },
132
- { 'value' => 'm' , 'text' => 'Meter (m)' }
133
- ]
134
- render :json => options
135
- end
136
-
137
- # GET /admin/store/weight-unit-options
138
- def weight_unit_options
139
- return if !user_is_allowed('sites', 'view')
140
- options = [
141
- { 'value' => 'oz' , 'text' => 'Ounces (oz)' },
142
- { 'value' => 'lb' , 'text' => 'Pounds (lb)' },
143
- { 'value' => 'g' , 'text' => 'Grams (g)' },
144
- { 'value' => 'kg' , 'text' => 'Kilograms (kg)' }
145
- ]
146
- render :json => options
147
- end
148
-
154
+
149
155
  end
150
156
  end