1
0
Fork 0

Split main artist roster and side projects

This commit is contained in:
Shgck 2016-02-26 17:31:04 +01:00
parent f993498bb4
commit 8c16887b7d
3 changed files with 42 additions and 18 deletions

View file

@ -4,6 +4,8 @@ from django.dispatch.dispatcher import receiver
from django.template.defaultfilters import slugify from django.template.defaultfilters import slugify
ART_TYPES_HINT = "main roster (0), side project (1)"
class Artist(models.Model): class Artist(models.Model):
""" An Artist of the label. """ """ An Artist of the label. """
@ -14,6 +16,7 @@ class Artist(models.Model):
url_soundcloud = models.URLField(blank = True) url_soundcloud = models.URLField(blank = True)
genre = models.CharField(max_length = 256) genre = models.CharField(max_length = 256)
description = models.TextField(blank = True) description = models.TextField(blank = True)
artist_type = models.IntegerField(default = 0, help_text = ART_TYPES_HINT)
def __str__(self): def __str__(self):
return self.name return self.name

View file

@ -9,9 +9,11 @@
{% block content %} {% block content %}
<p id="artists">
{% for artist in artists %} <h1>Artists</h1>
<p class="artists">
{% for artist in artists %}
{% if artist.artist_type == 0 %}
<span class="artist"> <span class="artist">
<a href="{% url 'artist' artist.slug %}"> <a href="{% url 'artist' artist.slug %}">
<img src="{{ MEDIA_URL }}{{ artist.image }}" alt="" /> <br /> <img src="{{ MEDIA_URL }}{{ artist.image }}" alt="" /> <br />
@ -19,7 +21,22 @@
<span class="artist-genre">{{ artist.genre }}</span> <span class="artist-genre">{{ artist.genre }}</span>
</a> </a>
</span> </span>
{% endfor %} {% endif %}
{% endfor %}
</p>
</p> <h1>Side projects</h1>
<p class="artists">
{% for artist in artists %}
{% if artist.artist_type == 1 %}
<span class="artist">
<a href="{% url 'artist' artist.slug %}">
<img src="{{ MEDIA_URL }}{{ artist.image }}" alt="" /> <br />
{{ artist.name }}
<span class="artist-genre">{{ artist.genre }}</span>
</a>
</span>
{% endif %}
{% endfor %}
</p>
{% endblock %} {% endblock %}

View file

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