diff --git a/app.py b/app.py index d673423..2268f38 100644 --- a/app.py +++ b/app.py @@ -12,7 +12,7 @@ app = flask.Flask('songbook') # db = openbook() -# return flask.render_template('.html', +# return flask.render_template('.jinja', # ) # HOMEPAGE @@ -25,7 +25,7 @@ def homepage(): - return flask.render_template('home.html') + return flask.render_template('home.jinja') # SEARCH RESULTS @@ -75,7 +75,7 @@ def searchpage(): else: searchresult = [] - return flask.render_template('searchresults.html', + return flask.render_template('searchresults.jinja', searchresult=searchresult ) @@ -116,7 +116,7 @@ def suggestsearchpage(): else: searchresult = [] - return flask.render_template('suggestsearchresults.html', + return flask.render_template('suggestsearchresults.jinja', searchresult=searchresult ) @@ -162,7 +162,7 @@ def songindex(): track ''').fetchall() - return flask.render_template('songindex.html', + return flask.render_template('songindex.jinja', album_info=album_info, song_info=song_info ) @@ -208,7 +208,7 @@ def motifindex(): min(clip.song_id) ''').fetchall() - return flask.render_template('motifindex.html', + return flask.render_template('motifindex.jinja', category_info = category_info, motif_info = motif_info ) @@ -246,7 +246,7 @@ def albumpage(id): (id,) ).fetchall() - return flask.render_template('album.html', + return flask.render_template('album.jinja', album_info=album_info, song_info=song_info ) @@ -312,7 +312,7 @@ def motifpage(id): (id,) ).fetchall() - return flask.render_template('motif.html', + return flask.render_template('motif.jinja', name=name, clip_info=clip_info, album_info=album_info @@ -400,7 +400,7 @@ def songpage(id): (id,) ).fetchall() - return flask.render_template('song.html', + return flask.render_template('song.jinja', song_info=song_info, id=id, album_info=album_info, @@ -411,7 +411,7 @@ def songpage(id): @app.route('/suggest') def suggestpage(): - return flask.render_template('suggest.html', + return flask.render_template('suggest.jinja', ) @app.route('/sent', methods=['POST']) @@ -427,5 +427,11 @@ def sentpage(): flask.request.form['connection-1-id'][:4], flask.request.form['suggest-description'][:10_000], ]) - return flask.render_template('sent.html', + return flask.render_template('sent.jinja', + ) + +@app.route('/credits') +def creditpage(): + + return flask.render_template('credits.jinja', ) \ No newline at end of file diff --git a/build_db.py b/build_db.py index d9dc4c2..e19df0b 100644 --- a/build_db.py +++ b/build_db.py @@ -2,7 +2,11 @@ import sqlite3 import os import pyexcel_odsr -os.remove('songbook.sqlite') +try: + os.remove('songbook.sqlite') +except FileNotFoundError: + pass + db = sqlite3.connect("songbook.sqlite") cur = db.cursor() diff --git a/docker-compose.yaml b/docker-compose.yaml index 9fbc182..1ab052d 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -3,4 +3,4 @@ services: build: . init: true ports: - - "127.0.0.1:5123:8000" + - "127.0.0.1:8000:8000" diff --git a/static/aristide.png b/static/aristide.png new file mode 100644 index 0000000..f2cbdba Binary files /dev/null and b/static/aristide.png differ diff --git a/static/style.css b/static/style.css index eb45939..6772481 100644 --- a/static/style.css +++ b/static/style.css @@ -18,7 +18,7 @@ :root{ --block: lch(20% 0 75); --box: lch(40% 2.5 75); - --back: radial-gradient(lch(20% 0 75), black ); + --back: radial-gradient(lch(10% 0 75) 50%, black ); --search-back: lch(35% 0 75); --thick-border: lch(60% 10 75); --thin-border: lch(60% 10 75); @@ -202,7 +202,7 @@ header{ position: absolute; right: .3rem; bottom: .3rem; - font-size: small; + /* font-size: small; */ margin: 0; color: lch(80% 50 50); } @@ -223,7 +223,7 @@ header{ .home-nav{ display: flex; gap: 1.2rem; - border-style: solid; border-width: 1px; border-color: var(--thin-border); border-left: 0; border-top: 0; border-right: 0; + /* border-style: solid; border-width: 1px; border-color: var(--thin-border); border-left: 0; border-top: 0; border-right: 0; */ margin: 1.2rem; margin-bottom: 0; padding-bottom: 1.2rem; } @@ -232,7 +232,7 @@ header{ display: flex; flex-direction: column; list-style: none; justify-content: center; align-items: center; flex: auto; position: relative; - border-style: outset; border-color: var(--thick-border); border-radius: 1.2rem; + border-style: outset; border-color: var(--thick-border); border-radius: 1.2rem; border-width: 0.3rem; text-decoration: none; background-color: var(--block); padding-top: 1.2rem; padding-bottom: 1.2rem; @@ -350,7 +350,7 @@ main{ background-color: var(--block); max-width: 64rem; width: 100%; - margin-left: auto; margin-right: auto; + margin-left: auto; margin-right: auto; margin-bottom: auto; } main ul{ @@ -365,7 +365,7 @@ footer{ background: linear-gradient(90deg, lch(10% 90 50), lch(35% 90 50) 25%, lch(35% 90 50) 75%, lch(10% 90 50)); width: 100%; padding: 0; - margin-top: auto; + /* margin-top: auto; */ } .footer-content{ @@ -376,7 +376,7 @@ footer{ .footer-content span{ font-size: calc(.7rem + .3vw); - margin-left: 1.2rem; margin-right: 1.2rem; + margin-left: .6rem; margin-right: .6rem; text-align: center; color: lch(90% 25 85); } @@ -698,10 +698,10 @@ footer{ /* SUGGEST PAGE */ .suggestbox{ - display: flex; flex-wrap: wrap; align-items: center; gap: 2.4rem; flex-direction: column; + display: flex; align-items: center; gap: 2.4rem; flex-direction: column; margin-top: 2.4rem; overflow: hidden; - height: 36rem; + height: 48 rem; } .suggestbox h2{ @@ -746,4 +746,34 @@ footer{ .search-number{ display: none; +} + +/* CREDITS */ + +.credit-box{ + display: flex; flex-direction: column; + background: radial-gradient(lch(35% 90 50) 50%, lch(10% 90 50)); + width: 48rem; + margin: auto; + border-style: outset; border-color: var(--thick-border); +} + +.credit-text{ + margin: 1.2rem; margin-bottom: 0; + display: flex; justify-content: space-between; + color: lch(90% 25 85); +} + +.credit-text a{ + text-decoration: underline; + color: lch(90% 25 85); +} + +.credit-text img{ + height: 14.4rem; + border-style: outset; border-color: var(--thick-border); border-radius: 1.2rem; border-width: 0.3rem; +} + +.credit-text p{ + text-align: left; } \ No newline at end of file diff --git a/templates/base.html b/templates/base.jinja similarity index 91% rename from templates/base.html rename to templates/base.jinja index f6ecc97..da52b1b 100644 --- a/templates/base.html +++ b/templates/base.jinja @@ -25,11 +25,11 @@ - {% block nav %}{% include 'nav.html' %}{% endblock %} + {% block nav %}{% include 'nav.jinja' %}{% endblock %} {% block main %}
{% endblock %} {% block content required %}{% endblock %} {% block main2 %}
{% endblock %} - {% block footer %}{% include 'footer.html' %}{% endblock %} + {% block footer %}{% include 'footer.jinja' %}{% endblock %} \ No newline at end of file diff --git a/templates/clipget.html b/templates/clipget.jinja similarity index 100% rename from templates/clipget.html rename to templates/clipget.jinja diff --git a/templates/credits.jinja b/templates/credits.jinja new file mode 100644 index 0000000..c7bbb77 --- /dev/null +++ b/templates/credits.jinja @@ -0,0 +1,36 @@ +{% extends 'base.jinja' %} +{% block title %}Credits{% endblock %} +{% block main %}{% endblock %} + +{% block content %} + +
+
+
+

Developed by Esby

+ + +
+
+ Song Index +
+
+
+
+

Made with

+
    +
  • Jinja, Flask, Python, sqlite, VS Code, Gunicorn, Docker, Caddy, HTMX, sox, pyexcel_odsr, LibreOffice Calc, Audacity
  • +
  • Osar'a Johve - Bismarck ♥
  • +
+

Shout-outs to No Stress and Rainbow Connection

+
+
+ +
+ +{% endblock %} \ No newline at end of file diff --git a/templates/footer.html b/templates/footer.jinja similarity index 83% rename from templates/footer.html rename to templates/footer.jinja index 5d1133a..c4c2695 100644 --- a/templates/footer.html +++ b/templates/footer.jinja @@ -1,6 +1,9 @@