Skip to content

Commit

Permalink
Updated checkin view to be able check in all attendees
Browse files Browse the repository at this point in the history
Updated UX in checkin details
  • Loading branch information
ricco386 committed Mar 9, 2017
1 parent b838632 commit 55ea3f7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion konfera/event/forms.py
Expand Up @@ -39,7 +39,7 @@ def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

if self.instance and self.instance.status is not None:
new_choices = [(Ticket.CHECKEDIN, 'Checked-in'), (Ticket.REGISTERED, 'Registered')]
new_choices = [(Ticket.CHECKEDIN, 'Checked-in')] # (Ticket.REGISTERED, 'Registered')]
self.fields['status'].choices = new_choices
self.fields['status'].widget.choices = new_choices

Expand Down
2 changes: 1 addition & 1 deletion konfera/event/views.py
Expand Up @@ -432,7 +432,7 @@ class CheckInDetailView(CheckInAccessMixin, DetailView):

def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['show_form'] = context['object'].status in [Ticket.REGISTERED, Ticket.CHECKEDIN]
context['show_form'] = context['object'].status in [Ticket.REQUESTED, Ticket.REGISTERED, Ticket.CHECKEDIN]
context['form'] = CheckInTicket(instance=context['object'])
context['event'] = context['object'].type.event

Expand Down
27 changes: 15 additions & 12 deletions konfera/templates/konfera/checkin/detail.html
Expand Up @@ -36,24 +36,27 @@ <h2>{% trans "Ticket details" %}</h2>
{% if show_form %}
<form action="." method="post">
{% csrf_token %}
{{ form }}
{{ form.as_p }}
<input type="submit" class="btn btn-primary">
</form>
{% else %}
<p>{% trans "Tiket's status cannot be changed." %}</p>
{% endif %}

{% if request.user.is_staff %}
<hr>
<p>
<a href="{% url 'admin:konfera_ticket_change' object.id %}" class="btn btn-warning">
{% trans "Show ticket in admin" %}
</a>
<hr>
<p>
<a href="{% url 'check_in' event.slug %}" class="btn btn-danger">
{% trans "Back" %}
</a>
{% if request.user.is_staff %}
<a href="{% url 'admin:konfera_ticket_change' object.id %}" class="btn btn-warning">
{% trans "Show ticket in admin" %}
</a>

<a href="{% url 'admin:konfera_order_change' object.order.id %}" class="btn btn-warning">
{% trans "Show order in admin" %}
</a>
</p>
{% endif %}
<a href="{% url 'admin:konfera_order_change' object.order.id %}" class="btn btn-warning">
{% trans "Show order in admin" %}
</a>
{% endif %}
</p>
</div>
{% endblock %}

0 comments on commit 55ea3f7

Please sign in to comment.