Files
pretix_cgo/src/pretix/control/templates/pretixcontrol/items/quota.html
T
df0b580dd6 Pluggable permissions (#5728)
* Data model draft

* Refactor query and assignment usages of old permissions

* Backend UI

* API serializer

* Big string replace

* Docs, tests and fixes for teams api

* Update docs for device auth

* Eliminate old names

* Make tests pass

* Use new permissions, remove inconsistencies

* Add test for translations

* Show plugin permissions

* Add permission for seating plans

* Fix plugin activation

* Fix failing test

* Refactor to permission groups

* Update doc/api/resources/devices.rst

Co-authored-by: luelista <weller@rami.io>

* Update doc/api/resources/events.rst

Co-authored-by: luelista <weller@rami.io>

* Update src/pretix/api/serializers/organizer.py

Co-authored-by: luelista <weller@rami.io>

* Fix typo

* Fix python version compat

* Replacement after rebase

* Add proper permission handling for exports

* Docs for exporters

* Runtime linting of permission names

* Fix typos

* Show export page even without orders permission

* More legacy compat

* Do not strongly validate before plugins are loaded

* Rebase migration

* Add permission for outgoing mails

* Review notes

* Update doc/api/resources/teams.rst

Co-authored-by: Richard Schreiber <schreiber@pretix.eu>

* Clean up logic around exporters

* Review and failures

* Fix migration leading to forbidden combination

* Handle permissions on event copying

* Remove print-statements

* Make test clearer

* Review feedback

* Add AnyPermissionOf

* migration safety

---------

Co-authored-by: luelista <weller@rami.io>
Co-authored-by: Richard Schreiber <schreiber@pretix.eu>
2026-03-17 14:43:56 +01:00

113 lines
5.2 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% extends "pretixcontrol/items/base.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% load escapejson %}
{% load eventsignal %}
{% block title %}{% blocktrans with name=quota.name %}Quota: {{ name }}{% endblocktrans %}{% endblock %}
{% block inside %}
<h1>
{% blocktrans with name=quota.name %}Quota: {{ name }}{% endblocktrans %}
{% if 'event.items:write' in request.eventpermset %}
<a href="{% url "control:event.items.quotas.edit" event=request.event.slug organizer=request.event.organizer.slug quota=quota.pk %}"
class="btn btn-default">
<span class="fa fa-edit"></span>
{% trans "Edit quota" %}
</a>
{% endif %}
</h1>
{% if quota.subevent %}
<p>
<span class="fa fa-calendar"></span> {{ quota.subevent.name }} {{ quota.subevent.get_date_range_display }}
</p>
{% endif %}
<form action="" method="post">
{% csrf_token %}
{% if quota.closed %}
{% if closed_and_sold_out %}
<div class="alert alert-info">
<button type="submit" class="btn btn-default pull-right flip" name="disable" value="true">
{% trans "Open quota and disable closing" %}
</button>
{% trans "This quota is sold out and closed. Even if tickets become available e.g. through cancellations, they will not become available again unless you manually re-open the quota on this page." %}
<div class="clearfix"></div>
</div>
{% else %}
<div class="alert alert-warning">
<button type="submit" class="btn btn-primary pull-right flip" name="reopen"
value="true">{% trans "Open quota" %}</button>
{% trans "This quota is closed since it has been sold out before. Tickets are theoretically available, but will not be sold unless you manually re-open the quota." %}
<div class="clearfix"></div>
</div>
{% endif %}
{% endif %}
</form>
<div class="row" id="quota-stats">
<div class="col-md-5 col-xs-12">
<legend>{% trans "Usage overview" %}</legend>
<div class="chart" id="quota_chart">
</div>
<script type="application/json" id="quota-chart-data">{{ quota_chart_data|escapejson }}</script>
</div>
<div class="col-md-5 col-xs-12">
<legend>{% trans "Availability calculation" %}</legend>
<div class="row">
<div class="col-xs-9">{% trans "Total quota" %}</div>
<div class="col-xs-3 flip text-right">
{% if quota.size == None %}{% trans "Infinite" %}{% else %}{{ quota.size }}{% endif %}
</div>
</div>
{% for row in quota_table_rows %}
<div class="row">
<div class="col-xs-9">
{% if row.strong %}<strong>{% endif %}
{{ row.label }}
{% if row.strong %}</strong>{% endif %}
</div>
<div class="col-xs-3 flip text-right">
{% if row.strong %}
<strong>{{ row.value }}</strong>
{% else %}
{% if row.value >= 0 %} {{ row.value }}{% else %}+ {{ row.value_abs }}{% endif %}
{% endif %}
</div>
</div>
{% endfor %}
{% if has_plugins > 0 %}
<div class="alert alert-warning">
{% blocktrans trimmed with num=quota_overbooked %}
A plugin is active that might modify the actual result of this quota from what you see here.
{% endblocktrans %}
</div>
{% endif %}
{% if quota_overbooked > 0 %}
<div class="alert alert-warning">
{% blocktrans trimmed with num=quota_overbooked %}
This quota is currently overbooked by {{ num }} tickets.
{% endblocktrans %}
</div>
{% endif %}
{% if has_ignore_vouchers %}
<div class="alert alert-warning">
{% blocktrans trimmed %}
Your event contains vouchers that affect products covered by this quota and that
allow a user to buy products even if this quota is sold out.
{% endblocktrans %}
</div>
{% endif %}
</div>
<div class="col-md-2 col-xs-12">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
{% trans "Quota history" %}
</h3>
</div>
{% include "pretixcontrol/includes/logs.html" with obj=quota %}
</div>
</div>
</div>
{% eventsignal request.event "pretix.control.signals.quota_detail_html" quota=quota %}
{% endblock %}