сделал страничку с сообщением об оформлении заказа

This commit is contained in:
Андрей Дувакин 2024-04-21 19:18:40 +05:00
parent 718e53ac22
commit a6756b7c0d
8 changed files with 69 additions and 3 deletions

View File

@ -9,6 +9,8 @@ urlpatterns = [
path('admin/', admin.site.urls),
path('films/', include('films.urls'), name='films'),
path('timetable/', include('timetable.urls'), name='timetable'),
path('orders/', include('tickets.urls'), name='orders'),
path('tickets/', include('tickets.urls'), name='tickets'),
path("auth/", include("users.urls"), name="auth"),
path("auth/", include("django.contrib.auth.urls"), name="auth"),
]

View File

@ -0,0 +1,22 @@
# Generated by Django 4.2 on 2024-04-21 12:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("films", "0006_actor_country_director_film_actors_film_countries_and_more"),
]
operations = [
migrations.AlterField(
model_name="film",
name="countries",
field=models.ManyToManyField(
related_name="country_films",
related_query_name="country_films",
to="films.country",
),
),
]

View File

@ -0,0 +1,19 @@
.order_info_block {
height: 40vw;
display: flex;
align-items: center;
justify-content: center;
}
.text_block {
display: flex;
flex-direction: column;
flex-wrap: nowrap;
justify-content: center;
align-items: center;
}
.order_success_title, .order_success_text, .order_success_btn {
color: #eaeaea;
}
.order_success_image {
width: 20vw;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 KiB

View File

@ -0,0 +1,18 @@
{% extends "base.html" %}
{% load static %}
{% load tags %}
{% block title %}
Заказ оформлен
{% endblock %}
{% block content %}
<link href="{% static 'css/style.css' %}" rel="stylesheet">
<link href="{% static 'css/tickets/order_success.css' %}" rel="stylesheet">
<div class="order_info_block">
<div class="text_block">
<h1 class="order_success_title">Заказ успешно оформлен</h1>
<img class="order_success_image" src="{% static 'img/success.png' %}">
<p class="order_success_text">Скоро он станет доступен в списке ваших заказов</p>
<a class="btn btn-primary" href="{% url 'home:homepage' %}">Отлично</a>
</div>
</div>
{% endblock %}

View File

@ -1,9 +1,10 @@
from django.urls import path
from tickets.views import ticket_view
from tickets.views import ticket_view, order_success
app_name = 'tickets'
urlpatterns = [
path('', ticket_view, name='tickets'),
]
path('/order/success', order_success, name='order_success'),
]

View File

@ -3,3 +3,7 @@ from django.shortcuts import render, get_object_or_404
def ticket_view(request):
return render(request, 'tickets/ticket_buy.html')
def order_success(request):
return render(request, 'tickets/order_success.html')

View File

@ -82,7 +82,7 @@ def session_view(request, sess_id):
column_number=seat[1],
)
return redirect(reverse('home:homepage'))
return redirect(reverse('tickets:order_success'))
else:
form = SeatSelectionForm(auditorium=session.auditorium)