0.0.21 how dev block

This commit is contained in:
SDE
2023-11-28 15:01:17 +03:00
parent 426c001dc9
commit 78181b075d
10 changed files with 89 additions and 18 deletions

View File

@@ -24,7 +24,11 @@ class Admin_Inline_WidgetForBlock(SuperInlineModelAdmin, Admin_Trans_BaseIconSta
(None, {
'classes': [],
'fields': [
('title', 'description', 'picture'),
(
# 'title',
'name', 'description', 'text',
'picture'
),
('bg_color', ),
('but_title', 'but_color', 'but_icon'),
('url', 'order'),
@@ -47,7 +51,9 @@ class Admin_StackedInline_Block(Admin_Trans_GenericBaseIconStackedInline, SuperI
(None, {
'classes': [],
'fields': [
('block_type', 'title', 'description', 'picture'),
('block_type',
# 'title',
'name', 'description', 'picture'),
('bg_color', 'bg_image'),
('but_title', 'but_color', 'but_icon'),
('url',),
@@ -71,7 +77,8 @@ class Admin_StaticPage(SuperModelAdmin, Admin_Trans_BaseModelViewPage):
'classes': ['wide'],
'fields': ('name',
'url',
'title', 'description', 'text',
# 'title',
'description', 'text',
'picture',
'order',
)
@@ -87,7 +94,8 @@ class Admin_StaticPage(SuperModelAdmin, Admin_Trans_BaseModelViewPage):
list_display = [
'id',
'name', 'url', 'title',
'name', 'url',
# 'title',
'order', 'modifiedDT', 'createDT'
]

View File

@@ -0,0 +1,34 @@
# Generated by Django 4.2.7 on 2023-11-28 14:51
import ckeditor_uploader.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('GeneralApp', '0013_alter_widgetforblock_bg_color'),
]
operations = [
migrations.AddField(
model_name='widgetforblock',
name='text',
field=ckeditor_uploader.fields.RichTextUploadingField(blank=True, null=True, verbose_name='Дополнительное описание'),
),
migrations.AddField(
model_name='widgetforblock',
name='text_en',
field=ckeditor_uploader.fields.RichTextUploadingField(blank=True, null=True, verbose_name='Дополнительное описание'),
),
migrations.AddField(
model_name='widgetforblock',
name='text_ru',
field=ckeditor_uploader.fields.RichTextUploadingField(blank=True, null=True, verbose_name='Дополнительное описание'),
),
migrations.AlterField(
model_name='block',
name='block_type',
field=models.CharField(choices=[('photo_n_text', 'Фото + текст'), ('photo150_n_title', 'Фото 150x150 + заголовок'), ('how_work', 'Как с нами работать'), ('how_dev', 'Как ведется разработка'), ('feedback_form', 'Форма обратной связи')], default='photo_n_text', max_length=100, verbose_name='Тип блока'),
),
]

View File

@@ -21,6 +21,7 @@ block_type_choices = (
('photo_n_text', _('Фото + текст')),
('photo150_n_title', _('Фото 150x150 + заголовок')),
('how_work', _('Как с нами работать')),
('how_dev', _('Как ведется разработка')),
('feedback_form', _('Форма обратной связи')),
# ('slider', _('Галерея слайдов')),
)
@@ -81,6 +82,7 @@ class WidgetForBlock(BaseModel):
title = models.TextField(verbose_name=_('Заголовок'), null=True, blank=True)
description = RichTextUploadingField(verbose_name=_('Краткое описание'), null=True, blank=True)
text = RichTextUploadingField(verbose_name=_('Дополнительное описание'), null=True, blank=True)
picture = models.FileField(upload_to='uploads/', verbose_name=_('Картинка'), null=True, blank=True,
validators=[validate_file_extension])

View File

@@ -18,7 +18,7 @@ translator.register(Block, Block_TranslationOptions)
class WidgetForBlock_TranslationOptions(TranslationOptions):
fields = (
'name', 'description', 'title', 'but_title'
'name', 'description', 'title', 'but_title', 'text'
)
translator.register(WidgetForBlock, WidgetForBlock_TranslationOptions)