forked from CGM_Public/pretix_original
* replace manual form with QuestionFilterForm * move form to form/item.py * filter using a dateFrameField * rename QuestionFilterForm to QuestionAnswerFilterForm Co-authored-by: Richard Schreiber <schreiber@pretix.eu> * pass existing `opqs` into `filter_qs` Co-authored-by: Richard Schreiber <schreiber@pretix.eu> * clean up filters * fix view errors * add labels * display validation failures on field/label * fix linting issues * adjust datetime comparisons from lte to lt & gte to gt * Change filter-form layout similar to order-filter-form * improve label texts Co-authored-by: Richard Schreiber <schreiber@pretix.eu> * use order constants Co-authored-by: Richard Schreiber <schreiber@pretix.eu> * use Order Constants in Form where possible * Change phrasing from Subevent to Date Co-authored-by: Richard Schreiber <schreiber@pretix.eu> * include product variations in products filter * repair time zone comparisons * fix linting * move filter form to form/filter.py * remove references to timezone.utc Co-authored-by: Richard Schreiber <schreiber@pretix.eu> * remove manual class statements Co-authored-by: Richard Schreiber <schreiber@pretix.eu> * removes unnecessary check Co-authored-by: Richard Schreiber <schreiber@pretix.eu> * fix datetime comparison * Add full stop to error message to match style * unify var-names and code-indent --------- Co-authored-by: Richard Schreiber <schreiber@pretix.eu> Co-authored-by: Richard Schreiber <schreiber@rami.io>
118 lines
5.0 KiB
HTML
118 lines
5.0 KiB
HTML
{% extends "pretixcontrol/items/base.html" %}
|
|
{% load i18n %}
|
|
{% load bootstrap3 %}
|
|
{% load escapejson %}
|
|
{% load formset_tags %}
|
|
{% block title %}{% blocktrans with name=question.question %}Question: {{ name }}{% endblocktrans %}{% endblock %}
|
|
{% block inside %}
|
|
<h1>
|
|
{% blocktrans with name=question.question %}Question: {{ name }}{% endblocktrans %}
|
|
<a href="{% url "control:event.items.questions.edit" event=request.event.slug organizer=request.event.organizer.slug question=question.pk %}"
|
|
class="btn btn-default">
|
|
<span class="fa fa-edit"></span>
|
|
{% trans "Edit question" %}
|
|
</a>
|
|
</h1>
|
|
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading">
|
|
<h3 class="panel-title">{% trans "Filter" %}</h3>
|
|
</div>
|
|
<form class="panel-body filter-form" action="" method="get">
|
|
<div class="row">
|
|
<div class="col-md-2 col-xs-6">
|
|
{% bootstrap_field form.status %}
|
|
</div>
|
|
<div class="col-md-3 col-xs-6">
|
|
{% bootstrap_field form.item %}
|
|
</div>
|
|
{% if has_subevents %}
|
|
<div class="col-md-3 col-xs-6">
|
|
{% bootstrap_field form.subevent %}
|
|
</div>
|
|
<div class="col-md-4 col-xs-6">
|
|
{% bootstrap_field form.date_range %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
<div class="text-right">
|
|
<button class="btn btn-primary btn-lg" type="submit">
|
|
<span class="fa fa-filter"></span>
|
|
{% trans "Filter" %}
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<div class="row">
|
|
{% if not stats %}
|
|
<div class="empty-collection col-md-10 col-xs-12">
|
|
<p>
|
|
{% blocktrans trimmed %}
|
|
No matching answers found.
|
|
{% endblocktrans %}
|
|
</p>
|
|
{% if not items %}
|
|
<p>
|
|
{% trans "You need to assign the question to a product to collect answers." %}
|
|
</p>
|
|
|
|
<a href="{% url "control:event.items.questions.edit" event=request.event.slug organizer=request.event.organizer.slug question=question.pk %}"
|
|
class="btn btn-primary btn-lg"><i class="fa fa-edit"></i> {% trans "Edit question" %}</a>
|
|
{% endif %}
|
|
</div>
|
|
{% else %}
|
|
<div class="col-md-5 col-xs-12">
|
|
<div class="chart" id="question_chart" data-type="{{ question.type }}">
|
|
|
|
</div>
|
|
{{ stats|json_script:"question-chart-data" }}
|
|
</div>
|
|
<div class="col-md-5 col-xs-12">
|
|
<table class="table table-bordered table-hover">
|
|
<thead>
|
|
<tr>
|
|
<th>{% trans "Answer" %}</th>
|
|
<th class="text-right">{% trans "Count" %}</th>
|
|
<th class="text-right">{% trans "% of answers" %}</th>
|
|
<th class="text-right">{% trans "% of tickets" %}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for stat in stats %}
|
|
<tr>
|
|
<td>
|
|
<a href="{% url "control:event.orders" event=request.event.slug organizer=request.event.organizer.slug %}?status={{ request.GET.status|default:"np" }}&item={{ request.GET.item }}&subevent={{ request.GET.subevent }}&question={{ question.pk }}&answer={{ stat.alink|default:stat.answer|urlencode }}">
|
|
{{ stat.answer }}
|
|
</a>
|
|
</td>
|
|
<td class="text-right">{{ stat.count }}</td>
|
|
<td class="text-right">{{ stat.percentage|floatformat:1 }} %</td>
|
|
<td class="text-right">{{ stat.percentage_attendees|floatformat:1 }} %</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
<tfoot>
|
|
<tr>
|
|
<td><strong>{% trans "Sum" %}</strong></td>
|
|
<td class="text-right"><strong>{{ total }}</strong></td>
|
|
<td></td>
|
|
<td></td>
|
|
</tr>
|
|
</tfoot>
|
|
</table>
|
|
</div>
|
|
{% endif %}
|
|
<div class="col-xs-12 col-lg-2">
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading">
|
|
<h3 class="panel-title">
|
|
{% trans "Question history" %}
|
|
</h3>
|
|
</div>
|
|
{% include "pretixcontrol/includes/logs.html" with obj=question %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|