Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add links to specific event components #423

Open
wants to merge 29 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
3f8295c
Implement the option to add a video when creating a ticket
odkhang Oct 9, 2024
f200e9f
Optimize code
odkhang Oct 9, 2024
2e940cd
refactor code
lcduong Oct 9, 2024
6e1c32d
revert change relate to base path
lcduong Oct 9, 2024
0532a4c
Implement Celery for the create_world API
odkhang Oct 10, 2024
6558b0b
Implement create video access for the Eventyay-Common page
odkhang Oct 10, 2024
362cb76
Format code
odkhang Oct 11, 2024
0598b38
Merge branch 'development' into feature-240-v2
lcduong Oct 14, 2024
5aa64ce
Merge branch 'development' into feature-240-v2
mariobehling Oct 14, 2024
c04ae99
Code refactoring
odkhang Oct 15, 2024
d4bec3a
resolve conflict
lcduong Oct 25, 2024
cf23cdf
Fix isort, flake8 in pipeline
lcduong Oct 25, 2024
2a15234
Resolve conflict
odkhang Oct 25, 2024
1c28fb8
Resolve conflict
odkhang Oct 25, 2024
55be6fa
Fix isort in pipeline
odkhang Oct 25, 2024
7972c73
Code Refactoring
odkhang Oct 28, 2024
1d40b8d
Merge branch 'development' into feature-240-v2
odkhang Oct 28, 2024
3e150f7
Merge branch 'development' into feature-240-v2
odkhang Nov 1, 2024
ef2a21c
Merge branch 'feature-240-v2' of github.com:odkhang/eventyay-tickets …
odkhang Nov 1, 2024
7712852
resolve conflict
odkhang Nov 1, 2024
61287e4
Fix bug
odkhang Nov 1, 2024
e96d5e0
Update the token's expiration date
odkhang Nov 1, 2024
8bbd7b5
Merge branch 'development' into feature-240-v2
mariobehling Nov 4, 2024
8cd4ced
reformat code
lcduong Nov 4, 2024
e38ce35
replace datetime.utcnow which deprecated function
lcduong Nov 5, 2024
4397e88
fix UT
lcduong Nov 5, 2024
49671fc
Merge remote-tracking branch 'upstream/feature-240-v2' into feature-391
lcduong Nov 7, 2024
5c7a89a
Add links to specific event components
lcduong Nov 8, 2024
9c859aa
update title message for video button and fix pipeline
lcduong Nov 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions src/pretix/control/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ def _default_context(request):
if hasattr(request, 'event') and request.user.is_authenticated:
for receiver, response in html_head.send(request.event, request=request):
_html_head.append(response)
ctx["talk_edit_url"] = (
settings.TALK_HOSTNAME + "/orga/event/" + request.event.slug + "/settings"
)
ctx['is_video_enabled'] = _is_video_enabled(request.event)
ctx['html_head'] = "".join(_html_head)

_js_payment_weekdays_disabled = '[]'
Expand Down Expand Up @@ -133,3 +137,31 @@ def _default_context(request):
)

return ctx


def _get_plugins(plugin_list):
"""
Format the plugin list into an array
@param plugin_list: list of plugins
@return: array of plugins
"""
if plugin_list is None:
return []
return [p.strip() for p in plugin_list.split(",") if p.strip()]


