diff --git a/GeneralApp/admin.py b/GeneralApp/admin.py index 63af784..a4821dc 100644 --- a/GeneralApp/admin.py +++ b/GeneralApp/admin.py @@ -27,8 +27,9 @@ class Admin_Inline_WidgetForBlock(SuperInlineModelAdmin, Admin_Trans_BaseIconSta ( # 'title', 'name', 'description', 'text', - 'picture' + 'picture', ), + 'video_url', ('bg_color', ), ('but_title', 'but_color', 'but_icon'), ('url', 'order'), @@ -53,11 +54,17 @@ class Admin_StackedInline_Block(Admin_Trans_GenericBaseIconStackedInline, SuperI 'fields': [ ('block_type', # 'title', - 'name', 'description', 'picture'), - ('bg_color', 'bg_image'), + 'name', 'description'), + ('picture', ), + ('video_url',), + ('bg_color', 'bg_image',), + # ('bg_video_url',), ('but_title', 'but_color', 'but_icon'), ('url',), - ('child_in_row_count', 'order'), + ( + # 'child_in_row_count', + 'order', + ), ] }) ] @@ -125,11 +132,15 @@ class Admin_Block(Admin_Trans_BaseModelViewPage): 'fields': [ ('block_type', # 'title', - 'name', 'description', 'picture'), - ('bg_color', 'bg_image'), + 'name', 'description'), + ('picture', 'video_url'), + ('bg_color', 'bg_image', 'bg_video_url'), ('but_title', 'but_color', 'but_icon'), ('url',), - ('child_in_row_count', 'order'), + ( + # 'child_in_row_count', + 'order', + ), ] }) ] diff --git a/GeneralApp/migrations/0017_block_bg_video_url_block_video_url_and_more.py b/GeneralApp/migrations/0017_block_bg_video_url_block_video_url_and_more.py new file mode 100644 index 0000000..d4266c9 --- /dev/null +++ b/GeneralApp/migrations/0017_block_bg_video_url_block_video_url_and_more.py @@ -0,0 +1,28 @@ +# Generated by Django 4.2.7 on 2023-12-06 13:20 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('GeneralApp', '0016_alter_block_block_type'), + ] + + operations = [ + migrations.AddField( + model_name='block', + name='bg_video_url', + field=models.TextField(blank=True, null=True, verbose_name='Ссылка на фоновое видео'), + ), + migrations.AddField( + model_name='block', + name='video_url', + field=models.TextField(blank=True, null=True, verbose_name='Ссылка на видео'), + ), + migrations.AddField( + model_name='widgetforblock', + name='video_url', + field=models.TextField(blank=True, null=True, verbose_name='Ссылка на видео'), + ), + ] diff --git a/GeneralApp/models.py b/GeneralApp/models.py index f9251b4..999c68c 100644 --- a/GeneralApp/models.py +++ b/GeneralApp/models.py @@ -53,11 +53,14 @@ class Block(Block_Abstract): url = models.TextField(verbose_name=_('URL привязанной страницы'), null=True, blank=True) + video_url = models.TextField(verbose_name=_('Ссылка на видео'), null=True, blank=True) + bg_color = ColorField(verbose_name=_('Цвет фона'), default=None, null=True, blank=True) bg_image = models.FileField( upload_to='uploads/', verbose_name=_('Фоновое изображение блока'), null=True, blank=True, validators=[validate_file_extension] ) + bg_video_url = models.TextField(verbose_name=_('Ссылка на фоновое видео'), null=True, blank=True) but_title = models.CharField(max_length=100, verbose_name=_('Текст на кнопке'), null=True, blank=True) but_color = ColorField(verbose_name=_('Цвет кнопки'), default='#000000') @@ -79,9 +82,9 @@ class Block(Block_Abstract): verbose_name_plural = _('Блоки на странице') -def preSave_Block(sender, instance, **kwargs): - instance.url = get_unique_url_for_new_instance(instance, sender) -pre_save.connect(preSave_Block, sender=Block, dispatch_uid='pre_save_connect') +# def preSave_Block(sender, instance, **kwargs): +# instance.url = get_unique_url_for_new_instance(instance, sender) +# pre_save.connect(preSave_Block, sender=Block, dispatch_uid='pre_save_connect') @@ -100,6 +103,8 @@ class WidgetForBlock(BaseModel): picture = models.FileField(upload_to='uploads/', verbose_name=_('Картинка'), null=True, blank=True, validators=[validate_file_extension]) + video_url = models.TextField(verbose_name=_('Ссылка на видео'), null=True, blank=True) + # block_type = models.CharField(max_length=100, choices=block_type_choices, verbose_name=_('Тип блока'), default='photo_n_text') url = models.TextField(verbose_name=_('URL привязанной страницы'), null=True, blank=True) diff --git a/GeneralApp/views.py b/GeneralApp/views.py index a3bfbdc..95152ef 100644 --- a/GeneralApp/views.py +++ b/GeneralApp/views.py @@ -6,6 +6,7 @@ from django.contrib.auth.decorators import login_required from .models import * from django.conf import settings from .funcs import get_inter_http_respose +from django.utils.translation import gettext_lazy as _ def test_code(request): @@ -20,7 +21,13 @@ def MainPage(request): from .init_options import init_options init_options() - page = StaticPage.objects.get(url='main') + try: + page = StaticPage.objects.get(url='main') + except StaticPage.DoesNotExist: + page = StaticPage.objects.create( + url='main', + name_ru = _('Главная') + ) # from ArticlesApp.models import ArticleModel # arts = ArticleModel.objects.filter(enable=True).order_by('-createDT')[:4] diff --git a/sets/admin.py b/sets/admin.py index d151c9b..2fec77d 100644 --- a/sets/admin.py +++ b/sets/admin.py @@ -14,8 +14,10 @@ from django.forms import widgets def sets_for_formfield_for_dbfield(field, db_field): if db_field.name in ['url', 'name', 'title', 'name_plural']: field.widget = widgets.TextInput(attrs={'style': 'width: 30%; height: 20px;'}) - if db_field.name in ['description', 'text']: + if db_field.name in ['description', 'text', 'video_url', 'bg_video_url']: field.widget = widgets.Textarea(attrs={'style': 'width: 30%; height: 100px;'}) + if db_field.name in ['video_url', 'bg_video_url']: + field.widget = widgets.TextInput(attrs={'style': 'width: 90%; '}) return field diff --git a/static/aerbimCSS.css b/static/aerbimCSS.css index 05376d3..a94620c 100644 --- a/static/aerbimCSS.css +++ b/static/aerbimCSS.css @@ -2,23 +2,24 @@ body,html{ margin: 0; background: #ffffff; - font-family: - -apple-system, - 'Raleway-Black' , - 'Raleway-BlackItalic', - 'Raleway-Bold' , - 'Raleway-BoldItalic' , - 'Raleway-ExtraBold' , - 'Raleway-ExtraBoldItalic' , - 'Raleway-ExtraLight' , - 'Raleway-ExtraLightItalic' , - 'Raleway-Medium' , - 'Raleway-MediumItalic' , - 'Raleway-SemiBold' , - 'Raleway-SemiBoldItalic' , - 'Raleway-Thin' , - 'Raleway-ThinItalic' , - 'sans-serif'; + font-family: -apple-system, 'Roboto', sans-serif; + /*font-family:*/ + /* -apple-system,*/ + /* 'Raleway-Black' ,*/ + /* 'Raleway-BlackItalic',*/ + /* 'Raleway-Bold' ,*/ + /* 'Raleway-BoldItalic' ,*/ + /* 'Raleway-ExtraBold' ,*/ + /* 'Raleway-ExtraBoldItalic' ,*/ + /* 'Raleway-ExtraLight' ,*/ + /* 'Raleway-ExtraLightItalic' ,*/ + /* 'Raleway-Medium' ,*/ + /* 'Raleway-MediumItalic' ,*/ + /* 'Raleway-SemiBold' ,*/ + /* 'Raleway-SemiBoldItalic' ,*/ + /* 'Raleway-Thin' ,*/ + /* 'Raleway-ThinItalic' ,*/ + /* 'sans-serif';*/ } body.n_scroll{ @@ -91,7 +92,8 @@ body.n_scroll{ .standart_txt{ color: #ffffff; /*font-family: Spline Sans;*/ - font-family: -apple-system, 'Raleway-Regular', sans-serif; + /*font-family: -apple-system, 'Raleway-Regular', sans-serif;*/ + font-size: 16px; font-weight: 500; line-height: normal; @@ -105,7 +107,7 @@ body.n_scroll{ .standart_semi_bold_txt{ color: #000000; /*font-family: Spline Sans;*/ - font-family: -apple-system, 'Raleway-Regular', sans-serif; + /*font-family: -apple-system, 'Raleway-Regular', sans-serif;*/ font-size: 16px; font-weight: 600; line-height: normal; @@ -113,7 +115,7 @@ body.n_scroll{ .large_txt{ color: #000000; - font-family: -apple-system, 'Raleway-Regular', sans-serif; + /*font-family: -apple-system, 'Raleway-Regular', sans-serif;*/ font-size: 36px; font-style: normal; font-weight: 700; @@ -122,7 +124,7 @@ body.n_scroll{ .semi_large_light{ color: #000000; - font-family: -apple-system, 'Raleway-Regular', sans-serif; + /*font-family: -apple-system, 'Raleway-Regular', sans-serif;*/ font-size: 18px; font-style: normal; font-weight: 300; @@ -131,7 +133,7 @@ body.n_scroll{ .semi_large_semi_light{ color: #000000; - font-family: -apple-system, 'Raleway-Regular', sans-serif; + /*font-family: -apple-system, 'Raleway-Regular', sans-serif;*/ font-size: 18px; font-style: normal; font-weight: 400; @@ -140,7 +142,7 @@ body.n_scroll{ .medium_txt{ color: #000000; - font-family: -apple-system, 'Raleway-Regular', sans-serif; + /*font-family: -apple-system, 'Raleway-Regular', sans-serif;*/ font-size: 24px; font-style: normal; font-weight: 700; @@ -149,7 +151,7 @@ body.n_scroll{ .medium_small_bold_txt{ color: #000000; - font-family: -apple-system, 'Raleway-Regular', sans-serif; + /*font-family: -apple-system, 'Raleway-Regular', sans-serif;*/ font-size: 20px; font-style: normal; font-weight: 800; @@ -483,7 +485,7 @@ body.n_scroll{ border-bottom: 1px solid #E3E3E3; width: calc(100% - 20px); color: #10212B; - font-family: -apple-system, 'Raleway-Regular', sans-serif; + /*font-family: -apple-system, 'Raleway-Regular', sans-serif;*/ font-size: 16px; font-weight: 500; outline: none; diff --git a/static/fonts/Roboto-Black.ttf b/static/fonts/Roboto-Black.ttf new file mode 100644 index 0000000..0112e7d Binary files /dev/null and b/static/fonts/Roboto-Black.ttf differ diff --git a/static/fonts/Roboto-BlackItalic.ttf b/static/fonts/Roboto-BlackItalic.ttf new file mode 100644 index 0000000..b2c6aca Binary files /dev/null and b/static/fonts/Roboto-BlackItalic.ttf differ diff --git a/static/fonts/Roboto-Bold.ttf b/static/fonts/Roboto-Bold.ttf new file mode 100644 index 0000000..43da14d Binary files /dev/null and b/static/fonts/Roboto-Bold.ttf differ diff --git a/static/fonts/Roboto-BoldItalic.ttf b/static/fonts/Roboto-BoldItalic.ttf new file mode 100644 index 0000000..bcfdab4 Binary files /dev/null and b/static/fonts/Roboto-BoldItalic.ttf differ diff --git a/static/fonts/Roboto-Italic.ttf b/static/fonts/Roboto-Italic.ttf new file mode 100644 index 0000000..1b5eaa3 Binary files /dev/null and b/static/fonts/Roboto-Italic.ttf differ diff --git a/static/fonts/Roboto-Light.ttf b/static/fonts/Roboto-Light.ttf new file mode 100644 index 0000000..e7307e7 Binary files /dev/null and b/static/fonts/Roboto-Light.ttf differ diff --git a/static/fonts/Roboto-LightItalic.ttf b/static/fonts/Roboto-LightItalic.ttf new file mode 100644 index 0000000..2d277af Binary files /dev/null and b/static/fonts/Roboto-LightItalic.ttf differ diff --git a/static/fonts/Roboto-Medium.ttf b/static/fonts/Roboto-Medium.ttf new file mode 100644 index 0000000..ac0f908 Binary files /dev/null and b/static/fonts/Roboto-Medium.ttf differ diff --git a/static/fonts/Roboto-MediumItalic.ttf b/static/fonts/Roboto-MediumItalic.ttf new file mode 100644 index 0000000..fc36a47 Binary files /dev/null and b/static/fonts/Roboto-MediumItalic.ttf differ diff --git a/static/fonts/Roboto-Regular.ttf b/static/fonts/Roboto-Regular.ttf new file mode 100644 index 0000000..ddf4bfa Binary files /dev/null and b/static/fonts/Roboto-Regular.ttf differ diff --git a/static/fonts/Roboto-Thin.ttf b/static/fonts/Roboto-Thin.ttf new file mode 100644 index 0000000..2e0dee6 Binary files /dev/null and b/static/fonts/Roboto-Thin.ttf differ diff --git a/static/fonts/Roboto-ThinItalic.ttf b/static/fonts/Roboto-ThinItalic.ttf new file mode 100644 index 0000000..084f9c0 Binary files /dev/null and b/static/fonts/Roboto-ThinItalic.ttf differ diff --git a/templates/head_includes/fonts_include.html b/templates/head_includes/fonts_include.html index 0326098..d2cec2a 100644 --- a/templates/head_includes/fonts_include.html +++ b/templates/head_includes/fonts_include.html @@ -1,19 +1,19 @@ {% load static %} - - - - - - - - - - - - - - - - - - \ No newline at end of file +{##} +{##} +{##} +{##} +{##} +{##} +{##} +{##} +{##} +{##} +{##} +{##} +{##} +{##} +{##} +{##} +{##} +{##} \ No newline at end of file diff --git a/templates/tb_base.html b/templates/tb_base.html index 7544cf4..1ddb088 100644 --- a/templates/tb_base.html +++ b/templates/tb_base.html @@ -6,7 +6,12 @@ AerBim {% include 'head_includes/fonts_include.html' %} - + + + + +{# #} +