Merge branch 'refs/heads/ivan' into andrei
# Conflicts: # CineSync/static/css/home/homepage.css
This commit is contained in:
commit
76df0fe756
@ -123,4 +123,4 @@ LOGIN_URL = "/auth/login/"
|
||||
|
||||
LOGIN_REDIRECT_URL = "/"
|
||||
|
||||
LOGOUT_REDIRECT_URL = "/users/login/"
|
||||
LOGOUT_REDIRECT_URL = "/auth/login/"
|
||||
|
||||
@ -9,6 +9,7 @@ urlpatterns = [
|
||||
path('admin/', admin.site.urls),
|
||||
path('films/', include('films.urls'), name='films'),
|
||||
path('timetable/', include('timetable.urls'), name='timetable'),
|
||||
path('ticket/<int:sess_id>', include('tickets.urls'), name='tickets'),
|
||||
path("auth/", include("users.urls"), name="auth"),
|
||||
path("auth/", include("django.contrib.auth.urls"), name="auth"),
|
||||
]
|
||||
|
||||
6
CineSync/static/css/bootstrap.min.css
vendored
6
CineSync/static/css/bootstrap.min.css
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,133 +1,9 @@
|
||||
.carousel_films {
|
||||
margin-top: 5vw;
|
||||
height: 30vw;
|
||||
width: 100%;
|
||||
}
|
||||
.film_preview_image {
|
||||
object-fit: cover;
|
||||
height: 30vw !important;
|
||||
width: 70% !important;
|
||||
border-radius: 3vw;
|
||||
}
|
||||
.carousel-item-next, .carousel-item-prev, .carousel-item.active {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.caption_block {
|
||||
background-color: rgba(13, 39, 58, 0.8);
|
||||
border-radius: 2vw;
|
||||
width: 40%;
|
||||
display: flex !important;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin-left: 15%;
|
||||
}
|
||||
.header_title {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
color: #eaeaea;
|
||||
font-weight: bold;
|
||||
margin-bottom: 2vw;
|
||||
}
|
||||
.timetable_block {
|
||||
margin-top: 10vw;
|
||||
height: 100vw;
|
||||
}
|
||||
.tab_btn {
|
||||
color: #eaeaea !important;
|
||||
}
|
||||
.tab_btn.active {
|
||||
color: #0d1d3a !important;
|
||||
}
|
||||
.timetable_body.active {
|
||||
margin-top: 1vw;
|
||||
margin-bottom: 10vw;
|
||||
padding-top: 2vw;
|
||||
padding-bottom: 2vw;
|
||||
flex-direction: column;
|
||||
}
|
||||
.film_card {
|
||||
width: 100%;
|
||||
background-color: #eaeaea;
|
||||
margin-top: 1vw;
|
||||
margin-bottom: 1vw;
|
||||
border-radius: 3vw;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
.film_card_image {
|
||||
object-fit: cover;
|
||||
height: 10vw !important;
|
||||
width: 10vw !important;
|
||||
border-radius: 3vw;
|
||||
}
|
||||
.film_card_column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
justify-content: space-around;
|
||||
height: 10vw;
|
||||
margin-left: 2vw;
|
||||
overflow-x: scroll;
|
||||
}
|
||||
.film_card_column::-webkit-scrollbar {
|
||||
height: 7px;
|
||||
}
|
||||
.film_card_column::-webkit-scrollbar-thumb {
|
||||
background-color: #0d1d3a;
|
||||
border-radius: 5vw;
|
||||
border: 1px solid #ffffff;
|
||||
}
|
||||
.film_card_title_row {
|
||||
height: 20%;
|
||||
margin-top: 0.5vw;
|
||||
margin-bottom: 0.5vw;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
justify-content: space-evenly;
|
||||
}
|
||||
.film_card_row {
|
||||
height: 60%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
.film_card_footer {
|
||||
height: 20%;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
.film_session {
|
||||
background-color: rgb(255, 64, 96);
|
||||
color: #eaeaea;
|
||||
font-weight: bold;
|
||||
padding: 10px;
|
||||
padding-top: 15px;
|
||||
padding-bottom: 15px;
|
||||
margin: 5px;
|
||||
border-radius: 5px;
|
||||
text-decoration: none;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.film_session:hover {
|
||||
background-color: rgb(196, 47, 72);
|
||||
}
|
||||
.session_time {
|
||||
font-size: 12px;
|
||||
color: #eaeaea;
|
||||
}
|
||||
.genre {
|
||||
margin-right: 0.5vw;
|
||||
}
|
||||
.carousel_title {
|
||||
margin-top: 5vw;
|
||||
}
|
||||
128
CineSync/static/css/style.css
Normal file
128
CineSync/static/css/style.css
Normal file
@ -0,0 +1,128 @@
|
||||
.film_preview_image {
|
||||
object-fit: cover;
|
||||
height: 30vw !important;
|
||||
width: 70% !important;
|
||||
border-radius: 3vw;
|
||||
}
|
||||
.ticket_film_image {
|
||||
object-fit: cover;
|
||||
height: 20vw !important;
|
||||
width: 25% !important;
|
||||
border-radius: 3vw;
|
||||
}
|
||||
.caption_block {
|
||||
background-color: rgba(13, 39, 58, 0.8);
|
||||
border-radius: 2vw;
|
||||
width: 40%;
|
||||
display: flex !important;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin-left: 15%;
|
||||
}
|
||||
.header_title {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
color: #eaeaea;
|
||||
font-weight: bold;
|
||||
margin-bottom: 2vw;
|
||||
}
|
||||
.timetable_block {
|
||||
margin-top: 10vw;
|
||||
height: 100vw;
|
||||
}
|
||||
.tab_btn {
|
||||
color: #eaeaea !important;
|
||||
}
|
||||
.tab_btn.active {
|
||||
color: #0d1d3a !important;
|
||||
}
|
||||
.timetable_body.active {
|
||||
margin-top: 1vw;
|
||||
margin-bottom: 10vw;
|
||||
padding-top: 2vw;
|
||||
padding-bottom: 2vw;
|
||||
flex-direction: column;
|
||||
}
|
||||
.film_card {
|
||||
width: 100%;
|
||||
background-color: #eaeaea;
|
||||
margin-top: 1vw;
|
||||
margin-bottom: 1vw;
|
||||
border-radius: 3vw;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
.film_card_image {
|
||||
object-fit: cover;
|
||||
height: 10vw !important;
|
||||
width: 10vw !important;
|
||||
border-radius: 3vw;
|
||||
}
|
||||
.film_card_column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
justify-content: space-around;
|
||||
height: 10vw;
|
||||
margin-left: 2vw;
|
||||
overflow-x: scroll;
|
||||
}
|
||||
.film_card_column::-webkit-scrollbar {
|
||||
height: 7px;
|
||||
}
|
||||
.film_card_column::-webkit-scrollbar-thumb {
|
||||
background-color: #0d1d3a;
|
||||
border-radius: 5vw;
|
||||
border: 1px solid #ffffff;
|
||||
}
|
||||
.film_card_title_row {
|
||||
height: 20%;
|
||||
margin-top: 0.5vw;
|
||||
margin-bottom: 0.5vw;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
justify-content: space-evenly;
|
||||
}
|
||||
.film_card_row {
|
||||
height: 60%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
.film_card_footer {
|
||||
height: 20%;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
.film_session {
|
||||
background-color: rgb(255, 64, 96);
|
||||
color: #eaeaea;
|
||||
font-weight: bold;
|
||||
padding: 10px;
|
||||
padding-top: 15px;
|
||||
padding-bottom: 15px;
|
||||
margin: 5px;
|
||||
border-radius: 5px;
|
||||
text-decoration: none;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.film_session:hover {
|
||||
background-color: rgb(196, 47, 72);
|
||||
}
|
||||
.session_time {
|
||||
font-size: 12px;
|
||||
color: #eaeaea;
|
||||
}
|
||||
.genre {
|
||||
margin-right: 0.5vw;
|
||||
}
|
||||
12
CineSync/static/css/tickets/ticket.css
Normal file
12
CineSync/static/css/tickets/ticket.css
Normal file
@ -0,0 +1,12 @@
|
||||
.session_details {
|
||||
margin-left: 10%;
|
||||
margin-right: 10%;
|
||||
background-color: #eaeaea;
|
||||
margin-top: 1vw;
|
||||
margin-bottom: 1vw;
|
||||
border-radius: 3vw;
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
{% extends "base.html" %}
|
||||
@ -0,0 +1 @@
|
||||
{% extends "base.html" %}
|
||||
@ -4,6 +4,7 @@
|
||||
Главная
|
||||
{% endblock title %}
|
||||
{% block content %}
|
||||
<link href="{% static 'css/style.css' %}" rel="stylesheet">
|
||||
<link href="{% static 'css/home/homepage.css' %}" rel="stylesheet">
|
||||
<h1 class="header_title carousel_title">Сейчас в прокате</h1>
|
||||
<div id="carouselWhite" class="carousel carousel slide carousel_films" data-bs-ride="carousel">
|
||||
@ -77,7 +78,7 @@
|
||||
</div>
|
||||
<div class="film_card_row">
|
||||
{% for time_sessions in session %}
|
||||
<a class="film_session" href="">
|
||||
<a class="film_session" href={% url 'tickets:tickets' sess_id=time_sessions.id %}>
|
||||
<div class="session_time">{{ time_sessions.start_datetime|time:"H:i" }}</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
|
||||
@ -16,3 +16,4 @@
|
||||
<button type="submit" class="btn btn-primary">{% if text_button %} {{ text_button }} {% else %} Отправить {% endif %}
|
||||
</button>
|
||||
</form>
|
||||
</form>
|
||||
|
||||
19
CineSync/templates/tickets/ticket_buy.html
Normal file
19
CineSync/templates/tickets/ticket_buy.html
Normal file
@ -0,0 +1,19 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
{% block title %}
|
||||
{{ session.film.name }}
|
||||
{% endblock title %}
|
||||
{% block content %}
|
||||
<link href="{% static 'css/style.css' %}" rel="stylesheet">
|
||||
<link href="{% static 'css/tickets/ticket.css' %}" rel="stylesheet">
|
||||
<form method="POST">
|
||||
<div class="session_details">
|
||||
<img src="{{ session.film.image.url }}" class="ticket_film_image">
|
||||
{{ session.price }}<br>
|
||||
{{ session.film.name }}<br>
|
||||
{{ session.auditorium }}<br>
|
||||
{{ session.start_datetime }} - {{ session.end_datetime }}<br>
|
||||
<a type="submit" class="btn btn-primary">{% if text_button %} {{ text_button }} {% else %} Купить {% endif %}</a>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
1
CineSync/templates/timetable/timetable.html
Normal file
1
CineSync/templates/timetable/timetable.html
Normal file
@ -0,0 +1 @@
|
||||
{% extends "base.html" %}
|
||||
@ -33,3 +33,8 @@ class Ticket(Model):
|
||||
validators=[MinValueValidator(1)],
|
||||
help_text='Номер кресла в ряду',
|
||||
)
|
||||
|
||||
class Meta:
|
||||
db_table = 'tickets_ticket'
|
||||
verbose_name = 'Билет'
|
||||
verbose_name_plural = 'Билеты'
|
||||
|
||||
9
CineSync/tickets/urls.py
Normal file
9
CineSync/tickets/urls.py
Normal file
@ -0,0 +1,9 @@
|
||||
from django.urls import path
|
||||
|
||||
from tickets.views import ticket_view
|
||||
|
||||
app_name = 'tickets'
|
||||
|
||||
urlpatterns = [
|
||||
path('', ticket_view, name='tickets'),
|
||||
]
|
||||
@ -1,3 +1,11 @@
|
||||
from django.shortcuts import render
|
||||
from django.shortcuts import render, get_object_or_404
|
||||
from timetable.models import FilmSession
|
||||
|
||||
# Create your views here.
|
||||
|
||||
def ticket_view(request, sess_id):
|
||||
session = get_object_or_404(
|
||||
FilmSession.objects.all(),
|
||||
id=sess_id,
|
||||
)
|
||||
context = {'session': session}
|
||||
return render(request, 'tickets/ticket_buy.html', context)
|
||||
|
||||
@ -1,9 +1,14 @@
|
||||
from django.shortcuts import render
|
||||
from films.models import Film
|
||||
|
||||
|
||||
def timetable_view(request):
|
||||
pass
|
||||
films = Film.objects.all()
|
||||
template = 'timetable/timetable.html'
|
||||
context = {'films': films}
|
||||
return render(request, template, context)
|
||||
|
||||
|
||||
def session_view(request):
|
||||
pass
|
||||
template = 'session/session_details.html'
|
||||
return render(request, template)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user