-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement common component - create/update event (#323)
* implement sso login feature * format code * implement eventyay-common implement page organizer/team to create/update/delete organizer/team * implement organizer/team create/update/delete * implement common event create/update * implement common event create/update * fix isort
- Loading branch information
Showing
22 changed files
with
447 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
from django import forms | ||
from django.conf import settings | ||
from django.utils.translation import gettext_lazy as _ | ||
from pytz import common_timezones | ||
|
||
from pretix.base.forms import SettingsForm | ||
from pretix.base.settings import ( | ||
PERSON_NAME_SCHEMES, PERSON_NAME_TITLE_GROUPS, validate_event_settings, | ||
) | ||
from pretix.control.forms import MultipleLanguagesWidget | ||
from pretix.control.forms.event import EventWizardFoundationForm | ||
|
||
|
||
class EventCommonSettingsForm(SettingsForm): | ||
timezone = forms.ChoiceField( | ||
choices=((a, a) for a in common_timezones), | ||
label=_("Event timezone"), | ||
) | ||
|
||
auto_fields = [ | ||
'locales', | ||
'locale', | ||
] | ||
|
||
def clean(self): | ||
data = super().clean() | ||
settings_dict = self.event.settings.freeze() | ||
settings_dict.update(data) | ||
validate_event_settings(self.event, data) | ||
return data | ||
|
||
def __init__(self, *args, **kwargs): | ||
self.event = kwargs['obj'] | ||
super().__init__(*args, **kwargs) | ||
|
||
|
||
class EventWizardCommonFoundationForm(EventWizardFoundationForm): | ||
create_for = forms.MultipleChoiceField( | ||
choices=settings.LANGUAGES, | ||
label=_("Use languages"), | ||
widget=MultipleLanguagesWidget, | ||
help_text=_('Choose all languages that your event should be available in.') | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
src/pretix/eventyay_common/templates/eventyay_common/event/base.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{% extends "eventyay_common/base.html" %} | ||
{% load i18n %} | ||
{% load static %} | ||
{% block title %}{{ request.event.name }}{% endblock %} |
58 changes: 58 additions & 0 deletions
58
src/pretix/eventyay_common/templates/eventyay_common/event/settings.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{% extends "eventyay_common/event/settings_base.html" %} | ||
{% load i18n %} | ||
{% load bootstrap3 %} | ||
{% load static %} | ||
{% load hierarkey_form %} | ||
{% load formset_tags %} | ||
{% block title %}{% trans "General settings" %}{% endblock %} | ||
{% block custom_header %} | ||
{{ block.super }} | ||
<link type="text/css" rel="stylesheet" href="{% url "control:pdf.css" %}"> | ||
{% endblock %} | ||
{% block inside %} | ||
<h1>{{ request.event.name }} {% trans "- Settings" %}</h1> | ||
<form action="" method="post" class="form-horizontal" enctype="multipart/form-data"> | ||
{% csrf_token %} | ||
{% bootstrap_form_errors form %} | ||
<div class="tabbed-form"> | ||
<fieldset> | ||
<legend>{% trans "Basics" %}</legend> | ||
{% bootstrap_field form.name layout="control" %} | ||
{% bootstrap_field form.slug layout="control" %} | ||
{% bootstrap_field form.date_from layout="control" %} | ||
{% bootstrap_field form.date_to layout="control" %} | ||
{% bootstrap_field form.currency layout="control" %} | ||
{% bootstrap_field form.sales_channels layout="control" %} | ||
</fieldset> | ||
<fieldset> | ||
<legend>{% trans "Localization" %}</legend> | ||
{% bootstrap_field sform.locales layout="control" %} | ||
{% bootstrap_field sform.locale layout="control" %} | ||
{% bootstrap_field sform.timezone layout="control" %} | ||
</fieldset> | ||
</div> | ||
<fieldset> | ||
<h4>{% trans "Setting for Tickets system" %} | ||
<a href='{% url "control:event.settings" organizer=request.organizer.slug event=request.event.slug %}' | ||
class="btn btn-sm btn-default" title='{% trans "Edit" %}' | ||
data-toggle="tooltip"> | ||
<span class="fa fa-edit"></span> | ||
</a> | ||
</h4> | ||
</fieldset> | ||
<fieldset> | ||
<h4>{% trans "Setting for Talk system" %} | ||
<a href='{{ talk_edit_url }}' | ||
class="btn btn-sm btn-default" title='{% trans "Edit" %}' | ||
data-toggle="tooltip"> | ||
<span class="fa fa-edit"></span> | ||
</a> | ||
</h4> | ||
</fieldset> | ||
<div class="form-group submit-group"> | ||
<button type="submit" class="btn btn-primary btn-save"> | ||
{% trans "Save" %} | ||
</button> | ||
</div> | ||
</form> | ||
{% endblock %} |
32 changes: 32 additions & 0 deletions
32
src/pretix/eventyay_common/templates/eventyay_common/event/settings_base.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{% extends "eventyay_common/event/base.html" %} | ||
{% load i18n %} | ||
{% load bootstrap3 %} | ||
{% block title %}{{ request.event.name }}{% endblock %} | ||
{% block content %} | ||
{% if "congratulations" in request.GET %} | ||
<div class="thank-you"> | ||
<span class="fa fa-check-circle"></span> | ||
|
||
<h2>{% trans "Congratulations!" %}</h2> | ||
<p> | ||
<strong>{% trans "You just created an event!" %}</strong> | ||
</p> | ||
<p> | ||
{% blocktrans trimmed %} | ||
You can now scroll down and modify the settings in more detail, if you want, or you can create your | ||
first product to start selling tickets right away! | ||
{% endblocktrans %} | ||
</p> | ||
<p> | ||
<a href="{% url "control:event.items.add" organizer=request.organizer.slug event=request.event.slug %}" | ||
class="btn btn-default"> | ||
{% trans "Create a first product" %} | ||
</a> | ||
</p> | ||
<div class="clearfix"></div> | ||
</div> | ||
{% endif %} | ||
|
||
{% block inside %} | ||
{% endblock %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.