Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
desd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
kj2-drupisz
desd
Commits
ad89093b
Commit
ad89093b
authored
1 year ago
by
Brody Wilton
Committed by
Brody Wilton
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Implement basic version of report generation
parent
c2c7725a
No related branches found
No related tags found
1 merge request
!16
update requirements txt to include library for pdf creation, comment out...
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
myproject/myapp/templates/user_page.html
+2
-0
2 additions, 0 deletions
myproject/myapp/templates/user_page.html
myproject/myapp/urls.py
+3
-1
3 additions, 1 deletion
myproject/myapp/urls.py
myproject/myapp/views.py
+12
-0
12 additions, 0 deletions
myproject/myapp/views.py
with
17 additions
and
1 deletion
myproject/myapp/templates/user_page.html
+
2
−
0
View file @
ad89093b
...
...
@@ -232,12 +232,14 @@
required
/>
</div>
<a
href=
"{% url 'generate_pdf' %}"
<
button
type=
"submit"
class=
"p-2 bg-blue-500 text-white rounded-md hover:bg-blue-600"
>
Download Financial Statement
</button>
</a>
</form>
{% comment %} REPLACE WITH LOGIC TO CHECK PROPER USER {% endcomment %}
</div>
...
...
This diff is collapsed.
Click to expand it.
myproject/myapp/urls.py
+
3
−
1
View file @
ad89093b
...
...
@@ -12,6 +12,7 @@ from .views import handling_music_file
from
.views
import
pricing
from
.views
import
generate_pdf
urlpatterns
=
[
# path('', index, name='index'), <- uncomment when index/main page will be ready
...
...
@@ -26,5 +27,6 @@ urlpatterns = [
path
(
'
pricay_policy/
'
,
privacy_policy
,
name
=
'
privacy_policy
'
),
path
(
'
pricing/
'
,
pricing
,
name
=
'
pricing
'
),
path
(
'
uploading_file/
'
,
handling_music_file
,
name
=
'
uploading_file
'
),
,
path
(
'
generate_pdf/
'
,
generate_pdf
,
name
=
'
generate_pdf
'
)
]
This diff is collapsed.
Click to expand it.
myproject/myapp/views.py
+
12
−
0
View file @
ad89093b
...
...
@@ -80,3 +80,15 @@ def privacy_policy(request):
def
pricing
(
request
):
return
render
(
request
,
'
pricing.html
'
)
#For testing the receipts ONLY. TODO: delete when working
def
generate_pdf
(
request
):
response
=
HttpResponse
(
content_type
=
'
application/pdf
'
)
response
[
'
Content-Disposition
'
]
=
'
attachment; filename=
"
example.pdf
"'
p
=
canvas
.
Canvas
(
response
)
p
.
drawString
(
100
,
800
,
"
Hello, this is a PDF!
"
)
p
.
showPage
()
p
.
save
()
return
response
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