diff --git a/GeneralApp/admin.py b/GeneralApp/admin.py index 85e4877..f90c0c0 100644 --- a/GeneralApp/admin.py +++ b/GeneralApp/admin.py @@ -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' ] diff --git a/GeneralApp/migrations/0014_widgetforblock_text_widgetforblock_text_en_and_more.py b/GeneralApp/migrations/0014_widgetforblock_text_widgetforblock_text_en_and_more.py new file mode 100644 index 0000000..1c5b135 --- /dev/null +++ b/GeneralApp/migrations/0014_widgetforblock_text_widgetforblock_text_en_and_more.py @@ -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='Тип блока'), + ), + ] diff --git a/GeneralApp/models.py b/GeneralApp/models.py index e30e49c..362b6f1 100644 --- a/GeneralApp/models.py +++ b/GeneralApp/models.py @@ -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]) diff --git a/GeneralApp/translation.py b/GeneralApp/translation.py index 5996365..e327b40 100644 --- a/GeneralApp/translation.py +++ b/GeneralApp/translation.py @@ -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) diff --git a/ServicesApp/admin.py b/ServicesApp/admin.py index d2c6d59..ff8b5c4 100644 --- a/ServicesApp/admin.py +++ b/ServicesApp/admin.py @@ -30,7 +30,9 @@ class Admin_StackedInline_BlockPluginPresentation(Admin_Trans_GenericBaseIconSta (None, { 'classes': [], 'fields': [ - 'pre_title', 'title', 'name', 'description', 'picture', + 'pre_title', + # 'title', + 'name', 'description', 'picture', ('but1_title', 'but1_icon', 'but1_url'), ('but2_title', 'but2_icon', 'but2_url'), # ('order',), @@ -49,7 +51,8 @@ class Admin_Section(SuperModelAdmin, Admin_Trans_BaseModelViewPage): 'classes': ['wide'], 'fields': ('name', 'url', - 'title', 'description', 'text', + # 'title', + 'description', 'text', 'picture', 'order', ) @@ -65,7 +68,8 @@ class Admin_Section(SuperModelAdmin, Admin_Trans_BaseModelViewPage): list_display = [ 'id', - 'name', 'url', 'title', + 'name', 'url', + # 'title', 'order', 'modifiedDT', 'createDT' ] @@ -105,7 +109,8 @@ class Admin_Service(SuperModelAdmin, Admin_Trans_BaseModelViewPage): 'section', 'parent_service', 'name', 'url', - 'title', 'description', 'text', + # 'title', + 'description', 'text', 'picture', 'order', ) @@ -121,16 +126,19 @@ class Admin_Service(SuperModelAdmin, Admin_Trans_BaseModelViewPage): list_display = [ 'id', - 'name', 'url', 'title', + 'name', 'url', 'section', 'parent_service', + # 'title', 'order', 'modifiedDT', 'createDT' ] + ordering = ['section', 'parent_service', 'order'] + prepopulated_fields = {"url": ("name_en",)} list_display_links = ['id'] list_editable = ['order'] - list_filter = ['modifiedDT', 'createDT'] + list_filter = ['section', 'parent_service', 'modifiedDT', 'createDT', ] search_fields = ['name', 'title'] # filter_horizontal = ['options'] diff --git a/ServicesApp/migrations/0006_alter_blockpluginpresentation_options.py b/ServicesApp/migrations/0006_alter_blockpluginpresentation_options.py new file mode 100644 index 0000000..cc302dd --- /dev/null +++ b/ServicesApp/migrations/0006_alter_blockpluginpresentation_options.py @@ -0,0 +1,17 @@ +# Generated by Django 4.2.7 on 2023-11-28 14:51 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('ServicesApp', '0005_blockpluginpresentation_but1_icon_and_more'), + ] + + operations = [ + migrations.AlterModelOptions( + name='blockpluginpresentation', + options={'verbose_name': 'Блок презентации плагина', 'verbose_name_plural': 'Блок презентации плагина'}, + ), + ] diff --git a/ServicesApp/models.py b/ServicesApp/models.py index 1ce2d21..e98d3a2 100644 --- a/ServicesApp/models.py +++ b/ServicesApp/models.py @@ -35,7 +35,7 @@ class BlockPluginPresentation(Block_Abstract): class Meta: verbose_name = _('Блок презентации плагина') - verbose_name_plural = _('Блоки презентации плагина') + verbose_name_plural = _('Блок презентации плагина') class Section(BaseModelViewPage): diff --git a/SlidesApp/admin.py b/SlidesApp/admin.py index 857a497..2df5ac9 100644 --- a/SlidesApp/admin.py +++ b/SlidesApp/admin.py @@ -18,7 +18,9 @@ class Admin_StackedInline_Slide(Admin_Trans_GenericBaseIconStackedInline): (None, { 'classes': [], 'fields': [ - ('title', 'description', 'picture'), + ( + # 'title', + 'name', 'description', 'picture'), ('bg_color', ), ('but_title', 'but_color'), ('url',), diff --git a/sets/admin.py b/sets/admin.py index f1a7f0f..d151c9b 100644 --- a/sets/admin.py +++ b/sets/admin.py @@ -12,9 +12,9 @@ from django.forms import widgets def sets_for_formfield_for_dbfield(field, db_field): - if db_field.name == 'url' or db_field.name == 'name' or db_field.name == 'title' or db_field.name == 'name_plural': + if db_field.name in ['url', 'name', 'title', 'name_plural']: field.widget = widgets.TextInput(attrs={'style': 'width: 30%; height: 20px;'}) - if db_field.name == 'description': + if db_field.name in ['description', 'text']: field.widget = widgets.Textarea(attrs={'style': 'width: 30%; height: 100px;'}) return field diff --git a/templates/forms/f_consultation.html b/templates/forms/f_consultation.html index 4d3a13e..8ff4ea3 100644 --- a/templates/forms/f_consultation.html +++ b/templates/forms/f_consultation.html @@ -8,12 +8,12 @@