Начал доводить шаблоны под единый стиль
This commit is contained in:
10
music_storage/core/urls.py
Normal file
10
music_storage/core/urls.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from django.urls import path
|
||||
|
||||
from core.views import index
|
||||
|
||||
|
||||
app_name = "index"
|
||||
|
||||
urlpatterns = [
|
||||
path("", index, name="main_index"),
|
||||
]
|
||||
@@ -1,3 +1,5 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
|
||||
def index(request, *args, **kwargs):
|
||||
return render(request, "index.html")
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
from django.urls import path
|
||||
|
||||
from music.views import TrackListView
|
||||
from music.views import AlbumListView
|
||||
from music.views import ArtistListView
|
||||
|
||||
|
||||
app_name = "music"
|
||||
|
||||
urlpatterns = [
|
||||
path("", TrackListView.as_view(), name="track_list"),
|
||||
path("tracks/", TrackListView.as_view(), name="track_list"),
|
||||
path("albums/", AlbumListView.as_view(), name="album_list"),
|
||||
path("artists/", ArtistListView.as_view(), name="artist_list"),
|
||||
]
|
||||
|
||||
@@ -122,6 +122,9 @@ USE_TZ = True
|
||||
# https://docs.djangoproject.com/en/6.0/howto/static-files/
|
||||
|
||||
STATIC_URL = 'static/'
|
||||
STATICFILES_DIRS = [
|
||||
BASE_DIR / STATIC_URL
|
||||
]
|
||||
|
||||
STORAGES = {
|
||||
# default storage for user uploads
|
||||
|
||||
@@ -19,5 +19,6 @@ from django.urls import path, include
|
||||
|
||||
urlpatterns = [
|
||||
path('admin/', admin.site.urls),
|
||||
path('', include("music.urls")),
|
||||
path('music/', include("music.urls")),
|
||||
path('', include("core.urls")),
|
||||
]
|
||||
|
||||
72
music_storage/static/css/main.css
Normal file
72
music_storage/static/css/main.css
Normal file
@@ -0,0 +1,72 @@
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||
background-color: #f5f7fa;
|
||||
color: #333;
|
||||
line-height: 1.6;
|
||||
padding-bottom: 100px;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
header {
|
||||
text-align: center;
|
||||
padding: 30px 0;
|
||||
background: linear-gradient(135deg, #bbc0d4 0%, #bab5c0 100%);
|
||||
color: white;
|
||||
border-radius: 10px;
|
||||
margin-bottom: 30px;
|
||||
box-shadow: 0 4px 15px rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-weight: 600;
|
||||
font-size: 2.5rem;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.logo-link {
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.logo-link:hover {
|
||||
opacity: 0.55;
|
||||
}
|
||||
|
||||
.main-nav {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 20px;
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.nav-link {
|
||||
text-decoration: none;
|
||||
color: white;
|
||||
font-weight: 500;
|
||||
padding: 10px 20px;
|
||||
background: rgba(255, 255, 255, 0.15);
|
||||
border-radius: 8px;
|
||||
transition: background 0.3s ease, transform 0.2s ease;
|
||||
box-shadow: 0 2px 6px rgba(0,0,0,0.15);
|
||||
}
|
||||
|
||||
.nav-link:hover {
|
||||
background: rgba(255, 255, 255, 0.30);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.nav-link:active {
|
||||
transform: translateY(0);
|
||||
}
|
||||
0
music_storage/static/js/player.js
Normal file
0
music_storage/static/js/player.js
Normal file
@@ -0,0 +1,26 @@
|
||||
{% load static %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="{% static '/css/main.css' %}">
|
||||
{% block head_extra %}{% endblock %}
|
||||
<title>{% block title %}Музыкальный сервис{% endblock %}</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<header>
|
||||
<h1><a class="logo-link" href="{% url 'index:main_index'%}">Музыкальный сервис</a></h1>
|
||||
<nav class="main-nav">
|
||||
<a class="nav-link" href="{% url 'music:track_list' %}">Треки</a>
|
||||
<a class="nav-link" href="{% url 'music:artist_list' %}">Артисты</a>
|
||||
<a class="nav-link" href="{% url 'music:album_list' %}">Альбомы</a>
|
||||
</nav>
|
||||
{% block header_extra %}{% endblock %}
|
||||
</header>
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
{% block content_extra %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
1
music_storage/templates/index.html
Normal file
1
music_storage/templates/index.html
Normal file
@@ -0,0 +1 @@
|
||||
{% extends "base.html" %}
|
||||
0
music_storage/templates/music/album_list.html
Normal file
0
music_storage/templates/music/album_list.html
Normal file
0
music_storage/templates/music/artist_list.html
Normal file
0
music_storage/templates/music/artist_list.html
Normal file
Reference in New Issue
Block a user