diff --git a/app.py b/app.py index 4da3510..f471fb2 100644 --- a/app.py +++ b/app.py @@ -47,13 +47,17 @@ def songindex(): song_info = db.execute(''' select - song_id, album_id, track, song.name, song.name_jp + song_album.song_id, album_id, track, song.name, song.name_jp, count(clip.song_id) from song_album join song on song_album.song_id=song.id + left join + clip on clip.song_id=song.id + group by + song_album.song_id, album_id, track, song.name, song.name_jp order by album_id, track @@ -73,18 +77,30 @@ def motifindex(): category_info = db.execute(''' select - id, name + category.id, category.name from category + join + motif + on + category.id=motif.category + group by + category.id, category.name order by - id + count(category.id) desc ''').fetchall() motif_info = db.execute(''' select - id, name, category + id, name, category, count(clip.motif_id) from motif + left join + clip + on + clip.motif_id=motif.id + group by + id, name, category order by id ''').fetchall() diff --git a/reference_clips.ods b/reference_clips.ods index 6246d33..9070e7b 100644 Binary files a/reference_clips.ods and b/reference_clips.ods differ diff --git a/static/style.css b/static/style.css index c10a07b..025d43b 100644 --- a/static/style.css +++ b/static/style.css @@ -1,2 +1,171 @@ -body{max-width:50rem;margin-left:auto;margin-right:auto;} -nav{} \ No newline at end of file +/* body{ + max-width:50rem;margin-left:auto;margin-right:auto; +} */ + +body{ + margin: 0; +} + +header{ + background-color: lch(80% 25 79); + margin: 0; + border-style: outset; +} + +.top-buttons{ + display: flex; + padding-left: 0; + margin: 0; + padding: 2rem; + column-gap: 1rem; + +} +.top-buttons li{ + flex: auto; + border-style: outset; + list-style: none; + text-align: center; +} + +.top-buttons li:nth-child(2){ + flex: none; +} + +main{ + background-color: lch(80% 25 79); + max-width: 50rem; + margin-left: auto; + margin-right: auto; +} + +main ul{ + margin: 0; +} + +h1{ + margin: 0; +} + +h2{ + margin: 0; +} + +a{ + text-decoration: none; +} + +.album-list{ + display: flex; + flex-direction: column; + gap: 1rem; +} + +.album-box{ + gap: 1rem; +} + +.album-box h2{ + color: white; + border-style: solid; + border-color: lch(25% 40 45); + margin: 1rem; + margin-bottom: 0px; + position: sticky; + top: 0px; + background: lch(25% 40 45); +} + +.album-box ul{ + display: flex; + flex: auto; + flex-direction: column; + padding-left: 0; +} + +.song-box{ + list-style: none; + min-height: 1.5rem; + margin: 1rem; + margin-bottom: 0; + margin-left: 4rem; + background: lch(25% 40 45); + display: flex; + flex: auto; + flex-wrap: wrap; + justify-content: left; + column-gap: 1rem; + align-content: bottom; + white-space: nowrap; + overflow: hidden; +} + +.song-box span{ + color: white; + text-align: bottom; +} + +.track-name-jp{ + +} + +.clip-count{ + margin-left: auto; + min-width: 2rem; + text-align: right; +} + +.category-list{ + display: flex; + flex-wrap: wrap; + align-content: flex-start; + flex-basis: 51%; + gap: 1rem; +} + +.category-box{ + gap: 1rem; + margin-left: auto; + margin-right: auto; + width: 24rem; +} + +.category-box h2{ + color: white; + border-style: solid; + border-color: lch(25% 40 45); + margin: 1rem; + margin-bottom: 0px; + background: lch(25% 40 45); +} + +.category-box ul{ + display: flex; + flex: initial; + flex-direction: column; + padding-left: 0; +} + +.motif-box{ + list-style: none; + min-height: 1.5rem; + margin: 1rem; + margin-bottom: 0; + background: lch(25% 40 45); + display: flex; + flex: auto; + justify-content: right; +} + +.motif-box span{ + color: white; + vertical-align: middle; + +} + +.motif-name{ + margin: auto; +} + +.motif-count{ + +} \ No newline at end of file diff --git a/templates/album.html b/templates/album.html index 86d0853..52e42b6 100644 --- a/templates/album.html +++ b/templates/album.html @@ -1,4 +1,4 @@ -{% extends "nav.html" %} +{% extends "base.html" %} {% block title %}{{ album_info[0] }}{% endblock %} {% block content %} diff --git a/templates/base.html b/templates/base.html index cf2dc21..0d6ab30 100644 --- a/templates/base.html +++ b/templates/base.html @@ -2,7 +2,7 @@ - {% block title %}{% endblock %} - Eorzea Songbook + {% block title required %}{% endblock %} - Eorzea Songbook @@ -10,7 +10,9 @@ - {% block basecontent %}{% endblock %} + {% block nav %}{% include 'nav.html' %}{% endblock %} +
{% block content required %}{% endblock %}
+ {% block footer %}{% include 'footer.html' %}{% endblock %} diff --git a/templates/footer.html b/templates/footer.html new file mode 100644 index 0000000..c510daa --- /dev/null +++ b/templates/footer.html @@ -0,0 +1,9 @@ +{% block footer %} + + + +{% endblock footer %} \ No newline at end of file diff --git a/templates/home.html b/templates/home.html index bf0111d..ba045b4 100644 --- a/templates/home.html +++ b/templates/home.html @@ -1,7 +1,7 @@ -{% extends "base.html" %} +{% extends 'base.html' %} {% block title %}Home{% endblock %} - -{% block basecontent %} +{% block nav %}{% endblock %} +{% block content %}

The Eorzea Songbook

@@ -9,4 +9,5 @@ View Motifs +{% block footer %}{% endblock %} {% endblock %} \ No newline at end of file diff --git a/templates/motif.html b/templates/motif.html index cb96ad7..c7e065c 100644 --- a/templates/motif.html +++ b/templates/motif.html @@ -1,4 +1,4 @@ -{% extends "nav.html" %} +{% extends "base.html" %} {% block title %}{{ name }}{% endblock %} diff --git a/templates/motifindex.html b/templates/motifindex.html index 119f4f5..d1caf66 100644 --- a/templates/motifindex.html +++ b/templates/motifindex.html @@ -1,22 +1,35 @@ -{% extends "nav.html" %} +{% extends 'base.html' %} {% block title %}Motif Index{% endblock %} {% block content %} - -{% for category_id, name in category_info %} -

{{ name }}

- +
+ {% for category_id, name in category_info %} +
+

{{ name }}

+ +
{% endfor %} -

Misc.

- +
+

Misc.

+ +
+
{% endblock %} \ No newline at end of file diff --git a/templates/nav.html b/templates/nav.html index 131d284..f9dcd70 100644 --- a/templates/nav.html +++ b/templates/nav.html @@ -1,10 +1,8 @@ -{% extends "base.html" %} - -{% block basecontent %} +{% block navheader %}
-{% block content %}{% endblock %} - - - -{% endblock basecontent %} \ No newline at end of file +{% endblock %} \ No newline at end of file diff --git a/templates/song.html b/templates/song.html index 0d3bf7b..eb5288a 100644 --- a/templates/song.html +++ b/templates/song.html @@ -1,4 +1,4 @@ -{% extends "nav.html" %} +{% extends "base.html" %} {% block title %}{{ name }}{% endblock %} {% block content %} @@ -7,7 +7,7 @@ -

Artist:

+

Artist: