forked from CGM_Public/pretix_original
Merge pull request #1693 from pretix/series-creation
This commit is contained in:
@@ -47,11 +47,6 @@ class EventWizardFoundationForm(forms.Form):
|
||||
)
|
||||
has_subevents = forms.BooleanField(
|
||||
label=_("This is an event series"),
|
||||
help_text=_('Only recommended for advanced users. If this feature is enabled, this will not only be a '
|
||||
'single event but a series of very similar events that are handled within a single shop. '
|
||||
'The single events inside the series can only differ in date, time, location, prices and '
|
||||
'quotas, but not in other settings, and buying tickets across multiple of these events at '
|
||||
'the same time is possible. You cannot change this setting for this event later.'),
|
||||
required=False,
|
||||
)
|
||||
|
||||
@@ -159,6 +154,7 @@ class EventWizardBasicsForm(I18nModelForm):
|
||||
if self.has_subevents:
|
||||
del self.fields['presale_start']
|
||||
del self.fields['presale_end']
|
||||
del self.fields['date_to']
|
||||
|
||||
if self.has_control_rights(self.user, self.organizer):
|
||||
del self.fields['team']
|
||||
|
||||
@@ -36,7 +36,9 @@
|
||||
</div>
|
||||
</div>
|
||||
{% bootstrap_field form.date_from layout="control" %}
|
||||
{% bootstrap_field form.date_to layout="control" %}
|
||||
{% if form.date_to %}
|
||||
{% bootstrap_field form.date_to layout="control" %}
|
||||
{% endif %}
|
||||
<div class="geodata-section">
|
||||
{% bootstrap_field form.location layout="control" %}
|
||||
<div class="form-group geodata-group" data-tiles="{{ global_settings.leaflet_tiles|default_if_none:"" }}" data-attrib="{{ global_settings.leaflet_tiles_attribution }}" data-icon="{% static "leaflet/images/marker-icon.png" %}" data-shadow="{% static "leaflet/images/marker-shadow.png" %}">
|
||||
|
||||
@@ -3,8 +3,51 @@
|
||||
{% load bootstrap3 %}
|
||||
{% block form %}
|
||||
{% bootstrap_field form.organizer layout="horizontal" %}
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">Event type</label>
|
||||
<div class="col-md-9">
|
||||
<div class="big-radio radio">
|
||||
<label>
|
||||
<input type="radio" value="" name="{{ form.has_subevents.html_name }}">
|
||||
<span class="fa fa-calendar-o"></span>
|
||||
<strong>{% trans "Singular event or non-event shop" %}</strong><br>
|
||||
<div class="help-block">
|
||||
{% blocktrans trimmed %}
|
||||
An event with individual configuration. If you create more events later, you can copy
|
||||
the event to save yourself some work.
|
||||
{% endblocktrans %}
|
||||
</div>
|
||||
<div class="help-block">
|
||||
{% blocktrans trimmed %}
|
||||
Examples: Conferences, workshops, trade fairs, one-off concerts, sale of digital content,
|
||||
multi-day events with combination tickets.
|
||||
{% endblocktrans %}
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
<div class="big-radio radio">
|
||||
<label>
|
||||
<input type="radio" value="on" name="{{ form.has_subevents.html_name }}">
|
||||
<span class="fa fa-calendar"></span>
|
||||
<strong>{% trans "Event series or time slot booking" %}</strong>
|
||||
<div class="help-block">
|
||||
{% blocktrans trimmed %}
|
||||
A series of events that share the same configuration. They can still be different in
|
||||
their dates, locations, prices, and capacities.
|
||||
{% endblocktrans %}
|
||||
</div>
|
||||
<div class="help-block">
|
||||
{% blocktrans trimmed %}
|
||||
Examples: Multiple presentations of the same show, same concert in multiple locations,
|
||||
museums, libraries, or swimming pools,
|
||||
events that need to be booked together in one cart.
|
||||
{% endblocktrans %}
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% bootstrap_field form.locales layout="horizontal" %}
|
||||
{% bootstrap_field form.has_subevents layout="horizontal" %}
|
||||
<p>
|
||||
<span class="fa fa-info-circle"></span>
|
||||
{% trans "Please note that you will only be able to delete your event until the first order has been created." %}
|
||||
|
||||
@@ -251,19 +251,6 @@ class EventWizard(SafeSessionWizardView):
|
||||
t.members.add(self.request.user)
|
||||
t.limit_events.add(event)
|
||||
|
||||
if event.has_subevents:
|
||||
se = event.subevents.create(
|
||||
name=event.name,
|
||||
date_from=event.date_from,
|
||||
date_to=event.date_to,
|
||||
presale_start=event.presale_start,
|
||||
presale_end=event.presale_end,
|
||||
location=event.location,
|
||||
geo_lat=event.geo_lat,
|
||||
geo_lon=event.geo_lon,
|
||||
active=True
|
||||
)
|
||||
|
||||
logdata = {}
|
||||
for f in form_list:
|
||||
logdata.update({
|
||||
@@ -277,17 +264,10 @@ class EventWizard(SafeSessionWizardView):
|
||||
elif self.clone_from:
|
||||
event.copy_data_from(self.clone_from)
|
||||
else:
|
||||
if event.has_subevents:
|
||||
event.checkin_lists.create(
|
||||
name=str(se),
|
||||
all_products=True,
|
||||
subevent=se
|
||||
)
|
||||
else:
|
||||
event.checkin_lists.create(
|
||||
name=_('Default'),
|
||||
all_products=True
|
||||
)
|
||||
event.checkin_lists.create(
|
||||
name=_('Default'),
|
||||
all_products=True
|
||||
)
|
||||
event.set_defaults()
|
||||
|
||||
if basics_data['tax_rate']:
|
||||
|
||||
@@ -431,6 +431,21 @@ table td > .checkbox input[type="checkbox"] {
|
||||
}
|
||||
}
|
||||
}
|
||||
.form-horizontal .big-radio {
|
||||
border: 2px solid #ccc;
|
||||
padding: 0;
|
||||
border-radius: $border-radius-base;
|
||||
label {
|
||||
padding: 15px 15px 15px 30px;
|
||||
}
|
||||
|
||||
.help-block {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
.form-horizontal .big-radio:not(:last-child) {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.accordion-radio {
|
||||
display: block;
|
||||
margin: 0;
|
||||
|
||||
@@ -655,7 +655,7 @@ class EventsTest(SoupTest):
|
||||
with scopes_disabled():
|
||||
ev = Event.objects.get(slug='33c3')
|
||||
assert ev.has_subevents
|
||||
assert ev.subevents.count() == 1
|
||||
assert ev.subevents.count() == 0
|
||||
|
||||
def test_create_event_copy_success(self):
|
||||
with scopes_disabled():
|
||||
|
||||
Reference in New Issue
Block a user