artfully_ose 1.2.0.pre.21 → 1.2.0.pre.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/app/assets/javascripts/change-membership.js +8 -4
- data/app/assets/javascripts/custom/show.js +13 -8
- data/app/assets/javascripts/locationselector.js +1 -1
- data/app/assets/javascripts/store/store.js +7 -0
- data/app/assets/stylesheets/application.sass +21 -1
- data/app/assets/stylesheets/sass/_tags.sass +13 -2
- data/app/controllers/discounts_controller.rb +8 -1
- data/app/controllers/events_controller.rb +29 -13
- data/app/controllers/events_pass_types_controller.rb +75 -0
- data/app/controllers/imports_controller.rb +10 -3
- data/app/controllers/membership_types_controller.rb +1 -0
- data/app/controllers/pass_types_controller.rb +42 -0
- data/app/controllers/passes_controller.rb +13 -0
- data/app/controllers/passes_kits_controller.rb +25 -0
- data/app/controllers/passes_reports_controller.rb +5 -0
- data/app/controllers/sales_controller.rb +0 -2
- data/app/controllers/searches_controller.rb +10 -3
- data/app/controllers/sections_controller.rb +1 -1
- data/app/controllers/segments_controller.rb +4 -4
- data/app/controllers/shows_controller.rb +21 -47
- data/app/controllers/store/checkouts_controller.rb +6 -1
- data/app/controllers/store/orders_controller.rb +2 -0
- data/app/controllers/store/passes_controller.rb +9 -0
- data/app/controllers/store/store_controller.rb +7 -2
- data/app/helpers/link_helper.rb +10 -0
- data/app/mailers/reports_mailer.rb +5 -4
- data/app/models/cart.rb +21 -16
- data/app/models/checkout.rb +6 -1
- data/app/models/daily_membership_report.rb +1 -1
- data/app/models/daily_pass_report.rb +48 -0
- data/app/models/database_views/item_view.rb +69 -19
- data/app/models/event.rb +5 -0
- data/app/models/events_pass_type.rb +16 -0
- data/app/models/ext/integrations.rb +1 -1
- data/app/models/ext/preprocessor.rb +1 -0
- data/app/models/import.rb +18 -15
- data/app/models/imports/donations_import.rb +1 -1
- data/app/models/imports/events_import.rb +33 -28
- data/app/models/item.rb +13 -3
- data/app/models/job/daily_email_report_job.rb +8 -2
- data/app/models/job/order_processor.rb +10 -1
- data/app/models/job/show_creator.rb +2 -1
- data/app/models/kit.rb +1 -1
- data/app/models/kits/passes_kit.rb +62 -0
- data/app/models/membership.rb +19 -6
- data/app/models/membership_change.rb +18 -7
- data/app/models/membership_comp.rb +1 -0
- data/app/models/membership_type.rb +1 -1
- data/app/models/order.rb +18 -9
- data/app/models/order_handler.rb +22 -0
- data/app/models/organization.rb +7 -0
- data/app/models/pass.rb +45 -0
- data/app/models/pass_type.rb +19 -0
- data/app/models/person.rb +4 -0
- data/app/models/search.rb +170 -63
- data/app/models/section.rb +2 -0
- data/app/models/show.rb +26 -2
- data/app/models/show_touch.rb +12 -0
- data/app/models/ticket.rb +6 -0
- data/app/models/ticket/pricing.rb +1 -0
- data/app/models/ticket/reports.rb +16 -0
- data/app/models/ticket/sale_transitions.rb +4 -0
- data/app/models/ticket/transfers.rb +4 -1
- data/app/presenters/event_presenter.rb +1 -1
- data/app/views/discounts/_form.html.haml +1 -1
- data/app/views/events/_menu.html.haml +4 -13
- data/app/views/events/_share_and_sell.haml +2 -1
- data/app/views/events_pass_types/_form.html.haml +25 -0
- data/app/views/events_pass_types/edit.html.haml +22 -0
- data/app/views/events_pass_types/index.html.haml +43 -0
- data/app/views/events_pass_types/new.html.haml +22 -0
- data/app/views/imports/index.html.haml +2 -2
- data/app/views/layouts/_menu.html.haml +2 -1
- data/app/views/layouts/storefront.html.haml +3 -1
- data/app/views/membership_cancellations/_form.html.haml +1 -1
- data/app/views/membership_cancellations/_processing.html.haml +1 -3
- data/app/views/membership_types/index.html.haml +1 -1
- data/app/views/memberships/index.html.haml +16 -25
- data/app/views/orders/_item_table.haml +2 -2
- data/app/views/pass_types/_form.html.haml +70 -0
- data/app/views/pass_types/_pass_type_fees.html.haml +48 -0
- data/app/views/pass_types/edit.html.haml +4 -0
- data/app/views/pass_types/index.html.haml +32 -0
- data/app/views/pass_types/new.html.haml +4 -0
- data/app/views/passes/index.html.haml +40 -0
- data/app/views/passes_kits/edit.html.haml +30 -0
- data/app/views/passes_reports/index.html.haml +2 -0
- data/app/views/people/_header.html.haml +6 -1
- data/app/views/reports_mailer/daily.html.haml +19 -0
- data/app/views/searches/_form.html.haml +17 -1
- data/app/views/shared/_show_time_and_calendar.html.haml +21 -0
- data/app/views/shared/_tags.html.haml +2 -2
- data/app/views/shows/_controls.html.haml +4 -4
- data/app/views/shows/_glance.html.haml +0 -4
- data/app/views/shows/_sections_table.html.haml +6 -4
- data/app/views/shows/_work_with.html.haml +2 -2
- data/app/views/shows/index.html.haml +79 -20
- data/app/views/shows/new.html.haml +1 -21
- data/app/views/statements/_passes_table.html.haml +25 -0
- data/app/views/statements/show.html.haml +4 -1
- data/app/views/store/checkouts/thanks.html.haml +13 -5
- data/app/views/store/orders/show.html.haml +26 -1
- data/app/views/store/passes/index.html.haml +33 -0
- data/config/locales/en.yml +2 -0
- data/config/routes.rb +8 -2
- data/db/migrate/20140207135731_update_items_view.rb +38 -0
- data/db/migrate/20140210154723_add_cached_stats.rb +5 -0
- data/db/migrate/20140218202726_cache_stats.rb +7 -0
- data/db/migrate/20140304171625_passes_ahoy.rb +52 -0
- data/db/migrate/20140304174807_add_passes_kit.rb +5 -0
- data/db/migrate/20140307144454_add_events_pass_types.rb +9 -0
- data/db/migrate/20140307193350_add_pass_id_to_cart.rb +7 -0
- data/db/migrate/20140314162422_add_total_paid_to_membership.rb +13 -0
- data/db/migrate/20140319191237_add_show_dates_to_advanced_search.rb +6 -0
- data/db/migrate/20140328172333_add_cols_to_events_pass_types.rb +6 -0
- data/db/migrate/20140328174217_add_deleted_at_to_ept.rb +9 -0
- data/db/migrate/20140328185432_add_active_to_ept.rb +5 -0
- data/db/migrate/20140328192612_add_pass_type_id_to_search.rb +5 -0
- data/lib/artfully_ose.rb +3 -3
- data/lib/artfully_ose/version.rb +1 -1
- data/spec/factories/kit_factories.rb +5 -0
- data/spec/factories/membership_factories.rb +1 -0
- metadata +45 -6
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ODcyYzg1ZTUzZmI5NjVlNzgzNDdmMTcyN2EwNDMwOTI1NTJjZjQ1Zg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MDljN2U0ODMzZWZiMWY2NWEwOTU4ZWE0ZWZjYTIzOTYzZjEyYTNkOQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZTcwMzgwY2NiNWExZTVlYzkxYTg5ZmUxZjBmYzM2OGEwYzIwZTk1OTQ2Mzc2
|
10
|
+
YjllMTgyMWUyMzRlM2NlNzExYmI4N2I4ZDUwM2Q3YjA2ZDA0NDI0YzFjYjgx
|
11
|
+
N2E5NzgxZWZhMjZlMTVjOTRmZTA2YThjMzc1ZjdmYTc0Nzk0NjY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZWE5MTFhMTI3YWFiNGJhMmRlMDU3ZmNkM2JiYmJjYWM1ZDQ3NWRiNWE3YTU1
|
14
|
+
NzJkZGUwMTlhZTg3Y2Y1ZWU0YjY2MGViYzU3YWY2NWE0MzM5YThjMTcyN2Yx
|
15
|
+
MjAwMzIwMTZmNWRiMDk2MTFhOTU1ZDFjZjQ4NGI1NjBhN2EyMDU=
|
@@ -112,12 +112,16 @@ angular.module('artfully').controller('MembershipActionsCtrl', ['$scope', 'membe
|
|
112
112
|
angular.module('artfully').controller('ChangeMembershipController', ['$scope', 'membershipSelections', function($scope, membershipSelections) {
|
113
113
|
|
114
114
|
// Template variables
|
115
|
-
$scope.payment_method = '
|
115
|
+
$scope.payment_method = '';
|
116
116
|
$scope.price = 0;
|
117
|
-
$scope.total = 0;
|
117
|
+
$scope.total = '$0.00';
|
118
118
|
$scope.selected = {};
|
119
119
|
|
120
120
|
// Helpers
|
121
|
+
$scope.comped = function() {
|
122
|
+
return !!('' == $scope.payment_method || 'comp' == $scope.payment_method);
|
123
|
+
}
|
124
|
+
|
121
125
|
$scope.updateTotal = function() {
|
122
126
|
var price = parseFloat($scope.price.substr(1).replace(/,/, ""));
|
123
127
|
var total = (Object.keys($scope.selected).length * price);
|
@@ -135,9 +139,9 @@ angular.module('artfully').controller('ChangeMembershipController', ['$scope', '
|
|
135
139
|
|
136
140
|
// Clear the list of selected ids when the modal is hidden
|
137
141
|
$("#change").on('hidden', function(hidden) {
|
138
|
-
$scope.payment_method = '
|
142
|
+
$scope.payment_method = '';
|
139
143
|
$scope.price = 0;
|
140
|
-
$scope.
|
144
|
+
$scope.updateTotal();
|
141
145
|
$scope.selected = {};
|
142
146
|
|
143
147
|
// Reset the form
|
@@ -2,12 +2,12 @@ $(document).ready(function () {
|
|
2
2
|
|
3
3
|
/***** Calendar for existing shows *****/
|
4
4
|
|
5
|
-
var
|
6
|
-
|
5
|
+
var showCal = $('#show-calendar')
|
6
|
+
showCal.fullCalendar({
|
7
7
|
height: 500
|
8
8
|
,eventSources: [
|
9
9
|
{
|
10
|
-
url: '/events/'+
|
10
|
+
url: '/events/'+showCal.attr('data-event-id')+'.json', color: "#adadad"
|
11
11
|
,success: function(data) {
|
12
12
|
$.each(data, function (index, obj) {
|
13
13
|
if(obj.state == "unpublished") {
|
@@ -31,7 +31,7 @@ $(document).ready(function () {
|
|
31
31
|
var cal = $('#new-show-calendar')
|
32
32
|
cal.fullCalendar({
|
33
33
|
height: 400
|
34
|
-
,eventSources: [ { url: '/
|
34
|
+
,eventSources: [ { url: '/'+cal.attr('data-event-type')+'/'+cal.attr('data-event-id')+'.json', color: "#adadad" } ]
|
35
35
|
,events: eventArray
|
36
36
|
,dayClick: function(date, allDay, jsEvent, view) {
|
37
37
|
var validShow = true
|
@@ -147,10 +147,15 @@ $(document).ready(function () {
|
|
147
147
|
});
|
148
148
|
|
149
149
|
$(".sprited").on("ajax:success", function(xhr, show){
|
150
|
-
var
|
151
|
-
$(
|
152
|
-
|
153
|
-
|
150
|
+
var container = $(this).parents(".sprited-container");
|
151
|
+
var sprited = $(".sprited-element", container)
|
152
|
+
sprited.push(container)
|
153
|
+
|
154
|
+
$.each(sprited, function () {
|
155
|
+
$(this).find(":submit").removeAttr('disabled');
|
156
|
+
$(this).removeClass("pending built published unpublished")
|
157
|
+
$(this).addClass(show.state);
|
158
|
+
})
|
154
159
|
$('.show-state').html(show.state)
|
155
160
|
});
|
156
161
|
|
@@ -43,7 +43,7 @@
|
|
43
43
|
"Canada": new Array('Alberta','British Columbia','Manitoba','New Brunswick','Newfoundland and Labrador','Northwest Territories','Nova Scotia','Nunavut','Ontario','Prince Edward Island','Quebec','Saskatchewan','Yukon'),
|
44
44
|
"France": new Array('Alsace','Aquitaine','Auvergne','Basse-Normandie','Bourgogne','Bretagne','Centre','Champagne-Ardenne','Corse','Franche-Comté','Guadeloupe','Guyanne','Haute-Normandie','Île-de-France','Languedoc-Rousillon','Limousin','Lorraine','Martinique','Midi-Pyrénées','Nord-Pas-de-Calais','Pays de la Loire','Picardie','Poitou-Charentes','Provence-Alpes-Côte d\'Azur','Réunion','Rhône-Alpes'),
|
45
45
|
"United Kingdom": new Array('Aberdeen City','Aberdeenshire','Angus','Antrim','Argyll and Bute','Armagh','Avon','Bedfordshire','Berkshire','Blaenau Gwent','Borders','Bridgend','Bristol','Buckinghamshire','Caerphilly','Cambridgeshire','Cardiff','Carmarthenshire','Ceredigion','Channel Islands','Cheshire','Clackmannan','Cleveland','Conwy','Cornwall','Cumbria','Denbighshire','Derbyshire','Devon','Dorset','Down','Dumfries and Galloway','Dundee (City of)','Durham','East Ayrshire','East Dunbartonshire','East Lothian','East Renfrewshire','East Riding of Yorkshire','East Sussex','Edinburgh (City of)','Essex','Falkirk','Fermanagh','Fife Glasgow (City of)','Flintshire','Gloucestershire','Greater Manchester','Gwynedd','Hampshire','Herefordshire','Hertfordshire','Highland','Humberside','Humberside','Inverclyde','Isle of Anglesey','Isle of Man','Isle of Wight','Isles of Scilly','Kent','Lancashire','Leicestershire','Lincolnshire','London','Londonderry','Merseyside','Merthyr Tydfil','Middlesex','Midlothian','Monmouthshire','Moray','Neath Port Talbot','Newport','Norfolk','North Ayrshire','North Lanarkshire','North Yorkshire','Northamptonshire','Northumberland','Nottinghamshire','Orkney','Oxfordshire','Pembrokeshire','Perthshire and Kinross','Powys','Renfrewshire','Rhondda Cynon Taff','Rutland','Shetland','Shropshire','Somerset','South Ayrshire','South Lanarkshire','South Yorkshire','Staffordshire','Stirling','Suffolk','Surrey','Swansea','The Vale of Glamorgan','Torfaen','Tyne and Wear','Tyrone','Warwickshire','West Dunbartonshire','West Lothian','West Midlands','West Sussex','West Yorkshire','Western Isles','Wiltshire','Worcestershire','Wrexham'),
|
46
|
-
"United States": new Array('Alaska','Alabama','American Samoa','Arkansas','Armed Forces Africa','Armed Forces Europe','Armed Forces Pacific','Arizona','California','Colorado','Connecticut','District of Columbia','Delaware','Federated States of Micronesia','Florida','Georgia','Guam','Hawaii','Iowa','Idaho','Illinois','Indiana','Kansas','Kentucky','Louisiana','Massachusetts','Northern Mariana Islands','Marshall Islands','Maryland','Maine','Michigan','Minnesota','Missouri','Mississippi','Montana','North Carolina','North Dakota','Nebraska','New Hampshire','New Jersey','New Mexico','Nevada','New York','Ohio','Oklahoma','Oregon','Pennsylvania','Palau','Puerto Rico','Rhode Island','South Carolina','South Dakota','Tennessee','Texas','Utah','Virginia','Virgin Islands','Vermont','Washington','Wisconsin','West
|
46
|
+
"United States": new Array('Alaska','Alabama','American Samoa','Arkansas','Armed Forces Africa','Armed Forces Europe','Armed Forces Pacific','Arizona','California','Colorado','Connecticut','District of Columbia','Delaware','Federated States of Micronesia','Florida','Georgia','Guam','Hawaii','Iowa','Idaho','Illinois','Indiana','Kansas','Kentucky','Louisiana','Massachusetts','Northern Mariana Islands','Marshall Islands','Maryland','Maine','Michigan','Minnesota','Missouri','Mississippi','Montana','North Carolina','North Dakota','Nebraska','New Hampshire','New Jersey','New Mexico','Nevada','New York','Ohio','Oklahoma','Oregon','Pennsylvania','Palau','Puerto Rico','Rhode Island','South Carolina','South Dakota','Tennessee','Texas','Utah','Virginia','Virgin Islands','Vermont','Washington','Wisconsin','West Virginia','Wyoming')
|
47
47
|
}
|
48
48
|
|
49
49
|
return this.each(function() {
|
@@ -71,6 +71,13 @@ $(document).ready(function(){
|
|
71
71
|
$('tr#discount-input').show();
|
72
72
|
});
|
73
73
|
|
74
|
+
$('#pass-code-link a').click(function(e) {
|
75
|
+
e.preventDefault();
|
76
|
+
$('tr#pass-code-link').hide();
|
77
|
+
$('tr#pass-code-display').hide();
|
78
|
+
$('tr#pass-code-input').show();
|
79
|
+
});
|
80
|
+
|
74
81
|
// add * to required field labels
|
75
82
|
$('label.required').append(' <strong>*</strong> ');
|
76
83
|
|
@@ -118,6 +118,13 @@ ul#memberships
|
|
118
118
|
height: 150px
|
119
119
|
#text
|
120
120
|
padding-top: 50px
|
121
|
+
|
122
|
+
#add-a-pass-type
|
123
|
+
text-align: center
|
124
|
+
width: 75%
|
125
|
+
height: 150px
|
126
|
+
#text
|
127
|
+
padding-top: 50px
|
121
128
|
|
122
129
|
#day-date
|
123
130
|
width: 95%
|
@@ -229,7 +236,14 @@ ul.built li.built,
|
|
229
236
|
ul.pending li.pending,
|
230
237
|
ul.destroyable li.destroyable
|
231
238
|
display: inline
|
239
|
+
|
240
|
+
tr.unpublished
|
241
|
+
background-color: #EEE
|
232
242
|
|
243
|
+
tr.valign
|
244
|
+
td
|
245
|
+
vertical-align: middle
|
246
|
+
|
233
247
|
.dialog
|
234
248
|
display: none
|
235
249
|
|
@@ -434,7 +448,7 @@ a.artfully-tooltip, a.artfully-tooltip:hover
|
|
434
448
|
text-decoration: none
|
435
449
|
|
436
450
|
// People Records
|
437
|
-
body[data-controller=people][data-action=show], body[data-controller=memberships][data-action=index]
|
451
|
+
body[data-controller=people][data-action=show], body[data-controller=memberships][data-action=index], body[data-controller=passes][data-action=index]
|
438
452
|
padding-top: 10px
|
439
453
|
|
440
454
|
.person-header
|
@@ -676,3 +690,9 @@ p.alternate_form_link
|
|
676
690
|
|
677
691
|
.bordered-section
|
678
692
|
border-bottom: 1px solid #ACACAE
|
693
|
+
|
694
|
+
.control-group
|
695
|
+
.controls
|
696
|
+
label
|
697
|
+
margin-bottom: 5px
|
698
|
+
padding-top: 5px
|
@@ -39,11 +39,22 @@ ul.tags
|
|
39
39
|
|
40
40
|
.tag
|
41
41
|
background-color: #f8930a
|
42
|
-
border-right: 1px solid #a85300
|
43
|
-
border-bottom: 1px solid #a85300
|
44
42
|
padding: 2px 4px 2px 4px
|
45
43
|
font-size: 10pt
|
46
44
|
color: #EEEEEE
|
45
|
+
.tag-member
|
46
|
+
background-color: #175c71
|
47
|
+
padding: 3px 5px 3px 5px
|
48
|
+
a
|
49
|
+
font-weight: normal
|
50
|
+
color:white
|
51
|
+
.tag-passholder
|
52
|
+
background-color: #8e0a34
|
53
|
+
padding: 3px 5px 3px 5px
|
54
|
+
font-weight: normal
|
55
|
+
a
|
56
|
+
font-weight: normal
|
57
|
+
color:white
|
47
58
|
|
48
59
|
.tag-error
|
49
60
|
color: #991111
|
@@ -60,6 +60,13 @@ private
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def grab_ticket_type_names
|
63
|
-
@ticket_type_names =
|
63
|
+
@ticket_type_names = []
|
64
|
+
@event.charts.includes(:sections => :ticket_types).each do |chart|
|
65
|
+
chart.sections.each do |section|
|
66
|
+
@ticket_type_names << section.ticket_types.collect{ |tt| tt.name }
|
67
|
+
end
|
68
|
+
end
|
69
|
+
@ticket_type_names = @ticket_type_names.flatten.uniq.sort
|
70
|
+
@ticket_type_names
|
64
71
|
end
|
65
72
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
class EventsController < ArtfullyOseController
|
2
2
|
respond_to :html, :json
|
3
3
|
|
4
|
-
before_filter :find_event, :only => [ :show, :edit, :update, :destroy, :widget, :image, :storefront_link, :prices, :messages, :resell, :wp_plugin ]
|
4
|
+
before_filter :find_event, :only => [ :show, :edit, :update, :destroy, :widget, :image, :storefront_link, :prices, :messages, :resell, :wp_plugin, :passes ]
|
5
5
|
before_filter :upcoming_shows, :only => :show
|
6
6
|
before_filter { authorize! :view, @event if @event }
|
7
7
|
|
@@ -71,18 +71,8 @@ class EventsController < ArtfullyOseController
|
|
71
71
|
authorize! :edit, @event
|
72
72
|
|
73
73
|
if @event.update_attributes(params[:event])
|
74
|
-
|
75
|
-
|
76
|
-
redirect_to messages_event_path(@event)
|
77
|
-
elsif user_set_special_instructions?
|
78
|
-
redirect_to event_shows_path(@event)
|
79
|
-
else
|
80
|
-
redirect_to edit_event_venue_path(@event)
|
81
|
-
end
|
82
|
-
else
|
83
|
-
flash[:notice] = "Your event has been updated."
|
84
|
-
redirect_to event_url(@event)
|
85
|
-
end
|
74
|
+
build_flash_message
|
75
|
+
redirect_to redirect_path and return
|
86
76
|
else
|
87
77
|
render :edit
|
88
78
|
end
|
@@ -107,6 +97,9 @@ class EventsController < ArtfullyOseController
|
|
107
97
|
def prices
|
108
98
|
end
|
109
99
|
|
100
|
+
def passes
|
101
|
+
end
|
102
|
+
|
110
103
|
def messages
|
111
104
|
end
|
112
105
|
|
@@ -116,6 +109,29 @@ class EventsController < ArtfullyOseController
|
|
116
109
|
end
|
117
110
|
|
118
111
|
private
|
112
|
+
|
113
|
+
def redirect_path
|
114
|
+
if user_requesting_next_step?
|
115
|
+
if user_just_uploaded_an_image?
|
116
|
+
messages_event_path(@event)
|
117
|
+
elsif user_set_special_instructions?
|
118
|
+
event_shows_path(@event)
|
119
|
+
else
|
120
|
+
edit_event_venue_path(@event)
|
121
|
+
end
|
122
|
+
else
|
123
|
+
event_url(@event)
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
def build_flash_message
|
128
|
+
if user_just_uploaded_an_image?
|
129
|
+
flash[:notice] = "We're processing your image and will have the new image up in a few minutes."
|
130
|
+
else
|
131
|
+
flash[:notice] = "Your event has been updated."
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
119
135
|
def find_event
|
120
136
|
@event = Event.find(params[:id])
|
121
137
|
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
class EventsPassTypesController < ArtfullyOseController
|
2
|
+
before_filter :find_event, :grab_ticket_type_names
|
3
|
+
before_filter { authorize! :view, @event if @event }
|
4
|
+
|
5
|
+
def index
|
6
|
+
@no_pass_types = current_organization.pass_types.empty?
|
7
|
+
@events_pass_types = @event.events_pass_types
|
8
|
+
|
9
|
+
# if they've set up a pass type but this event doesn't have any pass types yet, then kick them right to /new
|
10
|
+
if @events_pass_types.empty? && !@no_pass_types
|
11
|
+
redirect_to new_event_events_pass_type_path(@event) and return
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def new
|
16
|
+
@events_pass_type = EventsPassType.new
|
17
|
+
@pass_type_options = current_organization.pass_types
|
18
|
+
.reject{|pt| @event.events_pass_types.collect(&:pass_type_id).include?(pt.id)}
|
19
|
+
.collect{|pass_type| [pass_type.name, pass_type.id]}.sort{|a, b| a[0] <=> b[0]}
|
20
|
+
|
21
|
+
@pass_types = current_organization.pass_types.empty?
|
22
|
+
end
|
23
|
+
|
24
|
+
def create
|
25
|
+
@events_pass_type = EventsPassType.new.tap do |ept|
|
26
|
+
ept.organization = current_organization
|
27
|
+
ept.event = @event
|
28
|
+
ept.pass_type = current_organization.pass_types.find(params[:events_pass_type][:pass_type])
|
29
|
+
ept.ticket_types = Set.new(params[:events_pass_type][:ticket_types].reject!(&:blank?))
|
30
|
+
ept.excluded_shows = Set.new(params[:events_pass_type][:excluded_shows].reject!(&:blank?))
|
31
|
+
ept.active = params[:events_pass_type][:active]
|
32
|
+
end
|
33
|
+
|
34
|
+
if @events_pass_type.save
|
35
|
+
flash[:notice] = "Your pass has been attached to this event."
|
36
|
+
else
|
37
|
+
flash[:error] = @events_pass_type.errors.full_messages.to_sentence
|
38
|
+
end
|
39
|
+
redirect_to event_events_pass_types_path(@event)
|
40
|
+
end
|
41
|
+
|
42
|
+
def edit
|
43
|
+
@events_pass_type = EventsPassType.find(params[:id])
|
44
|
+
end
|
45
|
+
|
46
|
+
def update
|
47
|
+
@events_pass_type = EventsPassType.find(params[:id])
|
48
|
+
@events_pass_type.ticket_types = Set.new(params[:events_pass_type][:ticket_types].reject!(&:blank?))
|
49
|
+
@events_pass_type.excluded_shows = Set.new(params[:events_pass_type][:excluded_shows].reject!(&:blank?))
|
50
|
+
@events_pass_type.active = params[:events_pass_type][:active]
|
51
|
+
|
52
|
+
if @events_pass_type.save
|
53
|
+
flash[:notice] = "Your pass has been updated."
|
54
|
+
else
|
55
|
+
flash[:error] = @events_pass_type.errors.full_messages.to_sentence
|
56
|
+
end
|
57
|
+
redirect_to event_events_pass_types_path(@event)
|
58
|
+
end
|
59
|
+
|
60
|
+
private
|
61
|
+
def find_event
|
62
|
+
@event = current_organization.events.includes(:events_pass_types => :pass_type).find(params[:event_id])
|
63
|
+
end
|
64
|
+
|
65
|
+
def grab_ticket_type_names
|
66
|
+
@ticket_type_names = []
|
67
|
+
@event.charts.includes(:sections => :ticket_types).each do |chart|
|
68
|
+
chart.sections.each do |section|
|
69
|
+
@ticket_type_names << section.ticket_types.collect{ |tt| tt.name }
|
70
|
+
end
|
71
|
+
end
|
72
|
+
@ticket_type_names = @ticket_type_names.flatten.uniq.sort
|
73
|
+
@ticket_type_names
|
74
|
+
end
|
75
|
+
end
|
@@ -5,7 +5,7 @@ class ImportsController < ArtfullyOseController
|
|
5
5
|
|
6
6
|
def index
|
7
7
|
@imports = organization.imports.includes(:user, :organization).order('created_at desc').all
|
8
|
-
@sales_csv_download_link =
|
8
|
+
@sales_csv_download_link, @donations_csv_download_link = download_links
|
9
9
|
end
|
10
10
|
|
11
11
|
def approve
|
@@ -104,7 +104,7 @@ class ImportsController < ArtfullyOseController
|
|
104
104
|
@type = (params[:type] || session[:type])
|
105
105
|
end
|
106
106
|
|
107
|
-
def
|
107
|
+
def download_links
|
108
108
|
s3 = AWS::S3.new(
|
109
109
|
:access_key_id => ENV['S3_ACCESS_KEY_ID'],
|
110
110
|
:secret_access_key => ENV['S3_SECRET_ACCESS_KEY']
|
@@ -112,7 +112,14 @@ class ImportsController < ArtfullyOseController
|
|
112
112
|
bucket = s3.buckets[ENV['S3_BUCKET']]
|
113
113
|
object = bucket.objects[ItemView.sales_export_filename_for(current_organization)]
|
114
114
|
url = object.url_for(:read, :expires => 10*60)
|
115
|
-
url.to_s
|
115
|
+
sales_link = url.to_s
|
116
|
+
|
117
|
+
bucket = s3.buckets[ENV['S3_BUCKET']]
|
118
|
+
object = bucket.objects[ItemView.donations_export_filename_for(current_organization)]
|
119
|
+
url = object.url_for(:read, :expires => 10*60)
|
120
|
+
donations_link = url.to_s
|
121
|
+
|
122
|
+
[sales_link, donations_link]
|
116
123
|
end
|
117
124
|
|
118
125
|
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
class PassTypesController < ArtfullyOseController
|
2
|
+
requires_kit :passes
|
3
|
+
|
4
|
+
def index
|
5
|
+
@pass_types = current_organization.pass_types.includes(:passes).paginate(:page => params[:page], :per_page => 50)
|
6
|
+
|
7
|
+
respond_to do |format|
|
8
|
+
format.html
|
9
|
+
|
10
|
+
format.csv do
|
11
|
+
@filename = 'pass_types.csv'
|
12
|
+
@csv_string = @pass_types.to_comma
|
13
|
+
send_data @csv_string, :filename => @filename, :type => 'text/csv', :disposition => 'attachment'
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def new
|
19
|
+
@pass_type = PassType.new
|
20
|
+
end
|
21
|
+
|
22
|
+
def create
|
23
|
+
@pass_type = PassType.new(params[:pass_type])
|
24
|
+
@pass_type.organization = current_organization
|
25
|
+
unless @pass_type.save
|
26
|
+
flash[:error] = @pass_type.errors.full_messages.to_sentence
|
27
|
+
render "new" and return
|
28
|
+
end
|
29
|
+
redirect_to pass_types_path
|
30
|
+
end
|
31
|
+
|
32
|
+
def edit
|
33
|
+
@pass_type = current_user.current_organization.pass_types.where(:id => params[:id]).first
|
34
|
+
end
|
35
|
+
|
36
|
+
def update
|
37
|
+
@pass_type = PassType.find(params[:id])
|
38
|
+
@pass_type.update_attributes(params[:pass_type])
|
39
|
+
flash[:notice] = "Your changes have been saved"
|
40
|
+
redirect_to pass_types_path
|
41
|
+
end
|
42
|
+
end
|