Добавил недостающие шаблоны, добавил related_name в моделях, добавил недостающие urls

This commit is contained in:
Viner Abubakirov
2026-01-02 12:58:36 +05:00
parent 8af3cbee92
commit 6231de70ea
15 changed files with 147 additions and 27 deletions

View File

@@ -0,0 +1,11 @@
{% extends "base.html" %}
{% block title %}Album Detail{% endblock %}
{% block content %}
<h1>{{ album.name }}</h1>
<p>Artist: {{ album.artist }}</p>
<p>Release Date: {{ album.release_date }}</p>
<h2>Tracks</h2>
{% include 'components/track_list.html' with tracks=album.tracks.all %}
{% endblock %}

View File

@@ -0,0 +1,7 @@
{% extends "base.html" %}
{% block title %}Album List{% endblock %}
{% block content %}
<h1>Album List</h1>
{% include 'components/album_list.html' with albums=albums %}
{% endblock %}

View File

@@ -0,0 +1,10 @@
{% extends "base.html" %}
{% block title %}Artist Detail{% endblock %}
{% block content %}
<h1>{{ artist.name }}</h1>
<p>Genre: {{ artist.genre }}</p>
<h2>Albums</h2>
{% include 'components/album_list.html' with albums=artist.albums.all %}
{% endblock %}

View File

@@ -0,0 +1,7 @@
{% extends "base.html" %}
{% block title %}Artist List{% endblock %}
{% block content %}
<h1>Artist List</h1>
{% include 'components/artist_list.html' with artists=artists %}
{% endblock %}

View File

@@ -1,29 +1,5 @@
{% extends 'base.html' %}
{% load static %}
{% block head_extra %}
<link rel="stylesheet" href="{% static 'css/track_list.css' %}">
{% endblock head_extra %}
{% block content %}
<div class="container">
<ul class="track-list">
{% if tracks %}
{% for track in tracks %}
<li class="track-item" data-track-id="{{ track.id }}" data-track-src="{{ track.file.url }}">
<div class="track-info">
<h3 class="track-title">{{ track.title }}</h3>
<p class="track-artist">Исполнитель: {{ track.album.artist }}</p>
</div>
</li>
{% endfor %}
{% else %}
<div class="empty-state">
<i class="fas fa-music"></i>
<p>Нет добавленных треков</p>
</div>
{% endif %}
</ul>
</div>
{% include 'player.html' %}
{% include 'components/track_list.html' %}
{% endblock %}