artfully_ose 1.2.0.pre.27 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +8 -8
  2. data/README.md +4 -6
  3. data/app/assets/javascripts/application.js +39 -0
  4. data/app/assets/javascripts/boxoffice.js +558 -0
  5. data/app/assets/javascripts/custom/kits-config.js +33 -0
  6. data/app/assets/javascripts/sales-console.js +29 -24
  7. data/app/assets/javascripts/store/store.js +11 -0
  8. data/app/assets/stylesheets/application.sass +66 -52
  9. data/app/assets/stylesheets/bootstrap-overrides.css +1 -1
  10. data/app/assets/stylesheets/boxoffice.css.scss +258 -0
  11. data/app/assets/stylesheets/pages/bootstrap-responsive.css +1109 -0
  12. data/app/assets/stylesheets/sass/store.sass +52 -62
  13. data/app/assets/stylesheets/storefront.css +1 -1
  14. data/app/concerns/itemable.rb +1 -1
  15. data/app/concerns/pdf_generation.rb +1 -11
  16. data/app/concerns/search_by_dates.rb +20 -0
  17. data/app/controllers/events_controller.rb +1 -0
  18. data/app/controllers/export_controller.rb +11 -1
  19. data/app/controllers/imports_controller.rb +2 -3
  20. data/app/controllers/member_cards_controller.rb +2 -3
  21. data/app/controllers/orders_controller.rb +42 -0
  22. data/app/controllers/organizations_controller.rb +1 -0
  23. data/app/controllers/passes_reports_controller.rb +21 -1
  24. data/app/controllers/regular_donation_kits_controller.rb +32 -0
  25. data/app/controllers/store/donations_controller.rb +19 -1
  26. data/app/controllers/store/orders_controller.rb +15 -5
  27. data/app/helpers/artfully_ose_helper.rb +28 -18
  28. data/app/models/database_views/item_view.rb +41 -0
  29. data/app/models/event.rb +10 -2
  30. data/app/models/ext/integrations.rb +5 -0
  31. data/app/models/fee_strategy.rb +47 -1
  32. data/app/models/imports/events_import.rb +6 -7
  33. data/app/models/item.rb +4 -3
  34. data/app/models/job/order_processor.rb +4 -3
  35. data/app/models/kit.rb +18 -0
  36. data/app/models/kits/regular_donation_kit.rb +51 -9
  37. data/app/models/member.rb +4 -3
  38. data/app/models/membership.rb +1 -2
  39. data/app/models/membership_sale_search.rb +2 -20
  40. data/app/models/membership_type.rb +1 -2
  41. data/app/models/order.rb +29 -1
  42. data/app/models/order_handler.rb +4 -3
  43. data/app/models/organization.rb +17 -9
  44. data/app/models/pass.rb +18 -17
  45. data/app/models/pass_sale_search.rb +18 -0
  46. data/app/models/pass_type.rb +7 -2
  47. data/app/models/passes_report.rb +117 -0
  48. data/app/models/sale_search.rb +3 -21
  49. data/app/models/user.rb +1 -2
  50. data/app/serializers/show_serializer.rb +15 -0
  51. data/app/views/contributions/index.html.haml +2 -2
  52. data/app/views/events/_header.html.haml +1 -0
  53. data/app/views/events/_ticket_type_fields.html.haml +31 -15
  54. data/app/views/events/edit.html.haml +6 -1
  55. data/app/views/imports/_export_links.html.haml +3 -0
  56. data/app/views/imports/donations/_pending.html.haml +24 -6
  57. data/app/views/imports/events/_pending.html.haml +16 -5
  58. data/app/views/imports/index.html.haml +6 -4
  59. data/app/views/imports/people/_pending.html.haml +20 -25
  60. data/app/views/layouts/storefront.html.haml +9 -5
  61. data/app/views/order_mailer/confirmation_for.html.haml +11 -5
  62. data/app/views/order_mailer/confirmation_for_refund.html.haml +6 -2
  63. data/app/views/order_mailer/confirmation_for_refund.text.haml +4 -3
  64. data/app/views/orders/membership.html.haml +15 -19
  65. data/app/views/orders/passes.html.haml +97 -0
  66. data/app/views/orders/sales.html.haml +2 -2
  67. data/app/views/organizations/_form.html.haml +4 -37
  68. data/app/views/pass_types/index.html.haml +1 -1
  69. data/app/views/passes_reports/index.html.haml +79 -1
  70. data/app/views/people/show.html.haml +16 -15
  71. data/app/views/regular_donation_kits/edit.html.haml +140 -0
  72. data/app/views/store/checkouts/thanks.html.haml +14 -6
  73. data/app/views/store/donations/index.html.haml +19 -2
  74. data/app/views/store/events/calendar.html.haml +1 -0
  75. data/app/views/store/events/index.html.haml +1 -0
  76. data/app/views/store/events/show.html.haml +1 -0
  77. data/app/views/store/events/single_show.html.haml +2 -0
  78. data/app/views/store/orders/show.html.haml +10 -10
  79. data/app/views/store/passes/index.html.haml +2 -2
  80. data/app/views/store/shared/_donate_form.html.haml +31 -12
  81. data/app/views/store/shared/_small_donate_form.html.haml +22 -0
  82. data/app/views/users/invitations/edit.html.haml +3 -42
  83. data/config/locales/en.yml +3 -1
  84. data/config/routes.rb +4 -1
  85. data/db/migrate/20140603200735_add_subtitle_to_events.rb +5 -0
  86. data/lib/artfully_ose/version.rb +1 -1
  87. data/spec/factories/kit_factories.rb +5 -4
  88. metadata +25 -13
  89. data/app/assets/javascripts/box-office.js +0 -262
