1
0
Fork 0

releases: handle bandcamp page

This commit is contained in:
Adrien Abraham 2023-09-14 22:34:18 +02:00
parent 7f4c961685
commit 97658ea726
9 changed files with 53 additions and 4 deletions

6
.gitignore vendored
View file

@ -1,4 +1,4 @@
__pycache__/
idre/settings.py
static/
media/
/idre/settings.py
/static/
/media/

View file

@ -72,6 +72,7 @@ body {
.release-infos .title {
margin: 0;
font-size: 1.5em;
line-height: 1.1em;
}
.release-infos .contributors,
@ -109,6 +110,22 @@ body {
.release-infos .extras {
font-size: 1.4em;
}
.release-links {
position: absolute;
bottom: -1.5em;
height: 3em;
width: 100%;
display: flex;
justify-content: center;
gap: 0.5em;
}
.release-link img {
max-width: 3em;
border: 2px solid white;
border-radius: 0.5em;
}
}
@keyframes fadeColor {

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -0,0 +1,22 @@
# Generated by Django 3.2.21 on 2023-09-14 19:47
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('label', '0006_auto_20220117_1636'),
]
operations = [
migrations.RemoveField(
model_name='release',
name='embed',
),
migrations.AddField(
model_name='release',
name='url_bandcamp',
field=models.URLField(blank=True),
),
]

View file

@ -46,6 +46,7 @@ class Release(models.Model):
year: year of release
cover: image file associated to this release
released: show this release publicly
url_bandcamp: link to the release
"""
TYPE_HINT = 'full-length (0), EP (1), Split (2), Démo (3)'
@ -57,9 +58,9 @@ class Release(models.Model):
release_type = models.IntegerField(default=0, help_text=TYPE_HINT)
cover = models.ImageField(upload_to='releases')
year = models.IntegerField()
embed = models.TextField(blank=True, help_text=EMBED_HINT)
description = models.TextField(blank=True)
released = models.BooleanField(default=False)
url_bandcamp = models.URLField(blank=True)
def __str__(self):
return self.title

View file

@ -27,6 +27,14 @@
{{ release.tag }} — {{ release.year }}
</p>
</div>
<div class="release-links">
{% if release.url_bandcamp %}
<a href="{{ release.url_bandcamp }}" class="release-link">
<img src="{% static 'img/bandcamp-button-square-aqua-128.png' %}" alt="Bandcamp logo">
</a>
{% endif %}
</div>
</div>
</div>

View file

@ -42,6 +42,7 @@ def releases_view(request):
'contribs': get_contribs(release.contributors.all()),
'year': release.year,
'cover': release.cover,
'url_bandcamp': release.url_bandcamp,
})
context = {'releases': releases_and_infos}