Добавил недостающие шаблоны, добавил related_name в моделях, добавил недостающие urls
This commit is contained in:
11
music_storage/templates/music/album_detail.html
Normal file
11
music_storage/templates/music/album_detail.html
Normal 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 %}
|
||||
@@ -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 %}
|
||||
10
music_storage/templates/music/artist_detail.html
Normal file
10
music_storage/templates/music/artist_detail.html
Normal 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 %}
|
||||
@@ -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 %}
|
||||
|
||||
@@ -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 %}
|
||||
|
||||
Reference in New Issue
Block a user