Add testmode for gift cards

This commit is contained in:
Raphael Michel
2019-10-17 18:05:04 +02:00
parent 302966808e
commit 4b2f25ce8a
14 changed files with 62 additions and 7 deletions

View File

@@ -355,4 +355,4 @@ class GiftCardCreateForm(forms.ModelForm):
class Meta:
model = GiftCard
fields = ['secret', 'currency']
fields = ['secret', 'currency', 'testmode']

View File

@@ -7,6 +7,9 @@
{% blocktrans trimmed with card=card.secret %}
Gift card: {{ card }}
{% endblocktrans %}
{% if card.testmode %}
<span class="label label-warning">{% trans "TEST MODE" %}</span>
{% endif %}
</h1>
<div class="panel panel-primary items">
<div class="panel-heading">

View File

@@ -9,6 +9,7 @@
{% bootstrap_field form.secret layout="control" %}
{% bootstrap_field form.value layout="control" %}
{% bootstrap_field form.currency layout="control" %}
{% bootstrap_field form.testmode layout="control" %}
<div class="form-group submit-group">
<button type="submit" class="btn btn-primary btn-save">
{% trans "Save" %}

View File

@@ -54,6 +54,9 @@
<a href="{% url "control:organizer.giftcard" organizer=request.organizer.slug giftcard=g.id %}">
<strong>{{ g.secret }}</strong>
</a>
{% if g.testmode %}
<span class="label label-warning">{% trans "TEST MODE" %}</span>
{% endif %}
</td>
<td>{{ g.issuance|date:"SHORT_DATETIME_FORMAT" }}</td>
<td class="text-right">