1
0
Fork 0

remove a bunch of pages

This commit is contained in:
Adrien Abraham 2023-09-14 22:38:52 +02:00
parent 97658ea726
commit b904496673
13 changed files with 5 additions and 494 deletions

View file

@ -5,7 +5,6 @@ from django.urls import path
from idre.views import about_view from idre.views import about_view
import label.urls import label.urls
import news.urls
admin.autodiscover() admin.autodiscover()
@ -14,15 +13,9 @@ admin.autodiscover()
urlpatterns = [ urlpatterns = [
path("about/", about_view, name="about"), path("about/", about_view, name="about"),
path("admin/", admin.site.urls), path("admin/", admin.site.urls),
*news.urls.urlpatterns,
*label.urls.urlpatterns, *label.urls.urlpatterns,
] ]
# [ url(r"^about/$", idre.views.about_view, name="about") ] +
# label.urls.urlpatterns +
# news.urls.urlpatterns +
# [ url(r"^admin/", include(admin.site.urls)) ]
if settings.DEBUG: if settings.DEBUG:
urlpatterns += static( urlpatterns += static(

View file

@ -1,56 +0,0 @@
#content {
text-align: center;
}
.logo {
max-width: 300px;
max-height: 300px;
border-radius: 5px;
background-color: white;
}
.minilogo {
width: 16px;
height: 16px;
}
#infos {
margin: auto;
}
#infos #left, #infos #right {
width: 50%;
padding: 10px;
vertical-align: top;
}
#infos #left {
text-align: right;
}
#infos #right {
text-align: left;
}
#releases {
/*margin: auto;*/
}
#releases td {
padding-left: 10px;
padding-right: 10px;
}
.release {
/*-o-transition: .5s;*/
/*-ms-transition: .5s;*/
/*-moz-transition: .5s;*/
/*-webkit-transition: .5s;*/
/*transition: .5s;*/
}

View file

@ -1,73 +0,0 @@
#content {
text-align: center;
}
#content > h1 {
margin-bottom: 0;
}
#content > p {
margin-top: 0;
}
.artists {
width: 700px;
margin: auto;
}
.artists .artist {
width: 160px;
position: relative;
margin: 5px;
display: inline-block;
line-height: 1.5em;
}
.artists .artist a {
color: #929292;
text-decoration: none;
transition: 0.3s;
}
@keyframes logoslide {
0% { background-position: 0%; }
33% { background-position: 100%; }
66% { background-position: 100%; }
100% { background-position: 0%; }
}
.artists .artist .logo {
height: 160px;
width: 160px;
background-color: white;
background-size: auto 100%;
background-position: 0%;
border: none;
border-radius: 5px;
}
.artists .artist-genre {
display: flex;
align-items: end;
position: absolute;
top: 0px;
left: 0px;
height: 150px;
width: 150px;
padding: 5px;
justify-content: center;
background-image: linear-gradient(rgba(0, 0, 0, 0) 65%, rgba(0, 0, 0, 0.6));
border-radius: 5px;
color: white;
opacity: 0;
transition: 0.3s;
pointer-events: none;
}
.artists .artist .logo:hover {
animation: logoslide 3s;
}
.artists .artist .logo:hover ~ .artist-genre {
opacity: 1;
}

View file

@ -1,35 +0,0 @@
#content {
text-align: center;
}
.logo {
max-width: 300px;
max-height: 300px;
border-radius: 5px;
}
.minilogo {
width: 16px;
height: 16px;
}
#infos {
margin: auto;
}
#infos #left,
#infos #right {
width: 50%;
padding: 10px;
vertical-align: top;
}
#infos #left {
text-align: right;
}
#infos #right {
text-align: left;
}

View file

