Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Onboarding
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
3lisvequii
Onboarding
Commits
a823176b
Commit
a823176b
authored
2 years ago
by
Tom Teichler
Browse files
Options
Downloads
Patches
Plain Diff
Add MyInvoicesListView
parent
5a806de1
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/apps/tezor/templates/tezor/invoice/list.html
+13
-0
13 additions, 0 deletions
aleksis/apps/tezor/templates/tezor/invoice/list.html
aleksis/apps/tezor/views.py
+13
-0
13 additions, 0 deletions
aleksis/apps/tezor/views.py
with
26 additions
and
0 deletions
aleksis/apps/tezor/templates/tezor/invoice/list.html
0 → 100644
+
13
−
0
View file @
a823176b
{% extends "core/base.html" %}
{% load material_form i18n %}
{% load render_table from django_tables2 %}
{% block page_title %}{% blocktrans %}My invoices{% endblocktrans %}{% endblock %}
{% block browser_title %}{% blocktrans %}My invoices{% endblocktrans %}{% endblock %}
{% block content %}
{% render_table table %}
{% endblock %}
This diff is collapsed.
Click to expand it.
aleksis/apps/tezor/views.py
+
13
−
0
View file @
a823176b
...
...
@@ -234,3 +234,16 @@ class SendInvoiceEmail(PermissionRequiredMixin, View):
url
=
Invoice
.
objects
.
get
(
token
=
token
).
get_absolute_url
()
return
redirect
(
url
)
class
MyInvoicesListView
(
PermissionRequiredMixin
,
SingleTableView
):
"""
Table of all invoices belonging to a user.
"""
model
=
Invoice
table_class
=
InvoicesTable
permission_required
=
"
tezor.view_invoices_rule
"
template_name
=
"
tezor/invoice/list.html
"
def
get_queryset
(
self
,
request
,
*
args
,
**
kwargs
):
invoices
=
self
.
model
.
objects
.
filter
(
person
=
request
.
user
.
person
)
return
invoices
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