NASA-TEST

This commit is contained in:
2024-05-08 19:29:42 +03:00
parent fb4197cb2d
commit 63f31f7568
57 changed files with 3886 additions and 0 deletions

14
Dockerfile Normal file
View File

@@ -0,0 +1,14 @@
# Используем базовый образ с MySQL
FROM mysql:latest
# Определение переменных окружения для MySQL
ENV MYSQL_ROOT_PASSWORD=Ax123456
ENV MYSQL_DATABASE=django_db
ENV MYSQL_USER=django_user
ENV MYSQL_PASSWORD=Ax123456
# Копирование sql-скрипта и настройка инициализации БД
COPY init.sql /docker-entrypoint-initdb.d/
# Определяем порт для доступа к MySQL
EXPOSE 3306

View File

@@ -1,2 +1,8 @@
# Nasa-TEST # Nasa-TEST
Для запуска docker mysql server
```
docker-compose build
docker-compose up
```

0
config/__init__.py Normal file
View File

4
config/asgi.py Normal file
View File

@@ -0,0 +1,4 @@
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')
application = get_asgi_application()

77
config/settings.py Normal file
View File

@@ -0,0 +1,77 @@
import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'django-insecure-a9-$s7^q=2lxwoo=$ejvz104=d^$un(9tof%d$^&e01)=-mqpz'
DEBUG = True
ALLOWED_HOSTS = []
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'filer',
'easy_thumbnails',
'adminsortable2',
'main.apps.MainConfig',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'config.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.getenv('TEMPLATES_DIR', os.path.join(BASE_DIR, "templates"))],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'config.wsgi.application'
# Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'django_db',
'USER': 'django_user',
'PASSWORD': 'Ax123456',
'HOST': '127.0.0.1',
'PORT': '32769',
}
}
AUTH_PASSWORD_VALIDATORS = [
{'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', },
{'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', },
{'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', },
{'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', },
]
LANGUAGE_CODE = 'ru-ru'
TIME_ZONE = 'Europe/Moscow'
USE_I18N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# Указываем URL для доступа к статическим файлам
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, "static")
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "staticfiles"),
]
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, "mediafiles")
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
LOGOUT_REDIRECT_URL = "main"
FILE_UPLOAD_PERMISSIONS = 0o644

12
config/urls.py Normal file
View File

@@ -0,0 +1,12 @@
from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('main.urls')),
]
if settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

4
config/wsgi.py Normal file
View File

@@ -0,0 +1,4 @@
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')
application = get_wsgi_application()

29
docker-compose.yml Normal file
View File

@@ -0,0 +1,29 @@
version: '3'
services:
db:
build: .
container_name: mysql_django_db
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: Ax123456
MYSQL_DATABASE: django_db
MYSQL_USER: django_user
MYSQL_PASSWORD: Ax123456
web:
build: .
container_name: django_app
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/app
ports:
- "8000:8000"
depends_on:
- db
volumes:
mysql_data:

0
init.sql Normal file
View File

0
main/__init__.py Normal file
View File

19
main/admin.py Normal file
View File

@@ -0,0 +1,19 @@
from django.contrib import admin
from adminsortable2.admin import SortableAdminMixin
from .models import SliderItem
#@admin.register(SliderItem)
class SliderItemAdmin(SortableAdminMixin, admin.ModelAdmin):
list_display = ['title', 'image_thumbnail']
search_fields = ['title']
list_filter = ['title']
def image_thumbnail(self, obj):
if obj.image:
return '<img src="%s" width="50" />' % obj.image.url
return 'No Image'
image_thumbnail.allow_tags = True
image_thumbnail.short_description = 'Thumbnail'
admin.site.register(SliderItem, SliderItemAdmin)

6
main/apps.py Normal file
View File

@@ -0,0 +1,6 @@
from django.apps import AppConfig
class MainConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'main'

View File

@@ -0,0 +1,26 @@
# Generated by Django 4.1 on 2024-05-08 14:33
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='SliderItem',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=255)),
('image', models.ImageField(blank=True, null=True, upload_to='')),
],
options={
'verbose_name': 'Изображение для сладера',
'verbose_name_plural': 'Изображения для слайдера',
},
),
]

View File

@@ -0,0 +1,27 @@
# Generated by Django 4.1 on 2024-05-08 14:34
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import filer.fields.image
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.FILER_IMAGE_MODEL),
('main', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='slideritem',
name='my_order',
field=models.PositiveIntegerField(default=0),
),
migrations.AlterField(
model_name='slideritem',
name='image',
field=filer.fields.image.FilerImageField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.FILER_IMAGE_MODEL),
),
]

View File

21
main/models.py Normal file
View File

@@ -0,0 +1,21 @@
from django.db import models
from filer.fields.image import FilerImageField
class SliderItem(models.Model):
title = models.CharField(max_length=255)
image = FilerImageField(null=True, blank=True, on_delete=models.SET_NULL)
my_order = models.PositiveIntegerField(
default=0,
blank=False,
null=False,
)
class Meta:
verbose_name = 'Изображение для сладера'
verbose_name_plural = 'Изображения для слайдера'
ordering = ['my_order']
def __str__(self):
return self.title

3
main/tests.py Normal file
View File

@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

6
main/urls.py Normal file
View File

@@ -0,0 +1,6 @@
from django.urls import path, include
from .views import MainView
#
urlpatterns = [
path('', MainView.as_view(), name='main'),
]

16
main/views.py Normal file
View File

@@ -0,0 +1,16 @@
from django.shortcuts import render
from django.views.generic import TemplateView
from .models import SliderItem
class MainView(TemplateView):
template_name = 'index.html'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['title'] = 'Главная страница'
context['slider_items'] = SliderItem.objects.all()
return context
def get(self, request, *args, **kwargs):
context = self.get_context_data()
return self.render_to_response(context)

22
manage.py Normal file
View File

@@ -0,0 +1,22 @@
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
if __name__ == '__main__':
main()

Binary file not shown.

After

Width:  |  Height:  |  Size: 441 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 791 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

BIN
req.pip Normal file

Binary file not shown.

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="408"><defs><linearGradient id="bs-logo-a" x1="76.079" x2="523.48" y1="10.798" y2="365.945" gradientUnits="userSpaceOnUse"><stop stop-color="#9013fe"/><stop offset="1" stop-color="#6610f2"/></linearGradient><linearGradient id="bs-logo-b" x1="193.508" x2="293.514" y1="109.74" y2="278.872" gradientUnits="userSpaceOnUse"><stop stop-color="#fff"/><stop offset="1" stop-color="#f1e5fc"/></linearGradient><filter xmlns="http://www.w3.org/2000/svg" id="bs-logo-c" width="197" height="249" x="161.901" y="83.457" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/><feOffset dy="4"/><feGaussianBlur stdDeviation="8"/><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.15 0"/><feBlend in2="BackgroundImageFix" result="effect1_dropShadow"/><feBlend in="SourceGraphic" in2="effect1_dropShadow" result="shape"/></filter></defs><path fill="url(#bs-logo-a)" d="M56.481 53.32C55.515 25.58 77.128 0 106.342 0h299.353c29.214 0 50.827 25.58 49.861 53.32-.928 26.647.277 61.165 8.964 89.31 8.715 28.232 23.411 46.077 47.48 48.37v26c-24.069 2.293-38.765 20.138-47.48 48.37-8.687 28.145-9.892 62.663-8.964 89.311.966 27.739-20.647 53.319-49.861 53.319H106.342c-29.214 0-50.827-25.58-49.86-53.319.927-26.648-.278-61.166-8.966-89.311C38.802 237.138 24.07 219.293 0 217v-26c24.069-2.293 38.802-20.138 47.516-48.37 8.688-28.145 9.893-62.663 8.965-89.31z"/><path fill="url(#bs-logo-b)" filter="url(#bs-logo-c)" stroke="#fff" d="M267.103 312.457c47.297 0 75.798-23.158 75.798-61.355 0-28.873-20.336-49.776-50.532-53.085v-1.203c22.185-3.609 39.594-24.211 39.594-47.219 0-32.783-25.882-54.138-65.322-54.138h-88.74v217h89.202zm-54.692-189.48h45.911c24.958 0 39.131 11.128 39.131 31.279 0 21.505-16.484 33.535-46.372 33.535h-38.67v-64.814zm0 161.961v-71.431h45.602c32.661 0 49.608 12.03 49.608 35.49 0 23.459-16.484 35.941-47.605 35.941h-47.605z"/></svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@@ -0,0 +1,50 @@
.image-container {
position: relative;
display: flex;
justify-content: center;
align-items: center;
height: 480px;
}
.image-nav-container {
position: relative;
display: flex;
justify-content: center;
align-items: center;
height: 120px;
}
.rounded-image {
border-radius: 30px;
max-width: 100%;
max-height: 100%;
object-fit: cover;
object-position: center;
}
.thumbnail {
width: 100px;
height: 100px;
margin: 10px;
}
@media (min-width: 767px) {
.section-img-col {
width: 100%;
height: auto;
}
}
@media (max-width: 767px) {
.section-img-col {
width: 100%;
height: auto;
}
.rounded-image {
height: 380px;
border-radius: 20px;
}
.image-nav-container {
height: 48px;
}
}

Binary file not shown.

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Generated by Fontastic.me</metadata>
<defs>
<font id="slick" horiz-adv-x="512">
<font-face font-family="slick" units-per-em="512" ascent="480" descent="-32"/>
<missing-glyph horiz-adv-x="512" />
<glyph unicode="&#8594;" d="M241 113l130 130c4 4 6 8 6 13 0 5-2 9-6 13l-130 130c-3 3-7 5-12 5-5 0-10-2-13-5l-29-30c-4-3-6-7-6-12 0-5 2-10 6-13l87-88-87-88c-4-3-6-8-6-13 0-5 2-9 6-12l29-30c3-3 8-5 13-5 5 0 9 2 12 5z m234 143c0-40-9-77-29-110-20-34-46-60-80-80-33-20-70-29-110-29-40 0-77 9-110 29-34 20-60 46-80 80-20 33-29 70-29 110 0 40 9 77 29 110 20 34 46 60 80 80 33 20 70 29 110 29 40 0 77-9 110-29 34-20 60-46 80-80 20-33 29-70 29-110z"/>
<glyph unicode="&#8592;" d="M296 113l29 30c4 3 6 7 6 12 0 5-2 10-6 13l-87 88 87 88c4 3 6 8 6 13 0 5-2 9-6 12l-29 30c-3 3-8 5-13 5-5 0-9-2-12-5l-130-130c-4-4-6-8-6-13 0-5 2-9 6-13l130-130c3-3 7-5 12-5 5 0 10 2 13 5z m179 143c0-40-9-77-29-110-20-34-46-60-80-80-33-20-70-29-110-29-40 0-77 9-110 29-34 20-60 46-80 80-20 33-29 70-29 110 0 40 9 77 29 110 20 34 46 60 80 80 33 20 70 29 110 29 40 0 77-9 110-29 34-20 60-46 80-80 20-33 29-70 29-110z"/>
<glyph unicode="&#8226;" d="M475 256c0-40-9-77-29-110-20-34-46-60-80-80-33-20-70-29-110-29-40 0-77 9-110 29-34 20-60 46-80 80-20 33-29 70-29 110 0 40 9 77 29 110 20 34 46 60 80 80 33 20 70 29 110 29 40 0 77-9 110-29 34-20 60-46 80-80 20-33 29-70 29-110z"/>
<glyph unicode="&#97;" d="M475 439l0-128c0-5-1-9-5-13-4-4-8-5-13-5l-128 0c-8 0-13 3-17 11-3 7-2 14 4 20l40 39c-28 26-62 39-100 39-20 0-39-4-57-11-18-8-33-18-46-32-14-13-24-28-32-46-7-18-11-37-11-57 0-20 4-39 11-57 8-18 18-33 32-46 13-14 28-24 46-32 18-7 37-11 57-11 23 0 44 5 64 15 20 9 38 23 51 42 2 1 4 3 7 3 3 0 5-1 7-3l39-39c2-2 3-3 3-6 0-2-1-4-2-6-21-25-46-45-76-59-29-14-60-20-93-20-30 0-58 5-85 17-27 12-51 27-70 47-20 19-35 43-47 70-12 27-17 55-17 85 0 30 5 58 17 85 12 27 27 51 47 70 19 20 43 35 70 47 27 12 55 17 85 17 28 0 55-5 81-15 26-11 50-26 70-45l37 37c6 6 12 7 20 4 8-4 11-9 11-17z"/>
</font></defs></svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,204 @@
@charset 'UTF-8';
/* Slider */
.slick-loading .slick-list
{
background: #fff url('./ajax-loader.gif') center center no-repeat;
}
/* Icons */
@font-face
{
font-family: 'slick';
font-weight: normal;
font-style: normal;
src: url('./fonts/slick.eot');
src: url('./fonts/slick.eot?#iefix') format('embedded-opentype'), url('./fonts/slick.woff') format('woff'), url('./fonts/slick.ttf') format('truetype'), url('./fonts/slick.svg#slick') format('svg');
}
/* Arrows */
.slick-prev,
.slick-next
{
font-size: 0;
line-height: 0;
position: absolute;
top: 50%;
display: block;
width: 20px;
height: 20px;
padding: 0;
-webkit-transform: translate(0, -50%);
-ms-transform: translate(0, -50%);
transform: translate(0, -50%);
cursor: pointer;
color: transparent;
border: none;
outline: none;
background: transparent;
}
.slick-prev:hover,
.slick-prev:focus,
.slick-next:hover,
.slick-next:focus
{
color: transparent;
outline: none;
background: transparent;
}
.slick-prev:hover:before,
.slick-prev:focus:before,
.slick-next:hover:before,
.slick-next:focus:before
{
opacity: 1;
}
.slick-prev.slick-disabled:before,
.slick-next.slick-disabled:before
{
opacity: .25;
}
.slick-prev:before,
.slick-next:before
{
font-family: 'slick';
font-size: 20px;
line-height: 1;
opacity: .75;
color: white;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.slick-prev
{
left: -25px;
}
[dir='rtl'] .slick-prev
{
right: -25px;
left: auto;
}
.slick-prev:before
{
content: '←';
}
[dir='rtl'] .slick-prev:before
{
content: '→';
}
.slick-next
{
right: -25px;
}
[dir='rtl'] .slick-next
{
right: auto;
left: -25px;
}
.slick-next:before
{
content: '→';
}
[dir='rtl'] .slick-next:before
{
content: '←';
}
/* Dots */
.slick-dotted.slick-slider
{
margin-bottom: 30px;
}
.slick-dots
{
position: absolute;
bottom: -25px;
display: block;
width: 100%;
padding: 0;
margin: 0;
list-style: none;
text-align: center;
}
.slick-dots li
{
position: relative;
display: inline-block;
width: 20px;
height: 20px;
margin: 0 5px;
padding: 0;
cursor: pointer;
}
.slick-dots li button
{
font-size: 0;
line-height: 0;
display: block;
width: 20px;
height: 20px;
padding: 5px;
cursor: pointer;
color: transparent;
border: 0;
outline: none;
background: transparent;
}
.slick-dots li button:hover,
.slick-dots li button:focus
{
outline: none;
}
.slick-dots li button:hover:before,
.slick-dots li button:focus:before
{
opacity: 1;
}
.slick-dots li button:before
{
font-family: 'slick';
font-size: 6px;
line-height: 20px;
position: absolute;
top: 0;
left: 0;
width: 20px;
height: 20px;
content: '•';
text-align: center;
opacity: .25;
color: black;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.slick-dots li.slick-active button:before
{
opacity: .75;
color: black;
}

119
staticfiles/css/slick.css Normal file
View File

@@ -0,0 +1,119 @@
/* Slider */
.slick-slider
{
position: relative;
display: block;
box-sizing: border-box;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-touch-callout: none;
-khtml-user-select: none;
-ms-touch-action: pan-y;
touch-action: pan-y;
-webkit-tap-highlight-color: transparent;
}
.slick-list
{
position: relative;
display: block;
overflow: hidden;
margin: 0;
padding: 0;
}
.slick-list:focus
{
outline: none;
}
.slick-list.dragging
{
cursor: pointer;
cursor: hand;
}
.slick-slider .slick-track,
.slick-slider .slick-list
{
-webkit-transform: translate3d(0, 0, 0);
-moz-transform: translate3d(0, 0, 0);
-ms-transform: translate3d(0, 0, 0);
-o-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
.slick-track
{
position: relative;
top: 0;
left: 0;
display: block;
margin-left: auto;
margin-right: auto;
}
.slick-track:before,
.slick-track:after
{
display: table;
content: '';
}
.slick-track:after
{
clear: both;
}
.slick-loading .slick-track
{
visibility: hidden;
}
.slick-slide
{
display: none;
float: left;
height: 100%;
min-height: 1px;
}
[dir='rtl'] .slick-slide
{
float: right;
}
.slick-slide img
{
display: block;
}
.slick-slide.slick-loading img
{
display: none;
}
.slick-slide.dragging img
{
pointer-events: none;
}
.slick-initialized .slick-slide
{
display: block;
}
.slick-loading .slick-slide
{
visibility: hidden;
}
.slick-vertical .slick-slide
{
display: block;
height: auto;
border: 1px solid transparent;
}
.slick-arrow.slick-hidden {
display: none;
}

BIN
staticfiles/img/car01.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 441 KiB

BIN
staticfiles/img/car02.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

BIN
staticfiles/img/car03.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

BIN
staticfiles/img/car04.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 791 KiB

BIN
staticfiles/img/car05.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

BIN
staticfiles/img/img01.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

3011
staticfiles/js/slick.js Normal file

File diff suppressed because it is too large Load Diff

1
staticfiles/js/slick.min.js vendored Normal file

File diff suppressed because one or more lines are too long

BIN
staticfiles/slick-1.8.1.zip Normal file

Binary file not shown.

27
templates/caruserl.html Normal file
View File

@@ -0,0 +1,27 @@
{% load static %}
<section style="background-color: #3C3C3C;">
<div class="px-4 py-5 my-5 text-center">
<h2 class="display-5 fw-bold text-white">Фотографии</h2>
<div class="col-lg-6 mx-auto">
<div class="slider slider-for">
{% for item in slider_items %}
<div class="slick-track" style="opacity: 1;">
<div class="image-container">
<img src="{{ item.image.url }}" alt="{{ item.title }}" class="rounded-image">
</div>
</div>
{% endfor %}
</div>
<div class="slider slider-nav">
{% for item in slider_items %}
<div class="slick-slide">
<div class="image-nav-container">
<img src="{{ item.image.url }}" alt="{{ item.title }}" class="rounded-image thumbnail">
</div>
</div>
{% endfor %}
</div>
</div>
</div>
</section>

8
templates/css.html Normal file
View File

@@ -0,0 +1,8 @@
{% load static %}
<link rel="icon" type="image/x-icon" href="{% static 'assets/favicon.ico' %}" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v6.5.1/css/all.css">
<link rel="stylesheet" href="{% static 'css/custom.css' %}">
<!-- карусель -->
<link rel="stylesheet" type="text/css" href="{% static 'css/slick.css' %}"/>
<link rel="stylesheet" type="text/css" href="{% static 'css/slick-theme.css' %}"/>

8
templates/headers.html Normal file
View File

@@ -0,0 +1,8 @@
<section>
<div class="px-4 py-4 my-4 text-center">
<h1 class="display-5 fw-bold text-body-emphasis">Космическое агентство</h1>
<div class="col-lg-6 mx-auto">
<p class="lead">Национальное управление по аэронавтике и исследованию космического пространства — ведомство, относящееся к федеральному правительству США и подчиняющееся непосредственно президенту США.</p>
</div>
</div>
</section>

18
templates/index.html Normal file
View File

@@ -0,0 +1,18 @@
{% load static %}
<!DOCTYPE html>
<html lang="ru">
<head>
{% include 'seo.html' %}
<title>{{ title }}</title>
<!-- styles -->
{% include 'css.html' %}
<!-- script -->
{% include 'script.html' %}
</head>
<body>
{% include 'nav.html' %}
{% include 'headers.html' %}
{% include 'welcome.html' %}
{% include 'caruserl.html' %}
</body>
</html>

30
templates/nav.html Normal file
View File

@@ -0,0 +1,30 @@
{% load static %}
<nav class="navbar bg-dark border-bottom border-body" data-bs-theme="dark">
<div class="container">
<button class="navbar-toggler d-md-none" type="button" data-bs-toggle="collapse" data-bs-target="#navbarToggleExternalContent" aria-controls="navbarToggleExternalContent" aria-expanded="false" aria-label="Toggle navigation" style="border-style: none;">
<svg width="20" height="16" viewBox="0 0 20 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 0.5H20V3H0V0.5ZM0 6.75H20V9.25H0V6.75ZM0 13H20V15.5H0V13Z" fill="#FF342B"/>
</svg>
</button>
<div class="col-md-3 mb-2 mb-md-0">
<a class="navbar-brand" href="#">
<svg width="120" height="34" viewBox="0 0 120 34" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M21.72 24.9899C22.095 26.3949 22.695 26.9399 23.755 26.9399C24.855 26.9399 25.43 26.2799 25.43 24.9899V1.01989H32.325V24.9899C32.325 28.3649 31.885 29.8299 30.175 31.5399C28.94 32.7799 26.66 33.7349 23.785 33.7349C21.465 33.7349 19.24 32.9649 17.825 31.5449C16.58 30.2949 15.895 29.0199 14.83 24.9899L10.6 9.0099C10.23 7.6049 9.63 7.05989 8.57 7.05989C7.47 7.05989 6.89 7.7199 6.89 9.0099V32.9799H0V9.0099C0 5.6349 0.44 4.16989 2.15 2.45989C3.385 1.21989 5.665 0.264893 8.54 0.264893C10.86 0.264893 13.085 1.03489 14.5 2.45489C15.745 3.70489 16.425 4.9799 17.495 9.0099L21.72 24.9899ZM112.875 32.9799L104.92 8.07989C104.86 7.84399 104.758 7.62058 104.62 7.41989C104.508 7.28367 104.365 7.17563 104.204 7.10444C104.042 7.03324 103.866 7.00086 103.69 7.00989C103.515 7.00165 103.34 7.03441 103.179 7.10558C103.018 7.17675 102.877 7.28437 102.765 7.41989C102.627 7.62053 102.525 7.84396 102.465 8.07989L94.51 32.9799H87.385L96.08 5.77989C96.53 4.36489 97.18 3.15989 98 2.35989C99.41 0.984891 101.07 0.264893 103.69 0.264893C106.315 0.264893 107.975 0.984893 109.385 2.36489C110.205 3.16489 110.855 4.36489 111.305 5.77989L120 32.9799H112.875ZM77.655 32.9799C82.17 32.9799 84.375 32.0199 86.115 30.2899C88.04 28.3749 88.96 26.2799 88.96 23.1549C88.96 20.3899 87.95 17.8349 86.41 16.3049C84.395 14.3049 81.895 13.6699 77.815 13.6699H72.105C69.925 13.6699 69.055 13.4049 68.365 12.7299C67.895 12.2649 67.67 11.5799 67.67 10.7649C67.67 9.9249 67.87 9.0949 68.45 8.5249C68.965 8.0249 69.665 7.78989 71.005 7.78989H87.51V1.01989H72.265C67.75 1.01989 65.55 1.97989 63.81 3.70989C61.885 5.62489 60.96 7.71989 60.96 10.8449C60.96 13.6099 61.975 16.1649 63.51 17.6949C65.53 19.6949 68.03 20.3299 72.11 20.3299H77.815C80 20.3299 80.865 20.5949 81.555 21.2699C82.03 21.7349 82.255 22.4199 82.255 23.2349C82.255 24.0799 82.05 24.9099 81.47 25.4749C80.96 25.9749 80.26 26.2099 78.92 26.2099H61.895L55.365 5.77989C54.915 4.36489 54.265 3.15989 53.445 2.35989C52.035 0.984891 50.37 0.264893 47.75 0.264893C45.13 0.264893 43.465 0.984893 42.06 2.36489C41.235 3.16489 40.59 4.36489 40.135 5.77989L31.445 32.9799H38.565L46.525 8.07989C46.5855 7.84399 46.687 7.62058 46.825 7.41989C46.9367 7.28437 47.0785 7.17675 47.239 7.10558C47.3996 7.03441 47.5746 7.00165 47.75 7.00989C48.16 7.00989 48.46 7.14989 48.68 7.41989C48.8181 7.62048 48.9197 7.84392 48.98 8.07989L56.935 32.9799H77.655Z" fill="#FF342B"/>
</svg>
</a>
</div>
<div class="collapse navbar-collapse justify-content-center" id="navbarToggleExternalContent">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link {% if request.path == "/" %}text-secondary{% else %}text-white{% endif %}" href="{% url 'main' %}">Преимущества</a>
</li>
<li class="nav-item">
<a class="nav-link {% if request.path >= "/photos" %}text-secondary{% else %}text-white{% endif %}" href="#">Фотографии</a>
</li>
</ul>
</div>
<div class="col-md-3 text-end">
<button type="button" class="btn btn-danger text-white me-2">Вход</button>
</div>
</div>
</nav>

39
templates/script.html Normal file
View File

@@ -0,0 +1,39 @@
{% load static %}
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.8/dist/umd/popper.min.js" integrity="sha384-I7E8VVD/ismYTF4hNIPjVp/Zjvgyol6VFvRkX/vR+Vc4jQkC+hVqc2pM8ODewa9r" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.min.js" integrity="sha384-0pUGZvbkm6XF6gxjEnlmuGrJXVbNuzT9qBBavbLwCsOGabYfZo0T0to5eqruptLy" crossorigin="anonymous"></script>
<!-- карусель -->
<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="https://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<script type="text/javascript" src="{% static 'js/slick.min.js' %}"></script>
<!-- Добавленный сварачивания -->
<script>
const navbarToggler = document.querySelector('.navbar-toggler');
const navbarCollapse = document.querySelector('.navbar-collapse');
navbarToggler.addEventListener('click', function () {
navbarCollapse.classList.toggle('collapse');
});
</script>
<!-- Добавьте скрипт для работы слайдера -->
<script>
$(document).ready(function() {
$('.slider-for').slick({
slidesToShow: 1,
slidesToScroll: 1,
arrows: false,
fade: true,
asNavFor: '.slider-nav'
});
$('.slider-nav').slick({
slidesToShow: 3,
slidesToScroll: 1,
asNavFor: '.slider-for',
dots: true,
centerMode: true,
focusOnSelect: true
});
});
</script>

6
templates/seo.html Normal file
View File

@@ -0,0 +1,6 @@
{% load static %}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<meta name="generator" content="">

58
templates/welcome.html Normal file
View File

@@ -0,0 +1,58 @@
{% load static %}
<section>
<div class="container col-xxl-8 px-4 py-5">
<div class="row align-items-center g-5">
<div class="col-md-6 d-flex align-items-center">
<div class="row justify-content-center p-3">
<div class="col-md-6 text-center p-3">
<div class="icon-text d-flex flex-column align-items-center">
<svg width="65" height="65" viewBox="0 0 65 65" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clipPath="url(#clip0_601_33)">
<path d="M10.9 19.7C13.52 19.7 15.84 20.96 17.3 22.9H46.1C53.03 22.9 59.6 25.17 64.02 31.06C64.66 31.91 64.66 33.09 64.02 33.94C59.6 39.83 53.03 42.1 46.1 42.1H17.3C15.84 44.04 13.52 45.3 10.9 45.3H10.1V54.9H8.5C5.849 54.9 3.7 52.75 3.7 50.1V45.3H4.5C2.291 45.3 0.5 43.51 0.5 41.3V23.7C0.5 21.49 2.289 19.7 4.496 19.7H3.7V14.9C3.7 12.249 5.849 10.1 8.5 10.1H10.1V19.7H10.9ZM48.14 27.7C47.81 27.7 47.7 27.81 47.7 28.14V36.86C47.7 37.1 47.81 37.3 48.14 37.3C50.11 37.3 51.7 35.71 51.7 33.74V31.26C51.7 29.29 50.11 27.7 48.14 27.7Z" fill="#004382" />
<path d="M13.3 54.9H13.41C17.56 54.9 21.54 53.71 25.02 51.71L35.7 45.3H13.3V54.9Z" fill="#B3B3B3" />
<path d="M13.3 19.7H35.7L25.02 13.292C21.54 11.203 17.56 10.1 13.41 10.1H13.3V19.7Z" fill="#B3B3B3" />
</g>
<defs>
<clipPath id="clip0_601_33">
<rect width="64" height="64" fill="white" transform="translate(0.5 0.5)" />
</clipPath>
</defs>
</svg>
<p>Спейс шаттлы — пилотируемые корабли</p>
</div>
</div>
<div class="col-md-6 text-center p-3">
<div class="icon-text d-flex flex-column align-items-center">
<svg width="65" height="65" viewBox="0 0 65 65" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M13.945 31.75C13.6799 31.2908 13.2432 30.9556 12.731 30.8183C12.2189 30.6809 11.6731 30.7526 11.2138 31.0175L5 34.6012C4.41831 34.9346 3.91019 35.3824 3.5063 35.9176C3.1024 36.4527 2.81112 37.0642 2.65 37.715C2.33998 39.0055 2.54393 40.3659 3.21875 41.5087L3.76375 42.4512C4.42722 43.5985 5.51903 44.4354 6.79926 44.7781C8.07949 45.1208 9.44339 44.9412 10.5913 44.2787L16.8 40.7C17.0277 40.5688 17.2272 40.3941 17.3873 40.1857C17.5474 39.9774 17.6649 39.7395 17.733 39.4858C17.8012 39.232 17.8187 38.9673 17.7845 38.7068C17.7503 38.4463 17.6651 38.1951 17.5338 37.9675L13.945 31.75Z" fill="#B3B3B3" />
<path d="M48.355 55.6L36.59 32.25C36.5614 32.193 36.5557 32.1271 36.574 32.066C36.5924 32.0049 36.6334 31.9531 36.6887 31.9213L37.7262 31.3225C37.9538 31.1912 38.1532 31.0164 38.3132 30.808C38.4732 30.5996 38.5905 30.3618 38.6586 30.108C38.7266 29.8543 38.7439 29.5896 38.7097 29.3291C38.6754 29.0687 38.5901 28.8175 38.4587 28.59L32.5175 18.2988C32.3863 18.0711 32.2115 17.8715 32.0032 17.7114C31.7949 17.5513 31.557 17.4339 31.3033 17.3657C31.0495 17.2976 30.7848 17.2801 30.5243 17.3143C30.2638 17.3485 30.0126 17.4337 29.785 17.565L18.9875 23.79C18.4175 24.1166 17.9179 24.553 17.5178 25.0739C17.1176 25.5949 16.8248 26.1901 16.6562 26.825C16.5416 27.2215 16.4839 27.6323 16.485 28.045C16.4925 28.995 17.635 30.8825 18.75 32.83C19.9487 34.9238 21.155 37.065 22.0425 37.5988C22.6075 37.9388 23.605 38.2113 24.4437 38.2113H24.5487L14.6337 59.6613C14.5233 59.8997 14.4609 60.1577 14.4502 60.4202C14.4394 60.6828 14.4806 60.945 14.5712 61.1917C14.6618 61.4384 14.8002 61.6648 14.9784 61.858C15.1566 62.0511 15.3711 62.2073 15.6097 62.3175C15.8483 62.4277 16.1063 62.4899 16.3689 62.5003C16.6315 62.5108 16.8936 62.4694 17.1402 62.3785C17.3868 62.2876 17.6131 62.149 17.8061 61.9706C17.9991 61.7922 18.155 61.5775 18.265 61.3388L29.975 36.0075C30.0611 35.82 30.2036 35.664 30.3825 35.5613L32.7837 34.1763C32.8132 34.1594 32.8459 34.1488 32.8796 34.1449C32.9134 34.1411 32.9475 34.1442 32.9801 34.154C33.0126 34.1639 33.0428 34.1802 33.0688 34.2021C33.0947 34.224 33.116 34.2509 33.1312 34.2813L44.7825 57.4063C44.9007 57.6408 45.0639 57.8498 45.2629 58.0213C45.4618 58.1928 45.6926 58.3234 45.9421 58.4057C46.1915 58.488 46.4547 58.5204 46.7167 58.501C46.9786 58.4815 47.2342 58.4107 47.4687 58.2925C47.7033 58.1743 47.9123 58.0111 48.0838 57.8121C48.2553 57.6132 48.3859 57.3824 48.4682 57.1329C48.5505 56.8835 48.5829 56.6203 48.5634 56.3583C48.544 56.0964 48.4732 55.8408 48.355 55.6063V55.6ZM61.7762 14.9675L56.0112 5.00003C55.3459 3.85445 54.2539 3.01903 52.9741 2.67655C51.6944 2.33407 50.3311 2.5124 49.1825 3.17253L37.515 9.89503C36.9448 10.2214 36.4451 10.6577 36.0449 11.1787C35.6447 11.6997 35.352 12.295 35.1837 12.93C35.018 13.4654 34.964 14.0291 35.025 14.5863C35.2425 16.1638 36.65 18.3863 38.3262 21.3225C40.0237 24.2888 41.94 27.6325 42.9425 28.3563C43.7899 28.9553 44.8022 29.2772 45.84 29.2775C46.7142 29.2778 47.5731 29.0476 48.33 28.61L60 21.8838C60.5805 21.5512 61.0878 21.1047 61.4914 20.5711C61.895 20.0375 62.1866 19.4279 62.3487 18.7788C62.661 17.4823 62.4557 16.1151 61.7762 14.9675Z" fill="#004382" />
</svg>
<p>Лучшее телескопическое оборудование</p>
</div>
</div>
<div class="col-md-6 text-center p-3">
<div class="icon-text d-flex flex-column align-items-center">
<svg width="65" height="65" viewBox="0 0 65 65" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M24.5 1.61197C24.8905 2.08642 25.1297 2.66706 25.1867 3.27886C25.2437 3.89067 25.116 4.50552 24.82 5.04397C22.5074 9.28987 21.2997 14.0491 21.308 18.884C21.308 34.968 34.42 47.992 50.58 47.992C52.688 47.992 54.74 47.772 56.712 47.352C57.3165 47.2211 57.9462 47.2711 58.5224 47.4959C59.0986 47.7207 59.5958 48.1103 59.952 48.616C60.328 49.1418 60.5196 49.7771 60.4972 50.423C60.4748 51.069 60.2395 51.6895 59.828 52.188C56.6907 56.0417 52.733 59.1468 48.2433 61.2767C43.7537 63.4067 38.8453 64.5079 33.876 64.5C15.436 64.5 0.5 49.644 0.5 31.34C0.5 17.564 8.956 5.74797 20.996 0.739973C21.5958 0.486501 22.2616 0.434477 22.8934 0.591716C23.5252 0.748955 24.089 1.10697 24.5 1.61197Z" fill="#B3B3B3" />
<path d="M43.676 13.092C43.7334 12.9188 43.8439 12.768 43.9918 12.6612C44.1397 12.5543 44.3175 12.4968 44.5 12.4968C44.6825 12.4968 44.8603 12.5543 45.0082 12.6612C45.1562 12.768 45.2666 12.9188 45.324 13.092L46.872 17.74C47.564 19.812 49.188 21.436 51.26 22.128L55.908 23.676C56.0812 23.7334 56.232 23.8438 56.3388 23.9918C56.4456 24.1397 56.5032 24.3175 56.5032 24.5C56.5032 24.6825 56.4456 24.8603 56.3388 25.0082C56.232 25.1561 56.0812 25.2666 55.908 25.324L51.26 26.872C50.2381 27.2125 49.3095 27.7862 48.5479 28.5479C47.7863 29.3095 47.2125 30.2381 46.872 31.26L45.324 35.908C45.2666 36.0812 45.1562 36.232 45.0082 36.3388C44.8603 36.4456 44.6825 36.5031 44.5 36.5031C44.3175 36.5031 44.1397 36.4456 43.9918 36.3388C43.8439 36.232 43.7334 36.0812 43.676 35.908L42.128 31.26C41.7875 30.2381 41.2137 29.3095 40.4521 28.5479C39.6905 27.7862 38.7619 27.2125 37.74 26.872L33.092 25.324C32.9188 25.2666 32.768 25.1561 32.6612 25.0082C32.5544 24.8603 32.4969 24.6825 32.4969 24.5C32.4969 24.3175 32.5544 24.1397 32.6612 23.9918C32.768 23.8438 32.9188 23.7334 33.092 23.676L37.74 22.128C38.7619 21.7875 39.6905 21.2137 40.4521 20.4521C41.2137 19.6905 41.7875 18.7619 42.128 17.74L43.676 13.092ZM55.952 0.895992C55.9915 0.782097 56.0655 0.683336 56.1637 0.613438C56.2619 0.543541 56.3795 0.505981 56.5 0.505981C56.6206 0.505981 56.7381 0.543541 56.8363 0.613438C56.9345 0.683336 57.0085 0.782097 57.048 0.895992L58.08 3.99199C58.54 5.37599 59.624 6.45999 61.008 6.91999L64.104 7.95199C64.2179 7.99148 64.3167 8.06547 64.3866 8.16368C64.4565 8.2619 64.494 8.37945 64.494 8.49999C64.494 8.62054 64.4565 8.73809 64.3866 8.8363C64.3167 8.93451 64.2179 9.00851 64.104 9.04799L61.008 10.08C60.326 10.3069 59.7062 10.6897 59.1979 11.1979C58.6897 11.7062 58.3069 12.3259 58.08 13.008L57.048 16.104C57.0085 16.2179 56.9345 16.3166 56.8363 16.3865C56.7381 16.4564 56.6206 16.494 56.5 16.494C56.3795 16.494 56.2619 16.4564 56.1637 16.3865C56.0655 16.3166 55.9915 16.2179 55.952 16.104L54.92 13.008C54.6931 12.3259 54.3103 11.7062 53.8021 11.1979C53.2938 10.6897 52.6741 10.3069 51.992 10.08L48.896 9.04799C48.7821 9.00851 48.6833 8.93451 48.6135 8.8363C48.5436 8.73809 48.506 8.62054 48.506 8.49999C48.506 8.37945 48.5436 8.2619 48.6135 8.16368C48.6833 8.06547 48.7821 7.99148 48.896 7.95199L51.992 6.91999C53.376 6.45999 54.46 5.37599 54.92 3.99199L55.952 0.899992V0.895992Z" fill="#004382" />
</svg>
<p>Целимся на Луну и Марс</p>
</div>
</div>
<div class="col-md-6 text-center p-3">
<div class="icon-text d-flex flex-column align-items-center">
<svg width="46" height="46" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fillRule="evenodd" clipRule="evenodd" d="M22.9 45.5C28.8408 45.5 34.5384 43.14 38.7392 38.9391C42.94 34.7383 45.3 29.0408 45.3 23.1C45.3 17.1591 42.94 11.4616 38.7392 7.26076C34.5384 3.05994 28.8408 0.699951 22.9 0.699951C16.9592 0.699951 11.2616 3.05994 7.06081 7.26076C2.85999 11.4616 0.5 17.1591 0.5 23.1C0.5 29.0408 2.85999 34.7383 7.06081 38.9391C11.2616 43.14 16.9592 45.5 22.9 45.5ZM18.98 18.2391L22.9 10.2999L26.82 18.2391L35.5816 19.5095L29.2424 25.6919L30.74 34.4183L22.9 30.2999L15.0632 34.4183L16.5608 25.6919L10.2216 19.5095L18.98 18.2391Z" fill="#B3B3B3" />
</svg>
<p>Золотая медаль по научным исследованиям</p>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<img src="{% static 'img/img01.png' %}" class="d-block mx-lg-auto img-fluid section-img-col" alt="Bootstrap Themes" loading="lazy">
</div>
</div>
</div>
</div>
</section>