0.0.21 how dev block
This commit is contained in:
@@ -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'
|
||||
]
|
||||
|
||||
|
||||
@@ -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='Тип блока'),
|
||||
),
|
||||
]
|
||||
@@ -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])
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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']
|
||||
|
||||
|
||||
@@ -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': 'Блок презентации плагина'},
|
||||
),
|
||||
]
|
||||
@@ -35,7 +35,7 @@ class BlockPluginPresentation(Block_Abstract):
|
||||
|
||||
class Meta:
|
||||
verbose_name = _('Блок презентации плагина')
|
||||
verbose_name_plural = _('Блоки презентации плагина')
|
||||
verbose_name_plural = _('Блок презентации плагина')
|
||||
|
||||
|
||||
class Section(BaseModelViewPage):
|
||||
|
||||
@@ -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',),
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
<div class="container_content_form_consultation">
|
||||
<div class="description_form_consultation">
|
||||
<div class="medium_txt title_form_consultation">
|
||||
{% translate 'НУЖНА КОНСУЛЬТАЦИЯ - ИХ ЕСТЬ У НАС!' %}
|
||||
{{ block.name }}
|
||||
</div>
|
||||
<div class="standart_txt description_form_consultation_txt">
|
||||
{% translate 'Lorem ipsum dolor sit amet consectetur. Rutrum tristique mauris non vitae varius porta quis. Magna adipiscing in turpis pellentesque sit turpis enim condimentum cras. Imperdiet enim feugiat blandit in vitae congue cursus ac.' %}
|
||||
{{ block.description|linebreaksbr }}
|
||||
</div>
|
||||
<button class="button_form_consultation">{% translate 'Отправить запрос' %}</button>
|
||||
<button class="button_form_consultation">{{ block.but_title }}</button>
|
||||
</div>
|
||||
<div class="form_consultation_content">
|
||||
<input class="input_form_consultation" id="id_name" name="name" placeholder="{% translate 'Имя' %}">
|
||||
|
||||
Reference in New Issue
Block a user