@@ -1,262 +0,0 @@
1
- //= require "custom/inline-people-search"
2
- //= require_self
3
-
4
- function bulletedListItem(person){
5
- var $li = $("li.template").clone().removeClass("template hidden"),
6
- $label = $(document.createElement("label")).attr({
7
- "for": "person_id"
8
- }).html(person.first_name + " " + person.last_name),
9
- $radio = $(document.createElement("input")).attr({
10
- "name":"person_id",
11
- "type":"radio",
12
- "value": person.id
13
- });
14
-
15
- $li.find(".radio").append($radio);
16
- $li.find(".label").append($label);
17
- $li.appendTo($(".target"));
18
- }
19
-
20
- function doorListRowFor(door_list_row) {
21
- return $('<tr>')
22
- .append($('<td>').html("<input class='door-list-checkbox' data-ticket-id='"+door_list_row.ticket_id+"' id='validated' name='validated' type='checkbox' value='validated'>"))
23
- .append($('<td>').html(door_list_row.first_name))
24
- .append($('<td>').html(door_list_row.last_name))
25
- .append($('<td>').html(door_list_row.email))
26
- .append($('<td>').html(door_list_row.ticket_type))
27
- .append($('<td>').html(door_list_row.payment_method))
28
- .append($('<td>').html(door_list_row.price / 100).formatCurrency())
29
- }
30
-
31
- function showError(message) {
32
- setErrorMessage(message)
33
- }
34
-
35
- function showMessage(message) {
36
- setFlashMessage(message)
37
- }
38
-
39
- function resetPerson() {
40
- $('.picked-person-clear').html("")
41
- $('#picket-person-name-in-popup').html("No buyer information")
42
- clearNewPersonForm()
43
- }
44
-
45
- function resetCommit() {
46
- $('.ticket-quantity-select').closest("form").find('input[name="commit"]').val('')
47
- }
48
-
49
- function resetPayment() {
50
- $("#payment_method_cash").click()
51
- $("#credit_card_number").val()
52
- $("#credit_card_name").val()
53
- $("#credit_card_month").val($('option:first', $("#credit_card_month")).val())
54
- $("#credit_card_year").val($('option:first', $("#credit_card_year")).val())
55
- }
56
-
57
- function resetQuantites() {
58
- $.each($('.ticket-quantity-select'), function() {
59
- $('option[value="0"]', this).attr('selected','selected')
60
- });
61
- }
62
-
63
- function setPriceDisplay(amountInCents) {
64
- if (amountInCents > 0) {
65
- amountInCents = amountInCents / 100;
66
- }
67
- $('#total').find('.price').html(amountInCents).formatCurrency();
68
- $('#sell-total').find('.price').html(amountInCents).formatCurrency();
69
- }
70
-
71
- function resetPrice() {
72
- setPriceDisplay(0)
73
- $('.price').removeClass('comped-price');
74
- }
75
-
76
- function disableCheckout() {
77
- $('#checkout-now-button').attr('disabled', true)
78
- $('#checkout-now-button').addClass('off')
79
- }
80
-
81
- function enableCheckout() {
82
- $('#checkout-now-button').attr('disabled', false)
83
- $('#checkout-now-button').removeClass('off')
84
- }
85
-
86
- function updateQuantities(tickets_remaining) {
87
- $.each(tickets_remaining, function(section_id, quantity) {
88
- $('#remaining_' + section_id).html(quantity + ' remaining')
89
- if (quantity > 0) {
90
- $('#quantities_' + section_id).removeClass('hidden')
91
- $('#sold_out_' + section_id).addClass('hidden')
92
- } else {
93
- $('#quantities_' + section_id).addClass('hidden')
94
- $('#sold_out_' + section_id).removeClass('hidden')
95
- }
96
- });
97
- }
98
-
99
- function ticketsInCart(saleJson) {
100
- return saleJson.tickets.length > 0
101
- }
102
-
103
- $("document").ready(function(){
104
-
105
- disableCheckout()
106
- $("#salesperson-alert").hide();
107
-
108
- //People searching stuff is in inline-people-search.js
109
-
110
- //If they enter a custom email address (or change what was autocompleted, we have to clear the person id)
111
- $("#the-details input").change( function () {
112
- $("input#person_id").val("")
113
- updateModal()
114
- })
115
-
116
- $("#checkout-now-button").click(function(){
117
- if($("input[name=payment_method]:checked").val() == 'credit_card_swipe') {
118
- $('#sell-button').hide()
119
- $('#swipe-now').removeClass('hidden')
120
- $('#swipe-now').show()
121
- } else {
122
- $('#sell-button').show()
123
- $('#swipe-now').hide()
124
- }
125
-
126
- $("#sell-popup").modal("show")
127
-
128
- if($("input[name=payment_method]:checked").val() == 'credit_card_swipe') {
129
- $("input[name=hack-cc-number]").removeClass("hidden")
130
- $("input[name=hack-cc-number]").focus()
131
- } else {
132
- $("#hack-cc-number").addClass("hidden")
133
- }
134
-
135
- return false;
136
- });
137
-
138
- //copy the hack CC number (swiped data) into the actual CC number field
139
- $("input[name=hack-cc-number]").change(function(){
140
- $("#credit_card_number").val($("input[name=hack-cc-number]").val())
141
- form = $('.ticket-quantity-select').closest("form")
142
- form.find('input[name="commit"]').val('submit')
143
- $("input[name=hack-cc-number]").val('')
144
- $("#sell-popup").modal("hide")
145
- form.submit()
146
- });
147
-
148
- //Force the hack CC field to never lose focus in an attempt to
149
- //ensure the swiped data always lands in the field
150
- $("input[name=hack-cc-number]").blur(function(){
151
- setTimeout( function(){ $("input[name=hack-cc-number]").focus(); }, 100 );
152
- });
153
-
154
- $("#cancel-button").click(function(){
155
- $("#sell-popup").modal("hide")
156
- });
157
-
158
- $("#sell-button").click(function(){
159
- form = $('.ticket-quantity-select').closest("form")
160
- form.find('input[name="commit"]').val('submit')
161
- $("#sell-button").addClass('disabled')
162
- $('#sell-button').attr('disabled', true)
163
- $('#sell-button').html('Processing...')
164
- form.submit()
165
- });
166
-
167
- $('.ticket-quantity-select').on('change', function(){
168
- $(this).closest("form").submit()
169
- });
170
-
171
- $('.ticket-quantity-select').closest("form")
172
- .bind("ajax:beforeSend", function(){
173
- $("#total").addClass("loading");
174
- $("#checkout-now-button").addClass('disabled')
175
- $('#checkout-now-button').attr('disabled', true)
176
- $('.flash').remove()
177
- })
178
- .bind("ajax:failure", function(){
179
- showError("Sorry, but Artful.ly could not process the payment. An error report has been recorded.")
180
- resetPayment()
181
- })
182
- .bind("ajax:success", function(xhr, sale){
183
- setPriceDisplay(sale.total)
184
- $("#total").removeClass("loading");
185
-
186
- $('input[name="payment_method"]').attr('disabled', !ticketsInCart(sale))
187
- if (ticketsInCart(sale)) {
188
- enableCheckout()
189
- } else {
190
- disableCheckout()
191
- }
192
-
193
- $('#popup-ticket-list tbody tr').remove()
194
- $.each(sale.tickets, function () {
195
- $("#popup-ticket-list").find('tbody')
196
- .append($('<tr>')
197
- .append($('<td>').html(this.ticket_type.name))
198
- .append($('<td>').html(this.cart_price / 100).formatCurrency())
199
- );
200
- });
201
- $("#checkout-now-button").removeClass('disabled')
202
- $('#checkout-now-button').attr('disabled', false)
203
-
204
- $("#sell-popup").modal("hide")
205
- $("#sell-button").removeClass('disabled')
206
- $('#sell-button').attr('disabled', false)
207
- $('#sell-button').html('Sell')
208
-
209
- updateQuantities(sale.tickets_remaining)
210
-
211
- if(sale.sale_made == true) {
212
- $.each(sale.door_list_rows, function () {
213
- $("#door-list").find('tbody')
214
- .append(doorListRowFor(this))
215
- .append($('<tr class="no-border">')
216
- .append($('<td>').html(" "))
217
- );
218
- });
219
- disableCheckout();
220
- hookupDoorListcheckboxes(); //this is in door-list.js
221
- resetCommit();
222
- resetPayment();
223
- resetPerson();
224
- resetQuantites();
225
- setPriceDisplay(0);
226
- showMessage(sale.message);
227
-
228
- } else if (sale.sale_made == false) {
229
- resetPayment();
230
- }
231
- if(sale.error != undefined) {
232
- showError(sale.error);
233
- resetQuantites();
234
- resetPayment();
235
- }
236
- });
237
-
238
- $(".payment-method").change(function(){
239
- if($(this).attr('value') != 'credit_card_manual'){
240
- $("#payment-info").addClass("hidden");
241
- $("#credit_card_number").val("")
242
- $("#credit_card_name").val("")
243
- } else {
244
- $("#payment-info").removeClass("hidden");
245
- }
246
-
247
- if($(this).attr('value') == 'credit_card_swipe'){
248
- $("#salesperson-alert").show();
249
- } else {
250
- $("#salesperson-alert").hide();
251
- }
252
-
253
- if($(this).attr('value') == 'comp') {
254
- $('.price').addClass('comped-price');
255
- } else {
256
- $('.price').removeClass('comped-price');
257
- }
258
-
259
- var payment_method_text = $(this).attr("humanized_value");
260
- $('#payment-method-popup').html(payment_method_text);
261
- });
262
- });