mirror of
https://github.com/pretix/pretix.git
synced 2026-08-19 12:16:26 +00:00
Hide order-level questions UI behind feature flag
This commit is contained in:
@@ -10,17 +10,27 @@
|
|||||||
{% endblocktrans %}
|
{% endblocktrans %}
|
||||||
</p>
|
</p>
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
{% if 'event.items:write' in request.eventpermset %}
|
|
||||||
<p>
|
|
||||||
<a href="{% url "control:event.items.questions.add" organizer=request.event.organizer.slug event=request.event.slug %}?container_type=P" class="btn btn-default"><i class="fa fa-plus"></i> {% trans "Create a new per-ticket question" %}
|
|
||||||
</a>
|
|
||||||
<a href="{% url "control:event.items.questions.add" organizer=request.event.organizer.slug event=request.event.slug %}?container_type=O" class="btn btn-default"><i class="fa fa-plus"></i> {% trans "Create a new order-level question" %}
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<h2>{% trans "Per-ticket questions" %}</h2>
|
{% if request.event.settings.feature_flag_order_level_questions %}
|
||||||
<p>{% trans "These questions are asked for every ticket, so possibly multiple times in the same order." %}</p>
|
{% if 'event.items:write' in request.eventpermset %}
|
||||||
|
<p>
|
||||||
|
<a href="{% url "control:event.items.questions.add" organizer=request.event.organizer.slug event=request.event.slug %}?container_type=P" class="btn btn-default"><i class="fa fa-plus"></i> {% trans "Create a new per-ticket question" %}
|
||||||
|
</a>
|
||||||
|
<a href="{% url "control:event.items.questions.add" organizer=request.event.organizer.slug event=request.event.slug %}?container_type=O" class="btn btn-default"><i class="fa fa-plus"></i> {% trans "Create a new order-level question" %}
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<h2>{% trans "Per-ticket questions" %}</h2>
|
||||||
|
<p>{% trans "These questions are asked for every ticket, so possibly multiple times in the same order." %}</p>
|
||||||
|
{% else %}
|
||||||
|
{% if 'event.items:write' in request.eventpermset %}
|
||||||
|
<p>
|
||||||
|
<a href="{% url "control:event.items.questions.add" organizer=request.event.organizer.slug event=request.event.slug %}?container_type=P" class="btn btn-default"><i class="fa fa-plus"></i> {% trans "Create a new question" %}
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table table-hover table-quotas">
|
<table class="table table-hover table-quotas">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -112,82 +122,90 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h2>{% trans "Per-order questions" %}</h2>
|
{% if request.event.settings.feature_flag_order_level_questions %}
|
||||||
<p>{% trans "These questions are asked once per order." %}</p>
|
<h2>
|
||||||
<div class="table-responsive">
|
{% trans "Per-order questions" %}
|
||||||
<table class="table table-hover table-quotas">
|
<small><span class="label label-info">
|
||||||
<thead>
|
<span class="fa fa-flask" aria-hidden="true"></span>
|
||||||
<tr>
|
{% trans "Experimental feature" %}
|
||||||
<th>{% trans "Question" %}</th>
|
</span></small>
|
||||||
<th>{% trans "Type" %}</th>
|
</h2>
|
||||||
<th class="iconcol"></th>
|
<p>{% trans "These questions are asked once per order." %}</p>
|
||||||
<th class="iconcol"></th>
|
<div class="table-responsive">
|
||||||
<th class="iconcol"></th>
|
<table class="table table-hover table-quotas">
|
||||||
{% if 'event.items:write' in request.eventpermset %}
|
<thead>
|
||||||
<th class="action-col-2"></th>
|
<tr>
|
||||||
{% endif %}
|
<th>{% trans "Question" %}</th>
|
||||||
<th class="action-col-2"></th>
|
<th>{% trans "Type" %}</th>
|
||||||
</tr>
|
<th class="iconcol"></th>
|
||||||
</thead>
|
<th class="iconcol"></th>
|
||||||
<tbody data-dnd-url="{% url "control:event.items.questions.reorder" organizer=request.event.organizer.slug event=request.event.slug %}?container_type=O">
|
<th class="iconcol"></th>
|
||||||
{% for q in questions %}{% if q.container_type == "O" %}
|
|
||||||
<tr data-dnd-id="{{ q.id }}">
|
|
||||||
<td>
|
|
||||||
<strong>
|
|
||||||
{% if q.pk %}
|
|
||||||
<a href="{% url "control:event.items.questions.show" organizer=request.event.organizer.slug event=request.event.slug question=q.id %}">
|
|
||||||
{% endif %}
|
|
||||||
{{ q.question }}
|
|
||||||
{% if q.pk %}
|
|
||||||
</a>
|
|
||||||
{% endif %}
|
|
||||||
</strong><br>
|
|
||||||
<small class="text-muted">{{ q.identifier }}</small>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
{% if q.pk %}
|
|
||||||
{{ q.get_type_display }}
|
|
||||||
{% else %}
|
|
||||||
{% trans "System question" %}
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
{% if q.required %}
|
|
||||||
<span class="fa fa-exclamation-circle text-muted" data-toggle="tooltip" title="{% trans "Required question" %}"></span>
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
{% if q.pk and q.ask_during_checkin %}
|
|
||||||
<span class="fa fa-check-square text-muted" data-toggle="tooltip" title="{% trans "Ask during check-in" %}"></span>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
{% if q.pk and q.hidden %}
|
|
||||||
<span class="fa fa-eye-slash text-muted" data-toggle="tooltip" title="{% trans "Hidden question" %}"></span>
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
{% if 'event.items:write' in request.eventpermset %}
|
{% if 'event.items:write' in request.eventpermset %}
|
||||||
<td class="dnd-container">
|
<th class="action-col-2"></th>
|
||||||
</td>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<td class="text-right flip">
|
<th class="action-col-2"></th>
|
||||||
{% if q.pk %}
|
|
||||||
<a href="{% url "control:event.items.questions.show" organizer=request.event.organizer.slug event=request.event.slug question=q.id %}" class="btn btn-default btn-sm"><i class="fa fa-bar-chart"></i></a>
|
|
||||||
{% if 'event.items:write' in request.eventpermset %}
|
|
||||||
<a href="{% url "control:event.items.questions.edit" organizer=request.event.organizer.slug event=request.event.slug question=q.id %}" class="btn btn-default btn-sm"><i class="fa fa-edit"></i></a>
|
|
||||||
<a href="{% url "control:event.items.questions.delete" organizer=request.event.organizer.slug event=request.event.slug question=q.id %}" class="btn btn-danger btn-sm"><i class="fa fa-trash"></i></a>
|
|
||||||
{% endif %}
|
|
||||||
{% else %}
|
|
||||||
{% if 'event.settings.general:write' in request.eventpermset %}
|
|
||||||
<a href="{% url "control:event.settings" organizer=request.event.organizer.slug event=request.event.slug %}#tab-0-2-open"
|
|
||||||
class="btn btn-default btn-sm"><i class="fa fa-wrench"></i></a>
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}{% endfor %}
|
</thead>
|
||||||
</tbody>
|
<tbody data-dnd-url="{% url "control:event.items.questions.reorder" organizer=request.event.organizer.slug event=request.event.slug %}?container_type=O">
|
||||||
</table>
|
{% for q in questions %}{% if q.container_type == "O" %}
|
||||||
</div>
|
<tr data-dnd-id="{{ q.id }}">
|
||||||
|
<td>
|
||||||
|
<strong>
|
||||||
|
{% if q.pk %}
|
||||||
|
<a href="{% url "control:event.items.questions.show" organizer=request.event.organizer.slug event=request.event.slug question=q.id %}">
|
||||||
|
{% endif %}
|
||||||
|
{{ q.question }}
|
||||||
|
{% if q.pk %}
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
</strong><br>
|
||||||
|
<small class="text-muted">{{ q.identifier }}</small>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{% if q.pk %}
|
||||||
|
{{ q.get_type_display }}
|
||||||
|
{% else %}
|
||||||
|
{% trans "System question" %}
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{% if q.required %}
|
||||||
|
<span class="fa fa-exclamation-circle text-muted" data-toggle="tooltip" title="{% trans "Required question" %}"></span>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{% if q.pk and q.ask_during_checkin %}
|
||||||
|
<span class="fa fa-check-square text-muted" data-toggle="tooltip" title="{% trans "Ask during check-in" %}"></span>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{% if q.pk and q.hidden %}
|
||||||
|
<span class="fa fa-eye-slash text-muted" data-toggle="tooltip" title="{% trans "Hidden question" %}"></span>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
{% if 'event.items:write' in request.eventpermset %}
|
||||||
|
<td class="dnd-container">
|
||||||
|
</td>
|
||||||
|
{% endif %}
|
||||||
|
<td class="text-right flip">
|
||||||
|
{% if q.pk %}
|
||||||
|
<a href="{% url "control:event.items.questions.show" organizer=request.event.organizer.slug event=request.event.slug question=q.id %}" class="btn btn-default btn-sm"><i class="fa fa-bar-chart"></i></a>
|
||||||
|
{% if 'event.items:write' in request.eventpermset %}
|
||||||
|
<a href="{% url "control:event.items.questions.edit" organizer=request.event.organizer.slug event=request.event.slug question=q.id %}" class="btn btn-default btn-sm"><i class="fa fa-edit"></i></a>
|
||||||
|
<a href="{% url "control:event.items.questions.delete" organizer=request.event.organizer.slug event=request.event.slug question=q.id %}" class="btn btn-danger btn-sm"><i class="fa fa-trash"></i></a>
|
||||||
|
{% endif %}
|
||||||
|
{% else %}
|
||||||
|
{% if 'event.settings.general:write' in request.eventpermset %}
|
||||||
|
<a href="{% url "control:event.settings" organizer=request.event.organizer.slug event=request.event.slug %}#tab-0-2-open"
|
||||||
|
class="btn btn-default btn-sm"><i class="fa fa-wrench"></i></a>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endif %}{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Reference in New Issue
Block a user