diff --git a/label/static/label/css/releases.css b/label/static/label/css/releases.css index 0dc086d..698621e 100644 --- a/label/static/label/css/releases.css +++ b/label/static/label/css/releases.css @@ -1,18 +1,33 @@ -#releases { - text-align: center; - max-width: 95%; - margin: auto; +#content { + display: flex; + flex-direction: column; + width: 100%; } .release { - /*-o-transition: .5s;*/ - /*-ms-transition: .5s;*/ - /*-moz-transition: .5s;*/ - /*-webkit-transition: .5s;*/ - /*transition: .5s;*/ + display: flex; + align-items: center; + margin-bottom: 20px; } -.release td { - padding-left: 10px; - padding-right: 10px; +.release .cover { + flex-shrink: 0; + height: 120px; + width: 300px; + background-image: url('https://f4.bcbits.com/img/a3032423923_10.jpg'); + background-size: cover; +} + +.release .infos { + margin-left: 10px; +} + +.release .infos p { + margin: 0; +} + +.release .infos .title { + width: 100%; + font-weight: bold; + font-size: 1.4em; } diff --git a/label/templates/label/artist.html b/label/templates/label/artist.html index dfb4d2e..15ee629 100644 --- a/label/templates/label/artist.html +++ b/label/templates/label/artist.html @@ -1,5 +1,4 @@ {% extends "base.html" %} - {% load static %} @@ -12,7 +11,6 @@

{{ artist.name }}

-
diff --git a/label/templates/label/artists.html b/label/templates/label/artists.html index 888a849..ebe0a50 100644 --- a/label/templates/label/artists.html +++ b/label/templates/label/artists.html @@ -1,5 +1,4 @@ {% extends "base.html" %} - {% load static %} @@ -13,15 +12,19 @@

Artists

{% for artist in artists %} - {% if artist.artist_type == 0 %} - - - - {{ artist.name }} - {{ artist.genre }} - - - {% endif %} + {% if artist.artist_type == 0 %} + + + + {{ artist.name }} + {{ artist.genre }} + + + {% endif %} {% endfor %}
diff --git a/label/templates/label/release.html b/label/templates/label/release.html index ec4b779..714b634 100644 --- a/label/templates/label/release.html +++ b/label/templates/label/release.html @@ -1,5 +1,4 @@ {% extends "base.html" %} - {% load static %} diff --git a/label/templates/label/releases.html b/label/templates/label/releases.html index 14374a3..aad3db8 100644 --- a/label/templates/label/releases.html +++ b/label/templates/label/releases.html @@ -1,5 +1,4 @@ {% extends "base.html" %} - {% load static %} @@ -9,32 +8,30 @@ {% block content %} - - {% for release in releases %} - - +
+
+
-
+
+

+ {{ release.title }} + {% if release.release_type == 1 %}(EP){% endif %} + {% if release.release_type == 2 %}(Split){% endif %} + {% if release.release_type == 3 %}(Demo){% endif %} +

+

+ {% for contrib in release.contribs %} + {{ contrib.name }}{% if not forloop.last %},{% endif %} + {% endfor %} +

+

+ {{ release.tag }} - {{ release.year }} +

+
- - - - + {% endfor %} - -
- {{ release.tag }} - - {% for contrib in release.contribs %} - {{ contrib.name }}{% if not forloop.last %},{% endif %} - {% endfor %} - - {{ release.title }} - {% if release.release_type == 1 %}(EP){% endif %} - {% if release.release_type == 2 %}(Split){% endif %} - {% if release.release_type == 3 %}(Demo){% endif %} - - {{ release.year }} -
{% endblock %} diff --git a/label/tools.py b/label/tools.py index 85a5a8c..b58a35b 100644 --- a/label/tools.py +++ b/label/tools.py @@ -1,7 +1,7 @@ - def get_catalog_tag_from_id(ident): return 'IDRE{:0>3d}'.format(ident) + def get_id_from_catalog_tag(tag): try: return int(tag[4:]) diff --git a/label/views.py b/label/views.py index 6d9d4e5..7c4c069 100644 --- a/label/views.py +++ b/label/views.py @@ -10,6 +10,7 @@ def artists_view(request): context = { 'artists': artists } return render(request, 'label/artists.html', context) + def artist_view(request, slug): artist = get_object_or_404(Artist, slug = slug) artist.description = markdown.markdown(artist.description) @@ -21,6 +22,7 @@ def artist_view(request, slug): context = { 'artist': artist, 'releases': releases } return render(request, 'label/artist.html', context) + def releases_view(request): artists = Artist.objects.all() releases = Release.objects.all() @@ -34,12 +36,14 @@ def releases_view(request): 'tag': release_tag, 'title': release.title, 'contribs': tools.get_contribs(release.contributors.all()), - 'year': release.year + 'year': release.year, + 'cover': release.cover, }) context = { 'releases': releases_and_infos } return render(request, 'label/releases.html', context) + def release_view(request, tag): ident = tools.get_id_from_catalog_tag(tag) release = get_object_or_404(Release, ident = ident)