Skip to content

Commit

Permalink
Add tickets link to schedule when eventyay-tickets component is active (
Browse files Browse the repository at this point in the history
  • Loading branch information
lcduong authored Jul 20, 2024
1 parent a378967 commit 21c0e35
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/pretalx/agenda/templates/agenda/header_row.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,20 @@
<div class="navigation">
<a href="{{ request.event.urls.schedule }}" class="btn btn-outline-success {% if "/schedule/" in request.path %} active{% endif %}">
<i class="fa fa-calendar"></i> {% translate "Schedule" %}
{% if request.event.display_settings.schedule_display != "list" %}
</a><a href="{{ request.event.urls.talks }}" class="btn btn-outline-success {% if "/talk/" in request.path %} active{% endif %}">
<i class="fa fa-comments-o"></i> {% translate "Sessions" %}
{% endif %}
</a><a href="{{ request.event.urls.speakers }}" class="btn btn-outline-success {% if "/speaker/" in request.path %} active{% endif %}">
<i class="fa fa-group"></i> {% translate "Speakers" %}</a>
</a>
{% if request.event.display_settings.schedule_display != "list" %}
<a href="{{ request.event.urls.talks }}" class="btn btn-outline-success {% if "/talk/" in request.path %} active{% endif %}">
<i class="fa fa-comments-o"></i> {% translate "Sessions" %}
</a>
{% endif %}
<a href="{{ request.event.urls.speakers }}" class="btn btn-outline-success {% if "/speaker/" in request.path %} active{% endif %}">
<i class="fa fa-group"></i> {% translate "Speakers" %}
</a>
{% if request.event.display_settings.ticket_link %}
<a href="{{ request.event.display_settings.ticket_link }}" target="_blank" class="btn btn-outline-success">
<i class="fa fa-group"></i> {% translate "Tickets" %}
</a>
{% endif %}
</div>
<div class="header-right">
{% if with_extra %}
Expand Down
11 changes: 11 additions & 0 deletions src/pretalx/orga/forms/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,16 @@ class EventForm(ReadOnlyFlag, I18nHelpText, JsonSubfieldMixin, I18nModelForm):
),
required=False,
)
ticket_link = forms.URLField(
label=_("Event ticket shop URL"),
help_text=_(
"Ticket shop link will be shown on event menu. "
),
widget=forms.TextInput(attrs={
'placeholder': 'e.g: https://tickets-dev.eventyay.com/2024/wikimania/'
}),
required=False,
)
header_pattern = forms.ChoiceField(
label=_("Frontpage header pattern"),
help_text=_(
Expand Down Expand Up @@ -357,6 +367,7 @@ class Meta:
"use_feedback": "feature_flags",
"export_html_on_release": "feature_flags",
"html_export_url": "display_settings",
"ticket_link": "display_settings",
"header_pattern": "display_settings",
"meta_noindex": "display_settings",
}
Expand Down
1 change: 1 addition & 0 deletions src/pretalx/orga/templates/orga/settings/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ <h2>{% translate "Settings" %}</h2>
{% bootstrap_field form.export_html_on_release layout='event' %}
{% bootstrap_field form.html_export_url layout='event' %}
{% bootstrap_field form.meta_noindex layout='event' %}
{% bootstrap_field form.ticket_link layout='event' %}

</fieldset>
<fieldset>
Expand Down

0 comments on commit 21c0e35

Please sign in to comment.