def _is_video_enabled(event):
"""
Check if the video plugin is enabled
@param event: event object
@return: boolean
"""
if (
"pretix_venueless" not in _get_plugins(event.plugins)
or not event.settings.venueless_url
or not event.settings.venueless_issuer
or not event.settings.venueless_audience
or not event.settings.venueless_secret
):
return False
return True
47 changes: 27 additions & 20 deletions src/pretix/control/templates/pretixcontrol/checkin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,33 @@
{% blocktrans with name=checkinlist.name %}Check-in list: {{ name }}{% endblocktrans %}
{% endblock %}
{% block content %}
<h1>
{% blocktrans with name=checkinlist.name %}Check-in list: {{ name }}{% endblocktrans %}
{% if 'can_change_event_settings' in request.eventpermset %}
<a href="{% url "control:event.orders.checkinlists.edit" event=request.event.slug organizer=request.event.organizer.slug list=checkinlist.pk %}"
class="btn btn-default">
<span class="fa fa-wrench"></span>
{% trans "Edit list configuration" %}
</a>
{% endif %}
<a href="{% url "control:event.orders.export" event=request.event.slug organizer=request.event.organizer.slug %}?identifier=checkinlistpdf&checkinlistpdf-list={{ checkinlist.pk }}"
class="btn btn-default" target="_blank">
<span class="fa fa-download"></span>
{% trans "PDF" %}
</a>
<a href="{% url "control:event.orders.export" event=request.event.slug organizer=request.event.organizer.slug %}?identifier=checkinlist&checkinlist-list={{ checkinlist.pk }}"
class="btn btn-default" target="_blank">
<span class="fa fa-download"></span>
{% trans "CSV" %}
</a>
</h1>
<nav id="event-nav" class="header-nav">
<div class="navigation">
<div class="navigation-title">
<h1>
{% blocktrans with name=checkinlist.name %}Check-in list: {{ name }}{% endblocktrans %}
{% if 'can_change_event_settings' in request.eventpermset %}
<a href="{% url "control:event.orders.checkinlists.edit" event=request.event.slug organizer=request.event.organizer.slug list=checkinlist.pk %}"
class="btn btn-default">
<span class="fa fa-wrench"></span>
{% trans "Edit list configuration" %}
</a>
{% endif %}
<a href="{% url "control:event.orders.export" event=request.event.slug organizer=request.event.organizer.slug %}?identifier=checkinlistpdf&checkinlistpdf-list={{ checkinlist.pk }}"
class="btn btn-default" target="_blank">
<span class="fa fa-download"></span>
{% trans "PDF" %}
</a>
<a href="{% url "control:event.orders.export" event=request.event.slug organizer=request.event.organizer.slug %}?identifier=checkinlist&checkinlist-list={{ checkinlist.pk }}"
class="btn btn-default" target="_blank">
<span class="fa fa-download"></span>
{% trans "CSV" %}
</a>
</h1>
</div>
{% include "pretixcontrol/event/component_link.html" %}
</div>
</nav>
<form class="row filter-form" action="" method="get">
<div class="col-md-4 col-sm-6 col-xs-12">
{% bootstrap_field filter_form.user layout='inline' %}
Expand Down
17 changes: 12 additions & 5 deletions src/pretix/control/templates/pretixcontrol/checkin/list_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,18 @@
{% endif %}
{% endblock %}
{% block inside %}
{% if checkinlist %}
<h1>{% blocktrans with name=checkinlist.name %}Check-in list: {{ name }}{% endblocktrans %}</h1>
{% else %}
<h1>{% trans "Check-in list" %}</h1>
{% endif %}
<nav id="event-nav" class="header-nav">
<div class="navigation">
<div class="navigation-title">
{% if checkinlist %}
<h1>{% blocktrans with name=checkinlist.name %}Check-in list: {{ name }}{% endblocktrans %}</h1>
{% else %}
<h1>{% trans "Check-in list" %}</h1>
{% endif %}
</div>
{% include "pretixcontrol/event/component_link.html" %}
</div>
</nav>
<form action="" method="post" class="form-horizontal">
<script type="text/plain"
id="product-select2">{% url "control:event.items.select2" event=request.event.slug organizer=request.organizer.slug %}</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
{% load i18n %}
{% block title %}{% trans "Check-in lists" %}{% endblock %}
{% block inside %}
<h1>{% trans "Check-in lists" %}</h1>
<nav id="event-nav" class="header-nav">
<div class="navigation">
<div class="navigation-title">
<h1>{% trans "Check-in lists" %}</h1>
</div>
{% include "pretixcontrol/event/component_link.html" %}
</div>
</nav>
<p>
{% blocktrans trimmed %}
You can create check-in lists that you can use e.g. at the entrance of your event to track who is coming
Expand Down
9 changes: 8 additions & 1 deletion src/pretix/control/templates/pretixcontrol/event/cancel.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
{% load i18n %}
{% load bootstrap3 %}
{% block inside %}
<h1>{% trans "Cancellation settings" %}</h1>
<nav id="event-nav" class="header-nav">
<div class="navigation">
<div class="navigation-title">
<h1>{% trans "Cancellation settings" %}</h1>
</div>
{% include "pretixcontrol/event/component_link.html" %}
</div>
</nav>
<form action="" method="post" class="form-horizontal" enctype="multipart/form-data">
{% csrf_token %}
{% bootstrap_form_errors form %}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{% load i18n %}
<div class="navigation-button">
<a href="#" class="header-nav btn btn-outline-success active">
<i class="fa fa-ticket"></i> {% trans "Tickets" %}
</a>
<a href="{{ talk_edit_url }}" class="header-nav btn btn-outline-success">
<i class="fa fa-group"></i> {% trans "Talk" %}
</a>
{% if is_video_enabled %}
<a class="header-nav btn btn-outline-success"
href='{% url "eventyay_common:event.create_access_to_video" organizer=request.organizer.slug event=request.event.slug %}'
title="{% trans 'Access videos related to this event' %}">
<i class="fa fa-video-camera"></i> {% trans "Videos" %}
</a>
{% else %}
<a class="header-nav btn btn-outline-success disabled" href="#" disabled
title="{% trans 'Videos are not available because the plugin is inactive or missing settings for this event' %}">
<i class="fa fa-video-camera"></i> {% trans "Videos" %}
</a>
{% endif %}
</div>
27 changes: 17 additions & 10 deletions src/pretix/control/templates/pretixcontrol/event/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,23 @@
{% load eventsignal %}
{% block title %}{{ request.event.name }}{% endblock %}
{% block content %}
<h1>
{{ request.event.name }}
<small>
{% if request.event.has_subevents %}
{% trans "Event series" %}
{% else %}
{{ request.event.get_date_range_display }}
{% endif %}
</small>
</h1>
<nav id="event-nav" class="header-nav">
<div class="navigation">
<div class="navigation-title">
<h1>
{{ request.event.name }}
<small>
{% if request.event.has_subevents %}
{% trans "Event series" %}
{% else %}
{{ request.event.get_date_range_display }}
{% endif %}
</small>
</h1>
</div>
{% include "pretixcontrol/event/component_link.html" %}
</div>
</nav>
{% if has_overpaid_orders %}
<div class="alert alert-warning">
{% blocktrans trimmed %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
{% load i18n %}
{% load bootstrap3 %}
{% block inside %}
<h1>{% trans "Invoice settings" %}</h1>
<nav id="event-nav" class="header-nav">
<div class="navigation">
<div class="navigation-title">
<h1>{% trans "Invoice settings" %}</h1>
</div>
{% include "pretixcontrol/event/component_link.html" %}
</div>
</nav>
<form action="" method="post" class="form-horizontal" enctype="multipart/form-data">
<div class="tabbed-form">
{% csrf_token %}
Expand Down
9 changes: 8 additions & 1 deletion src/pretix/control/templates/pretixcontrol/event/live.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
{% load i18n %}
{% load bootstrap3 %}
{% block content %}
<h1>{% trans "Shop status" %}</h1>
<nav id="event-nav" class="header-nav">
<div class="navigation">
<div class="navigation-title">
<h1>{% trans "Shop status" %}</h1>
</div>
{% include "pretixcontrol/event/component_link.html" %}
</div>
</nav>
<div class="panel panel-default">
<div class="panel-heading">
{% trans "Shop visibility" %}
Expand Down
9 changes: 8 additions & 1 deletion src/pretix/control/templates/pretixcontrol/event/mail.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@
{% load hierarkey_form %}
{% load static %}
{% block inside %}
<h1>{% trans "E-mail settings" %}</h1>
<nav id="event-nav" class="header-nav">
<div class="navigation">
<div class="navigation-title">
<h1>{% trans "E-mail settings" %}</h1>
</div>
{% include "pretixcontrol/event/component_link.html" %}
</div>
</nav>
<form action="" method="post" class="form-horizontal" enctype="multipart/form-data"
mail-preview-url="{% url "control:event.settings.mail.preview" event=request.event.slug organizer=request.event.organizer.slug %}">
{% csrf_token %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
{% load i18n %}
{% load bootstrap3 %}
{% block inside %}
<h1>{% trans "Payment settings" %}</h1>
<nav id="event-nav" class="header-nav">
<div class="navigation">
<div class="navigation-title">
<h1>{% trans "Payment settings" %}</h1>
</div>
{% include "pretixcontrol/event/component_link.html" %}
</div>
</nav>
<form action="" method="post" class="form-horizontal form-plugins">
{% csrf_token %}
<div class="tabbed-form">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
{% load static %}
{% load bootstrap3 %}
{% block inside %}
<h1>{% trans "Installed plugins" %}</h1>
<nav id="event-nav" class="header-nav">
<div class="navigation">
<div class="navigation-title">
<h1>{% trans "Installed plugins" %}</h1>
</div>
{% include "pretixcontrol/event/component_link.html" %}
</div>
</nav>
<form action="" method="post" class="form-horizontal form-plugins">
{% csrf_token %}
{% if "success" in request.GET %}
Expand Down
10 changes: 8 additions & 2 deletions src/pretix/control/templates/pretixcontrol/event/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@
<link type="text/css" rel="stylesheet" href="{% url "control:pdf.css" %}">
{% endblock %}
{% block inside %}
<h1>{% trans "General settings" %}</h1>

<nav id="event-nav" class="header-nav">
<div class="navigation">
<div class="navigation-title">
<h1>{% trans "General settings" %}</h1>
</div>
{% include "pretixcontrol/event/component_link.html" %}
</div>
</nav>
<form action="" method="post" class="form-horizontal" enctype="multipart/form-data">
{% csrf_token %}
{% bootstrap_form_errors form %}
Expand Down
17 changes: 12 additions & 5 deletions src/pretix/control/templates/pretixcontrol/event/tax_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,18 @@
{% endif %}
{% endblock %}
{% block inside %}
{% if rule %}
<h1>{% blocktrans with name=rule.name %}Tax rule: {{ name }}{% endblocktrans %}</h1>
{% else %}
<h1>{% trans "Tax rule" %}</h1>
{% endif %}
<nav id="event-nav" class="header-nav">
<div class="navigation">
<div class="navigation-title">
{% if rule %}
<h1>{% blocktrans with name=rule.name %}Tax rule: {{ name }}{% endblocktrans %}</h1>
{% else %}
<h1>{% trans "Tax rule" %}</h1>
{% endif %}
</div>
{% include "pretixcontrol/event/component_link.html" %}
</div>
</nav>
<form action="" method="post" class="form-horizontal">
{% csrf_token %}
{% bootstrap_form_errors form %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
{% load i18n %}
{% block title %}{% trans "Tax rules" %}{% endblock %}
{% block inside %}
<h1>{% trans "Tax rules" %}</h1>
<nav id="event-nav" class="header-nav">
<div class="navigation">
<div class="navigation-title">
<h1>{% trans "Tax rules" %}</h1>
</div>
{% include "pretixcontrol/event/component_link.html" %}
</div>
</nav>
{% if taxrules|length == 0 %}
<div class="empty-collection">
<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@
{% block inside %}
<form action="" method="post" class="form-horizontal" enctype="multipart/form-data">
{% csrf_token %}
<h1>{% trans "Ticket download" %}</h1>
<nav id="event-nav" class="header-nav">
<div class="navigation">
<div class="navigation-title">
<h1>{% trans "Ticket download" %}</h1>
</div>
{% include "pretixcontrol/event/component_link.html" %}
</div>
</nav>
<div class="">
<fieldset>
<legend>{% trans "Download settings" %}</legend>
Expand Down
9 changes: 8 additions & 1 deletion src/pretix/control/templates/pretixcontrol/event/widget.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@
{% load eventurl %}
{% load eventsignal %}
{% block inside %}
<h1>{% trans "Widget" %}</h1>
<nav id="event-nav" class="header-nav">
<div class="navigation">
<div class="navigation-title">
<h1>{% trans "Widget" %}</h1>
</div>
{% include "pretixcontrol/event/component_link.html" %}
</div>
</nav>
<p>
{% blocktrans trimmed %}
A widget allows you to embed your ticket shop directly into your event website. This enables your visitors to purchase tickets instantly without leaving your site.
Expand Down
Loading
Loading