Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cmt120-2
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Felix Chadwick-Smith
cmt120-2
Commits
b8910316
Commit
b8910316
authored
1 year ago
by
Felix Chadwick-Smith
Browse files
Options
Downloads
Patches
Plain Diff
Added correct href attributes for assessment download links on the portfolio page.
parent
975a4490
No related branches found
No related tags found
1 merge request
!19
Added correct href attributes for assessment download links on the portfolio page.
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
my_flask_app.py
+5
-3
5 additions, 3 deletions
my_flask_app.py
templates/portfolio.html
+14
-16
14 additions, 16 deletions
templates/portfolio.html
with
19 additions
and
19 deletions
my_flask_app.py
+
5
−
3
View file @
b8910316
import
os
import
os
import
secrets
import
secrets
from
flask
import
Flask
,
render_template
,
request
,
redirect
,
url_for
,
send_from_directory
,
abort
from
flask
import
Flask
,
render_template
,
request
,
redirect
,
url_for
,
send_from_directory
,
abort
,
current_app
from
flask_sqlalchemy
import
SQLAlchemy
from
flask_sqlalchemy
import
SQLAlchemy
from
models
import
db
,
Project
from
models
import
db
,
Project
app
=
Flask
(
__name__
,
static_folder
=
'
static
'
)
app
=
Flask
(
__name__
,
static_folder
=
'
static
'
)
app
.
config
[
'
SEND_FILE_MAX_AGE_DEFAULT
'
]
=
0
app
.
config
[
'
SEND_FILE_MAX_AGE_DEFAULT
'
]
=
0
app
.
config
[
'
SQLALCHEMY_DATABASE_URI
'
]
=
'
sqlite:///
'
+
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
instance/site.db
'
))
app
.
config
[
'
SQLALCHEMY_DATABASE_URI
'
]
=
'
sqlite:///
'
+
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
instance/site.db
'
))
...
@@ -83,8 +84,9 @@ def download_assessment(filename):
...
@@ -83,8 +84,9 @@ def download_assessment(filename):
abort
(
404
)
# Return a 404 Not Found error
abort
(
404
)
# Return a 404 Not Found error
except
Exception
as
e
:
except
Exception
as
e
:
print
(
f
"
Error serving assessment file:
{
str
(
e
)
}
"
)
print
(
f
"
Error serving assessment file:
{
str
(
e
)
}
"
)
app
.
logger
.
exception
(
f
"
Error serving assessment file:
{
str
(
e
)
}
"
)
current_app
.
logger
.
exception
(
f
"
Error serving assessment file:
{
str
(
e
)
}
"
)
abort
(
500
)
abort
(
500
)
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
with
app
.
app_context
():
with
app
.
app_context
():
...
...
This diff is collapsed.
Click to expand it.
templates/portfolio.html
+
14
−
16
View file @
b8910316
...
@@ -32,22 +32,20 @@
...
@@ -32,22 +32,20 @@
<li><a
href=
"{{ url_for('contact') }}"
>
Contact
</a></li>
<li><a
href=
"{{ url_for('contact') }}"
>
Contact
</a></li>
</ul>
</ul>
</nav>
</nav>
<div
id=
"portfolio"
>
<div
id=
"portfolio"
class=
"container"
>
<div
class=
"container"
>
<h1
class=
"sub-title"
>
Portfolio
</h1>
<h1
class=
"sub-title"
>
Portfolio
</h1>
<div
class=
"cute-text-box"
>
<div
class=
"cute-text-box"
>
<p>
Welcome to my portfolio page! Here are some of my assessments for you to download:
</p>
<p>
Welcome to my portfolio page! Here are some of my assessments for you to download:
</p>
<p>
Feel free to submit any questions you may have regarding my work on my Contact page.
</p>
<p>
Feel free to submit any questions you may have regarding my work on my Contact page.
</p>
</div>
</div>
<div
class=
"assessment-links"
>
<div
class=
"assessment-links"
>
<ul>
<ul>
<li><a
href=
"{{ url_for('download_assessment', filename='c2051326_py.PDF') }}"
target=
"_blank"
>
CMT120 1a - PDF
</a></li>
<li><a
href=
"{{ url_for('download_assessment', filename='c2051326_py.PDF') }}"
target=
"_blank"
>
CMT120 1a - PDF
</a></li>
<li><a
href=
"{{ url_for('download_assessment', filename='c2051326_js.PDF') }}"
target=
"_blank"
>
CMT120 1b - PDF
</a></li>
<li><a
href=
"{{ url_for('download_assessment', filename='c2051326_js.PDF') }}"
target=
"_blank"
>
CMT120 1b - PDF
</a></li>
<li><a
href=
"{{ url_for('download_assessment', filename='Team_12_Assessment_1.pptx') }}"
target=
"_blank"
>
CMT313 1a
</a></li>
<li><a
href=
"{{ url_for('download_assessment', filename='Team_12 Assessment_1.pptx') }}"
target=
"_blank"
>
CMT313 1a
</a></li>
<li><a
href=
"{{ url_for('download_assessment', filename='Risk_Register.PDF') }}"
target=
"_blank"
>
CMT313 1b - PDF
</a></li>
<li><a
href=
"{{ url_for('download_assessment', filename='Risk_Register.PDF') }}"
target=
"_blank"
>
CMT313 1b - PDF
</a></li>
<li><a
href=
"{{ url_for('download_assessment', filename='User_Case_diagram.PDF') }}"
target=
"_blank"
>
CMT313 1c - PDF
</a></li>
<li><a
href=
"{{ url_for('download_assessment', filename='User_Case _diagram.PDF') }}"
target=
"_blank"
>
CMT313 1c - PDF
</a></li>
</ul>
</ul>
</div>
</div>
</div>
<a
href=
"{{ url_for('download_cv') }}"
class=
"btn btn2"
download=
"my-cv.docx"
>
Download CV
</a>
<a
href=
"{{ url_for('download_cv') }}"
class=
"btn btn2"
download=
"my-cv.docx"
>
Download CV
</a>
</div>
</div>
...
...
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