Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
thalia
concrexit
Commits
32e065bb
Verified
Commit
32e065bb
authored
Feb 04, 2019
by
Sébastiaan Versteeg
Browse files
Add wire payment type to payments app
parent
23b79eb4
Changes
4
Hide whitespace changes
Inline
Side-by-side
website/payments/migrations/0003_auto_20190204_2111.py
0 → 100644
View file @
32e065bb
# Generated by Django 2.1.5 on 2019-02-04 20:11
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'payments'
,
'0002_auto_20181127_1819'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'payment'
,
name
=
'type'
,
field
=
models
.
CharField
(
choices
=
[(
'no_payment'
,
'No payment'
),
(
'cash_payment'
,
'Cash payment'
),
(
'card_payment'
,
'Card payment'
),
(
'wire_payment'
,
'Wire payment'
)],
default
=
'no_payment'
,
max_length
=
20
,
verbose_name
=
'type'
),
),
]
website/payments/models.py
View file @
32e065bb
...
@@ -20,11 +20,13 @@ class Payment(models.Model):
...
@@ -20,11 +20,13 @@ class Payment(models.Model):
NONE
=
'no_payment'
NONE
=
'no_payment'
CASH
=
'cash_payment'
CASH
=
'cash_payment'
CARD
=
'card_payment'
CARD
=
'card_payment'
WIRE
=
'wire_payment'
PAYMENT_TYPE
=
(
PAYMENT_TYPE
=
(
(
NONE
,
_
(
'No payment'
)),
(
NONE
,
_
(
'No payment'
)),
(
CASH
,
_
(
'Cash payment'
)),
(
CASH
,
_
(
'Cash payment'
)),
(
CARD
,
_
(
'Card payment'
)),
(
CARD
,
_
(
'Card payment'
)),
(
WIRE
,
_
(
'Wire payment'
)),
)
)
type
=
models
.
CharField
(
type
=
models
.
CharField
(
...
...
website/payments/templates/admin/payments/change_form.html
View file @
32e065bb
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
<div
class=
"submit-row payments-row"
>
<div
class=
"submit-row payments-row"
>
<a
data-href=
"{% url 'admin:payments_payment_process' pk=payment.pk %}"
data-type=
"cash_payment"
class=
"button process"
>
{% trans "Process (cash payment)" %}
</a>
<a
data-href=
"{% url 'admin:payments_payment_process' pk=payment.pk %}"
data-type=
"cash_payment"
class=
"button process"
>
{% trans "Process (cash payment)" %}
</a>
<a
data-href=
"{% url 'admin:payments_payment_process' pk=payment.pk %}"
data-type=
"card_payment"
class=
"button process"
>
{% trans "Process (card payment)" %}
</a>
<a
data-href=
"{% url 'admin:payments_payment_process' pk=payment.pk %}"
data-type=
"card_payment"
class=
"button process"
>
{% trans "Process (card payment)" %}
</a>
<a
data-href=
"{% url 'admin:payments_payment_process' pk=payment.pk %}"
data-type=
"wire_payment"
class=
"button process"
>
{% trans "Process (wire payment)" %}
</a>
</div>
</div>
{% endif %}
{% endif %}
...
...
website/payments/templates/payments/widget.html
View file @
32e065bb
...
@@ -14,6 +14,9 @@
...
@@ -14,6 +14,9 @@
<a
data-href=
"{% url 'admin:payments_payment_process' pk=payment.pk %}"
<a
data-href=
"{% url 'admin:payments_payment_process' pk=payment.pk %}"
data-next=
"true"
data-type=
"card_payment"
data-next=
"true"
data-type=
"card_payment"
class=
"button process"
>
{% trans "Process (card payment)" %}
</a>
class=
"button process"
>
{% trans "Process (card payment)" %}
</a>
<a
data-href=
"{% url 'admin:payments_payment_process' pk=payment.pk %}"
data-next=
"true"
data-type=
"wire_payment"
class=
"button process"
>
{% trans "Process (wire payment)" %}
</a>
{% else %}
{% else %}
<a
href=
"{{ url }}"
>
<a
href=
"{{ url }}"
>
{% trans "Processed" %}
{% trans "Processed" %}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment