сделал нав панель
This commit is contained in:
parent
5223346e3f
commit
3c7086feae
@ -109,6 +109,10 @@ USE_TZ = True
|
||||
|
||||
STATIC_URL = 'static/'
|
||||
|
||||
STATICFILES_DIRS = [
|
||||
BASE_DIR / 'static',
|
||||
]
|
||||
|
||||
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
||||
|
||||
MEDIA_URL = "/media/"
|
||||
|
||||
@ -1,22 +1,16 @@
|
||||
"""
|
||||
URL configuration for CineSync project.
|
||||
|
||||
The `urlpatterns` list routes URLs to views. For more information please see:
|
||||
https://docs.djangoproject.com/en/4.2/topics/http/urls/
|
||||
Examples:
|
||||
Function views
|
||||
1. Add an import: from my_app import views
|
||||
2. Add a URL to urlpatterns: path('', views.home, name='home')
|
||||
Class-based views
|
||||
1. Add an import: from other_app.views import Home
|
||||
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
|
||||
Including another URLconf
|
||||
1. Import the include() function: from django.urls import include, path
|
||||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||
"""
|
||||
from django.conf import settings
|
||||
from django.conf.urls.static import static
|
||||
from django.contrib import admin
|
||||
from django.urls import path
|
||||
from django.urls import include, path
|
||||
|
||||
urlpatterns = [
|
||||
path('', include('home.urls')),
|
||||
path('admin/', admin.site.urls),
|
||||
]
|
||||
|
||||
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
|
||||
|
||||
if settings.DEBUG:
|
||||
import debug_toolbar
|
||||
|
||||
urlpatterns += [path('__debug__/', include(debug_toolbar.urls))]
|
||||
|
||||
9
CineSync/home/urls.py
Normal file
9
CineSync/home/urls.py
Normal file
@ -0,0 +1,9 @@
|
||||
from django.urls import path
|
||||
|
||||
from home.views import homepage
|
||||
|
||||
app_name = 'home'
|
||||
|
||||
urlpatterns = [
|
||||
path('', homepage, name='homepage'),
|
||||
]
|
||||
@ -1,3 +1,12 @@
|
||||
from django.http import HttpResponse
|
||||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
|
||||
def homepage(request):
|
||||
template = render(
|
||||
request,
|
||||
'home/homepage.html'
|
||||
)
|
||||
return HttpResponse(
|
||||
template,
|
||||
)
|
||||
|
||||
6
CineSync/static/css/bootstrap/bootstrap.min.css
vendored
Normal file
6
CineSync/static/css/bootstrap/bootstrap.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
CineSync/static/css/bootstrap/bootstrap.min.css.map
Normal file
1
CineSync/static/css/bootstrap/bootstrap.min.css.map
Normal file
File diff suppressed because one or more lines are too long
0
CineSync/static/css/footer.css
Normal file
0
CineSync/static/css/footer.css
Normal file
26
CineSync/static/css/header.css
Normal file
26
CineSync/static/css/header.css
Normal file
@ -0,0 +1,26 @@
|
||||
.header_icon {
|
||||
width: 5vw;
|
||||
border-radius: 1.5vw;
|
||||
padding:1vw;
|
||||
}
|
||||
.header_row, .auth_row, header {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
header {
|
||||
justify-content: space-between;
|
||||
background-color: #ffffff;
|
||||
position: fixed;
|
||||
margin: 1%;
|
||||
width: 98%;
|
||||
border-radius: 0.8vw;;
|
||||
}
|
||||
.header_container {
|
||||
width: 100%;
|
||||
}
|
||||
.nav-item {
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
BIN
CineSync/static/img/logo.jpg
Normal file
BIN
CineSync/static/img/logo.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 80 KiB |
7
CineSync/static/js/bootstrap/bootstrap.min.js
vendored
Normal file
7
CineSync/static/js/bootstrap/bootstrap.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
CineSync/static/js/bootstrap/bootstrap.min.js.map
Normal file
1
CineSync/static/js/bootstrap/bootstrap.min.js.map
Normal file
File diff suppressed because one or more lines are too long
19
CineSync/templates/base.html
Normal file
19
CineSync/templates/base.html
Normal file
@ -0,0 +1,19 @@
|
||||
{% load static %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>{% block title %}{% endblock title %}</title>
|
||||
<link href="{% static 'css/bootstrap/bootstrap.min.css' %}" rel="stylesheet">
|
||||
<link rel="stylesheet" href="{% static 'css/header.css' %}"/>
|
||||
<link rel="stylesheet" href="{% static 'css/footer.css' %}"/>
|
||||
</head>
|
||||
<body>
|
||||
{% include 'includes/header.html' %}
|
||||
<main>
|
||||
{% block content %} Контент не подвезлм :( {% endblock content %}
|
||||
</main>
|
||||
{% include 'includes/footer.html' %}
|
||||
<script defer src="{% static 'js/bootstrap/bootstrap.min.js' %}"></script>
|
||||
</body>
|
||||
</html>
|
||||
8
CineSync/templates/home/homepage.html
Normal file
8
CineSync/templates/home/homepage.html
Normal file
@ -0,0 +1,8 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
{% block title %}
|
||||
Главная
|
||||
{% endblock title %}
|
||||
{% block content %}
|
||||
|
||||
{% endblock %}
|
||||
0
CineSync/templates/includes/footer.html
Normal file
0
CineSync/templates/includes/footer.html
Normal file
38
CineSync/templates/includes/header.html
Normal file
38
CineSync/templates/includes/header.html
Normal file
@ -0,0 +1,38 @@
|
||||
{% load static %}
|
||||
<div class="header_container">
|
||||
<header>
|
||||
<div class="header_row">
|
||||
<img src="{% static 'img/logo.jpg' %}" class="header_icon col-4">
|
||||
<ul class="nav nav-pills">
|
||||
{% with request.resolver_match.view_name as view_name %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link {% if view_name == 'home:homepage' %} active {% endif %}"
|
||||
href="{% url 'home:homepage' %}">Главная</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link {% if view_name == 'home:homepage' %} active {% endif %}"
|
||||
href="{% url 'home:homepage' %}">Фильмы</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link {% if view_name == 'home:homepage' %} active {% endif %}"
|
||||
href="{% url 'home:homepage' %}">Расписание</a>
|
||||
</li>
|
||||
{% endwith %}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="auth_row">
|
||||
{% if user.is_authenticated %}
|
||||
|
||||
{% else %}
|
||||
<ul class="nav nav-pills">
|
||||
<li class="nav-item">
|
||||
<a class="btn btn-primary" href="{% url 'home:homepage' %}">Регистрация</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="btn btn-secondary" href="{% url 'home:homepage' %}">Вход</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
</div>
|
||||
</header>
|
||||
</div>
|
||||
Loading…
x
Reference in New Issue
Block a user