diff --git a/app.py b/app.py index f471fb2..c30f59b 100644 --- a/app.py +++ b/app.py @@ -25,6 +25,47 @@ def homepage(): return flask.render_template('home.html') +# SEARCH RESULTS + +@app.route('/search') +def searchpage(): + + db = openbook() + + searchargs = flask.request.args['q'] + + searchresult = db.execute(''' + select + 'song', id, name + from + song + where + name + like + '%' || ? || '%' + union all + select + 'album', id, name + from + album + where + name + like + '%' || ? || '%' + ''', + (searchargs,searchargs) + ).fetchall() + + return flask.render_template('', + album_info=album_info, + song_info=song_info + ) + + + + + + # SONG INDEX @app.route('/song') @@ -87,7 +128,7 @@ def motifindex(): group by category.id, category.name order by - count(category.id) desc + category.id ''').fetchall() motif_info = db.execute(''' @@ -102,7 +143,7 @@ def motifindex(): group by id, name, category order by - id + clip.song_id ''').fetchall() return flask.render_template('motifindex.html', @@ -270,8 +311,7 @@ def songpage(id): where song_id = ? order by - feature desc, - song_id + start_ms ''', (id,) ).fetchall() diff --git a/reference.ods b/reference.ods index d3a7883..d30978e 100644 Binary files a/reference.ods and b/reference.ods differ diff --git a/reference_clips.ods b/reference_clips.ods index 9070e7b..0a4056f 100644 Binary files a/reference_clips.ods and b/reference_clips.ods differ diff --git a/static/style.css b/static/style.css index 025d43b..0db7e12 100644 --- a/static/style.css +++ b/static/style.css @@ -153,7 +153,7 @@ a{ background: lch(25% 40 45); display: flex; flex: auto; - justify-content: right; + justify-content: center; } .motif-box span{ @@ -162,10 +162,19 @@ a{ } +.motif-name::before{ + content: "T"; + margin-right: 2rem; + visibility: hidden; +} + .motif-name{ + text-align: center; margin: auto; } .motif-count{ - + position: absolute, right; + text-align: right; + width: 2rem; } \ No newline at end of file diff --git a/templates/base.html b/templates/base.html index 0d6ab30..2119cb2 100644 --- a/templates/base.html +++ b/templates/base.html @@ -7,6 +7,7 @@ +
diff --git a/templates/footer.html b/templates/footer.html index c510daa..4e3b3b0 100644 --- a/templates/footer.html +++ b/templates/footer.html @@ -1,9 +1,5 @@ -{% block footer %} - - -{% endblock footer %} \ No newline at end of file + \ No newline at end of file diff --git a/templates/nav.html b/templates/nav.html index f9dcd70..1e1162e 100644 --- a/templates/nav.html +++ b/templates/nav.html @@ -1,5 +1,3 @@ -{% block navheader %} -