Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Tezor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Onboarding
AlekSIS-App-Tezor
Commits
1751df82
Commit
1751df82
authored
3 years ago
by
Nik | Klampfradler
Committed by
Tom Teichler
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Move payment variant icon/name lookup to model
parent
62f81689
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!9
Resolve "Add payment processing UI"
,
!3
Implement payment backends and interaction
Pipeline
#59253
failed
3 years ago
Stage: prepare
Stage: test
Stage: build
Stage: publish
Stage: docker
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/apps/tezor/models/invoice.py
+13
-0
13 additions, 0 deletions
aleksis/apps/tezor/models/invoice.py
aleksis/apps/tezor/templates/tezor/invoice/full.html
+2
-6
2 additions, 6 deletions
aleksis/apps/tezor/templates/tezor/invoice/full.html
with
15 additions
and
6 deletions
aleksis/apps/tezor/models/invoice.py
+
13
−
0
View file @
1751df82
...
@@ -33,6 +33,13 @@ class InvoiceGroup(ExtensibleModel):
...
@@ -33,6 +33,13 @@ class InvoiceGroup(ExtensibleModel):
class
Invoice
(
BasePayment
,
PureDjangoModel
):
class
Invoice
(
BasePayment
,
PureDjangoModel
):
VARIANT_DISPLAY
=
{
"
paypal
"
:
(
_
(
"
PayPal
"
),
"
logos:paypal
"
),
"
sofort
"
:
(
_
(
"
Klarna / Sofort
"
),
"
simple-icons:klarna
"
),
"
pledge
"
:
(
_
(
"
Payment pledge / manual payment
"
),
"
mdi:hand-coin
"
),
"
sdd
"
:
(
_
(
"
SEPA Direct Debit
"
),
"
mdi:bank-transfer
"
),
}
group
=
models
.
ForeignKey
(
group
=
models
.
ForeignKey
(
InvoiceGroup
,
verbose_name
=
_
(
"
Invoice group
"
),
related_name
=
"
invoices
"
,
on_delete
=
models
.
SET_NULL
,
null
=
True
InvoiceGroup
,
verbose_name
=
_
(
"
Invoice group
"
),
related_name
=
"
invoices
"
,
on_delete
=
models
.
SET_NULL
,
null
=
True
)
)
...
@@ -43,6 +50,12 @@ class Invoice(BasePayment, PureDjangoModel):
...
@@ -43,6 +50,12 @@ class Invoice(BasePayment, PureDjangoModel):
for_object_id
=
models
.
PositiveIntegerField
()
for_object_id
=
models
.
PositiveIntegerField
()
for_object
=
GenericForeignKey
(
"
for_content_type
"
,
"
for_object_id
"
)
for_object
=
GenericForeignKey
(
"
for_content_type
"
,
"
for_object_id
"
)
def
get_variant_name
(
self
):
return
self
.
__class__
.
VARIANT_DISPLAY
[
self
.
variant
][
0
]
def
get_variant_icon
(
self
):
return
self
.
__class__
.
VARIANT_DISPLAY
[
self
.
variant
][
1
]
def
get_purchased_items
(
self
):
def
get_purchased_items
(
self
):
return
self
.
for_object
.
get_purchased_items
()
return
self
.
for_object
.
get_purchased_items
()
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/tezor/templates/tezor/invoice/full.html
+
2
−
6
View file @
1751df82
...
@@ -64,14 +64,10 @@
...
@@ -64,14 +64,10 @@
<table
class=
"highlight"
>
<table
class=
"highlight"
>
<tr>
<tr>
<td>
<td>
{% if object.variant == "paypal" %}
<i
class=
"material-icons iconify"
data-icon=
"{{ object.get_variant_icon }}"
></i>
<i
class=
"material-icons iconify"
data-icon=
"logos:paypal"
></i>
{% elif object.variant == "sofort" %}
<i
class=
"material-icons iconify"
data-icon=
"simple-icons:klarna"
></i>
{% endif %}
</td>
</td>
<td>
<td>
{{ object.variant }}
{{ object.
get_
variant
_name
}}
</td>
</td>
</tr>
</tr>
<tr>
<tr>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment