From 2fa55ba93ee4c6fd00009b1b5f080b8210a74ad8 Mon Sep 17 00:00:00 2001 From: chee Date: Tue, 17 Nov 2020 13:45:46 +0000 Subject: [PATCH] designed for humanity --- app/routes.py | 6 +++++- app/static/cc0.png | 3 +++ app/static/favicon.ico | 3 +++ app/templates/base.html | 2 ++ app/templates/piece.html | 34 ++++++++++++++++++++++++++++++++++ 5 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 app/static/cc0.png create mode 100644 app/static/favicon.ico create mode 100644 app/templates/piece.html diff --git a/app/routes.py b/app/routes.py index a3b6b13..869313d 100644 --- a/app/routes.py +++ b/app/routes.py @@ -19,6 +19,10 @@ def index(): return render_template("index.html", collections=Collection.query.all()) +@app.route('/favicon.ico') +def favicon_ico(): + return redirect("/static/favicon.ico") + @app.route('/.json') def index_json(): s = lambda thing : thing.serialize() @@ -154,7 +158,7 @@ def piece(username, collection_slug, piece_slug): piece = collection.pieces.filter_by(slug=piece_slug).first() if piece is None: return render_404() - return render_template("_piece.html", + return render_template("piece.html", copyright_holder=ch, collection=collection, piece=piece) diff --git a/app/static/cc0.png b/app/static/cc0.png new file mode 100644 index 0000000..89147fe --- /dev/null +++ b/app/static/cc0.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0ca1c82d2c78eb016fa0f16ccc6340007d3f88d2e6d5051f662ec32a630a93b3 +size 138890 diff --git a/app/static/favicon.ico b/app/static/favicon.ico new file mode 100644 index 0000000..89147fe --- /dev/null +++ b/app/static/favicon.ico @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0ca1c82d2c78eb016fa0f16ccc6340007d3f88d2e6d5051f662ec32a630a93b3 +size 138890 diff --git a/app/templates/base.html b/app/templates/base.html index 4633468..7653436 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -1,5 +1,7 @@ + +{% block head %}{% endblock %} {% if collection %} {{collection.name}} — public dump

{{collection.name}}

diff --git a/app/templates/piece.html b/app/templates/piece.html new file mode 100644 index 0000000..8b7c33d --- /dev/null +++ b/app/templates/piece.html @@ -0,0 +1,34 @@ +{% extends "base.html" %} +{% block head %} + + + {% if piece.type.startswith("audio/") %} + + + + + + + + {% elif piece.type.startswith("image/") %} + + + + + + {% elif piece.type.startswith("video/") %} + + + + + + + + {% endif %} + + + +{% endblock %} +{% block content %} + {% include '_piece.html' %} +{% endblock %}