@ -1,39 +0,0 @@
#content {
display: flex;
flex-direction: column;
width: 100%;
}
.release {
display: flex;
align-items: top;
margin-bottom: 20px;
height: 120px;
transition: height .5s ease-in-out;
}
.release:hover {
height: 300px;
}
.release .cover {
flex-shrink: 0;
width: 300px;
background-size: cover;
cursor: pointer;
}
.release .infos {
margin-top: 10px;
margin-left: 10px;
}
.release .infos p {
margin: 0;
}
.release .infos .title {
width: 100%;
font-weight: bold;
font-size: 1.4em;
}

View file

@ -1,11 +0,0 @@
#content {
text-align: center;
}
.video h2 {
margin-bottom: 0;
}
.video .embed {
margin: 1em;
}

View file

@ -1,84 +0,0 @@
{% extends "base.html" %}
{% load static %}
{% block stylesheets %}
<link rel="stylesheet" href="{% static 'label/css/artist.css' %}" />
{% endblock %}
{% block content %}
<h1>{{ artist.name }}</h1>
<table id="infos"><tr>
<td id="left">
<p>
<img src="{{ MEDIA_URL }}{{ artist.image }}"
alt="{{ artist.name }}"
class="logo" />
</p>
</td>
<td id="right">
{% if artist.url_bandcamp or artist.url_soundcloud %}
<p>
{% if artist.url_bandcamp %}
<a href="{{ artist.url_bandcamp }}">
<img src="{% static 'img/bandcamp_logo.png' %}"
alt=""
class="minilogo grayscale" />
bandcamp
</a>
<br />
{% endif %}
{% if artist.url_soundcloud %}
<a href="{{ artist.url_soundcloud }}">
<img src="{% static 'img/soundcloud_logo.png' %}"
alt=""
class="minilogo grayscale" />
soundcloud
</a>
{% endif %}
</p>
{% endif %}
{% if artist.genre %}
<p>{{ artist.name }} plays {{ artist.genre }}.</p>
{% endif %}
{% if artist.description %}
{% autoescape off %}
{{ artist.description }}
{% endautoescape %}
{% endif %}
{% if releases %}
<table id="releases">
{% for release in releases %}
<tr class="release">
<td>
{{ release.year }}
</td>
<td>
<a href="{% url 'release' release.tag|lower %}">{{ release.title }}</a>
{% if release.release_type == 1 %}(EP){% endif %}
{% if release.release_type == 2 %}(Split){% endif %}
{% if release.release_type == 3 %}(Demo){% endif %}
</td>
</tr>
{% endfor %}
</table>
{% endif %}
</td>
</tr></table>
{% endblock %}

View file

@ -1,53 +0,0 @@
{% extends "base.html" %}
{% load static %}
{% block stylesheets %}
<link rel="stylesheet" href="{% static 'label/css/artists.css' %}" />
{% endblock %}
{% block content %}
<h1>Core</h1>
<div class="artists">
{% for artist in artists %}
{% if artist.artist_type == 0 %}
<a href="{% url 'artist' artist.slug %}">
<span class="artist">
<div
class="logo"
style="background-image: url('{{ MEDIA_URL }}{{ artist.image }}');"
>
</div>
{{ artist.name }}
<span class="artist-genre">{{ artist.genre }}</span>
</span>
</a>
{% endif %}
{% endfor %}
</div>
<h1>Miscellaneous</h1>
<p>Side projects, one-off collabs, acts of the past, shameless shitposting</p>
<div class="artists">
{% for artist in artists %}
{% if artist.artist_type == 1 %}
<a href="{% url 'artist' artist.slug %}">
<span class="artist">
<div
class="logo"
style="background-image: url('{{ MEDIA_URL }}{{ artist.image }}');"
>
</div>
{{ artist.name }}
<span class="artist-genre">{{ artist.genre }}</span>
</span>
</a>
{% endif %}
{% endfor %}
</div>
{% endblock %}

View file

