Skip to content
Snippets Groups Projects
Commit 0cb5f24b authored by aebopp's avatar aebopp
Browse files

index

parent 6d9a54a6
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -6,7 +6,15 @@ SECRET_KEY = b'''\xf4\xb2\x9f\x80\xb1\xef\x01\xc6\x10
\xca\xdd\x84\xd4\xf3\x0c\x95\xad\xa6\xdc\xaf\xd3\xbeI\xf7'''
SESSION_COOKIE_NAME = 'login'
IMAGES_FOLDER = os.path.join(
os.path.dirname(os.path.dirname(os.path.realpath(__file__))),
'var', 'images'
)
ALLOWED_EXTENSIONS = set(['png', 'jpg', 'jpeg', 'gif'])
MAX_CONTENT_LENGTH = 16 * 1024 * 1024
DATABASE_FILENAME = os.path.join(
os.path.dirname(os.path.dirname(os.path.realpath(__file__))),
'var', 'servicePoints.sqlite3'
)
......@@ -8,9 +8,31 @@
<p>Hours: {{hours}}</p>
<a href="/accounts/logout/">logout</a>
<a href="/accounts/delete/">delete</a>
<a href="/accounts/mask/">mask</a>
<p>
<a href="/accounts/mask/">
<img src=/images/mask.png alt="mask">
</a>
<a href="/accounts/mask/">
<img src=/images/blood.png alt="mask">
</a>
<a href="/accounts/mask/">
<img src=/images/food.png alt="mask">
</a>
<a href="/accounts/mask/">
<img src=/images/tutor.png alt="mask">
</a>
<a href="/accounts/mask/">
<img src=/images/submit.png alt="mask">
</a>
{% if leader == 1 %}
<p>leader!</p>
<a href="/accounts/mask/">
<img src=/images/view.png alt="mask">
</a>
<a href="/accounts/mask/">
<img src=/images/requests.png alt="mask">
</a>
{% endif %}
</p>
</head>
</html>
No preview for this file type
......@@ -241,3 +241,9 @@ def mask():
context = {}
return render_template('mask.html', **context)
@servicePoints.app.route('/images/<path:filename>', methods=['GET', 'POST'])
def images(filename):
if "username" in flask.session:
return flask.send_from_directory(
servicePoints.app.config['IMAGES_FOLDER'], filename, as_attachment=True)
return flask.redirect(flask.url_for('login'))
var/images/blood.png

73.9 KiB

var/images/food.png

95.4 KiB

var/images/mask.png

26.2 KiB

var/images/requests.png

54.7 KiB

var/images/submit.png

71.3 KiB

var/images/tutor.png

59.6 KiB

var/images/view.png

37.3 KiB

No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment