From 8c16887b7d96c3bd35ed7cc457049cdc61f016cc Mon Sep 17 00:00:00 2001 From: Shgck Date: Fri, 26 Feb 2016 17:31:04 +0100 Subject: [PATCH] Split main artist roster and side projects --- label/models.py | 3 +++ label/templates/label/artists.html | 39 +++++++++++++++++++++--------- static/css/artists.css | 18 ++++++++------ 3 files changed, 42 insertions(+), 18 deletions(-) diff --git a/label/models.py b/label/models.py index ee20b69..fd9aa9d 100644 --- a/label/models.py +++ b/label/models.py @@ -4,6 +4,8 @@ from django.dispatch.dispatcher import receiver from django.template.defaultfilters import slugify +ART_TYPES_HINT = "main roster (0), side project (1)" + class Artist(models.Model): """ An Artist of the label. """ @@ -14,6 +16,7 @@ class Artist(models.Model): url_soundcloud = models.URLField(blank = True) genre = models.CharField(max_length = 256) description = models.TextField(blank = True) + artist_type = models.IntegerField(default = 0, help_text = ART_TYPES_HINT) def __str__(self): return self.name diff --git a/label/templates/label/artists.html b/label/templates/label/artists.html index 44baef8..9df4f1c 100644 --- a/label/templates/label/artists.html +++ b/label/templates/label/artists.html @@ -9,17 +9,34 @@ {% block content %} -

-{% for artist in artists %} - - -
- {{ artist.name }} - {{ artist.genre }} -
-
-{% endfor %} +

Artists

+

+ {% for artist in artists %} + {% if artist.artist_type == 0 %} + + +
+ {{ artist.name }} + {{ artist.genre }} +
+
+ {% endif %} + {% endfor %} +

-

+

Side projects

+

+ {% for artist in artists %} + {% if artist.artist_type == 1 %} + + +
+ {{ artist.name }} + {{ artist.genre }} +
+
+ {% endif %} + {% endfor %} +

{% endblock %} diff --git a/static/css/artists.css b/static/css/artists.css index 5f9e6f9..738cec2 100644 --- a/static/css/artists.css +++ b/static/css/artists.css @@ -1,17 +1,21 @@ -#artists { +#content h1 { + text-align: center; +} + +.artists { width: 700px; margin: auto; text-align: center; } -#artists .artist { +.artists .artist { width: 120px; position: relative; margin: 5px; display: inline-block; } -#artists .artist a { +.artists .artist a { color: #929292; text-decoration: none; transition: .5s; @@ -21,14 +25,14 @@ -webkit-transition: .5s; } -#artists .artist img { +.artists .artist img { height: 120px; width: 120px; border: none; border-radius: 5px; } -#artists .artist-genre { +.artists .artist-genre { height: 120px; width: 120px; position:absolute; @@ -38,7 +42,7 @@ display: flex; align-items: center; justify-content: center; - background-color: rgba(0, 0, 0, 0.5); + background-color: rgba(0, 0, 0, 0.6); border-radius: 5px; color: white; opacity: 0; @@ -46,6 +50,6 @@ -webkit-transition: all 0.7s ease; } -#artists .artist-genre:hover { +.artists .artist-genre:hover { opacity: 1; }