@ -1,68 +0,0 @@
{% extends "base.html" %}
{% load static %}
{% block stylesheets %}
<link rel="stylesheet" href="{% static 'label/css/release.css' %}" />
{% endblock %}
{% block content %}
<h1>
{% for contrib in contribs %}
{{ contrib.name }}
{% if not forloop.last %} &amp; {% endif %}
{% endfor %}
- {{ release.title }} ({{ release.year }})
</h1>
{% if release.description %}
<table id="infos"><tr>
<td id="left">
{% if release.embed %}
{% autoescape off %}
{{ release.embed }}
{% endautoescape %}
{% else %}
<p>
<img src="{{ MEDIA_URL }}{{ release.cover }}"
alt="{{ release.title }}"
class="logo" />
</p>
{% endif %}
</td>
<td id="right">
{% if release.description %}
{% autoescape off %}
{{ release.description }}
{% endautoescape %}
{% endif %}
</td>
</tr></table>
{% else %}
{% if release.embed %}
{% autoescape off %}
{{ release.embed }}
{% endautoescape %}
{% else %}
<p>
<img src="{{ MEDIA_URL }}{{ release.cover }}"
alt="{{ release.title }}"
class="logo" />
</p>
{% endif %}
{% endif %}
{% endblock %}

View file

@ -1,25 +0,0 @@
{% extends "base.html" %}
{% load static %}
{% block stylesheets %}
<link rel="stylesheet" href="{% static 'label/css/videos.css' %}" />
{% endblock %}
{% block content %}
{% for video in videos %}
<div class="video">
<h2>{{ video.artist }} - {{ video.title }}</h2>
<div class="subtitle">{{ video.year }}</div>
<div class="embed">
{% autoescape off %}
{{ video.embed }}
{% endautoescape %}
</div>
</div>
{% if not forloop.last %}
<hr class="grey-line" />
{% endif %}
{% endfor %}
{% endblock %}

View file

@ -4,9 +4,5 @@ from label import views
urlpatterns = [ urlpatterns = [
url(r'^artists/$', views.artists_view, name='artists'), url(r'^(?:releases/)?$', views.releases_view, name='releases'),
url(r'^artists/(?P<slug>\S+)$', views.artist_view, name='artist'),
url(r'^releases/$', views.releases_view, name='releases'),
url(r'^releases/(?P<tag>\S+)$', views.release_view, name='release'),
url(r'^videos/$', views.videos_view, name='videos'),
] ]

View file

@ -1,34 +1,14 @@
from django.shortcuts import get_object_or_404, render from django.shortcuts import render
import markdown
from label.models import Artist, Release, VideoClip from label.models import Artist, Release
from label.tools import ( from label.tools import (
get_catalog_tag_from_id, get_catalog_tag_from_id,
get_contribs, get_contribs,
get_id_from_catalog_tag,
) )
def artists_view(request):
artists = Artist.objects.all()
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)
releases = artist.release_set.all()
for release in releases:
release.tag = get_catalog_tag_from_id(release.ident)
context = {'artist': artist, 'releases': releases}
return render(request, 'label/artist.html', context)
def releases_view(request): def releases_view(request):
artists = Artist.objects.all() Artist.objects.all()
releases = Release.objects.filter(released=True) releases = Release.objects.filter(released=True)
releases_and_infos = [] releases_and_infos = []
@ -47,17 +27,3 @@ def releases_view(request):
context = {'releases': releases_and_infos} context = {'releases': releases_and_infos}
return render(request, 'label/releases.html', context) return render(request, 'label/releases.html', context)
def release_view(request, tag):
ident = get_id_from_catalog_tag(tag)
release = get_object_or_404(Release, ident=ident, released=True)
contribs = get_contribs(release.contributors.all())
context = {'release': release, 'contribs': contribs}
return render(request, 'label/release.html', context)
def videos_view(request):
videos = VideoClip.objects.order_by('-year', 'title')
context = {'videos': videos}
return render(request, 'label/videos.html', context)

View file

@ -4,5 +4,5 @@ import news.views
urlpatterns = [ urlpatterns = [
url(r"^(?:news/)?$", news.views.articles_view, name = "news"), # url(r"^(?:news/)?$", news.views.articles_view, name = "news"),
] ]