Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
TedImg - img.tedomum.net
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
3
Issues
3
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TeDomum
TedImg - img.tedomum.net
Commits
d0eb009e
Commit
d0eb009e
authored
Jun 09, 2018
by
kaiyou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use url_for properly across the application
parent
62b1a187
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
5 deletions
+4
-5
tedimg/images.py
tedimg/images.py
+2
-2
tedimg/templates/index.html
tedimg/templates/index.html
+1
-1
tedimg/templates/show.html
tedimg/templates/show.html
+0
-1
tedimg/views.py
tedimg/views.py
+1
-1
No files found.
tedimg/images.py
View file @
d0eb009e
...
...
@@ -12,8 +12,8 @@ def get_image(root, name):
""" Try and get basic image attributes.
"""
filename
=
urllib
.
parse
.
quote
(
os
.
path
.
basename
(
name
))
return
(
root
+
os
.
path
.
join
(
app
.
config
[
"FULL_WEB"
],
filename
),
root
+
os
.
path
.
join
(
app
.
config
[
"THUMB_WEB"
],
filename
))
return
(
os
.
path
.
join
(
root
,
app
.
config
[
"FULL_WEB"
],
filename
),
os
.
path
.
join
(
root
,
app
.
config
[
"THUMB_WEB"
],
filename
))
def
image_from_file
(
file_storage
):
...
...
tedimg/templates/index.html
View file @
d0eb009e
...
...
@@ -2,7 +2,7 @@
{% block banner_content %}
<h1
class=
"header center orange-text"
>
Upload your image!
</h1>
<form
method=
"post"
id=
"upload"
action=
"
/upload
"
enctype=
"multipart/form-data"
>
<form
method=
"post"
id=
"upload"
action=
"
{{ url_for('upload') }}
"
enctype=
"multipart/form-data"
>
<div
class=
"file-field input-field"
>
<div>
<i
class=
"material-icons left small"
>
publish
</i>
...
...
tedimg/templates/show.html
View file @
d0eb009e
...
...
@@ -11,7 +11,6 @@
</div>
{% endblock %}
{% block section_content %}
<div
class=
"row"
>
<div
class=
"col s6"
>
...
...
tedimg/views.py
View file @
d0eb009e
...
...
@@ -37,4 +37,4 @@ def upload():
return
flask
.
render_template
(
"error.html"
,
message
=
"Could not store your image."
)
# Save the image to a local file
result
=
images
.
save_with_thumbnail
(
image
,
filename
)
return
flask
.
redirect
(
"/show/"
+
result
)
return
flask
.
redirect
(
flask
.
url_for
(
"show"
,
path
=
result
)
)
Write
Preview
Markdown
is supported
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