0.0.31 page schemes

This commit is contained in:
SDE
2023-12-06 12:58:04 +03:00
parent 5937d9e380
commit 183000c979
12 changed files with 104 additions and 39 deletions

View File

@@ -0,0 +1,18 @@
# Generated by Django 4.2.7 on 2023-12-06 12:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('GeneralApp', '0015_option_name_en_option_name_ru_option_prefix_en_and_more'),
]
operations = [
migrations.AlterField(
model_name='block',
name='block_type',
field=models.CharField(choices=[('photo_n_text', 'Фото с одной стороны + Текст с другой стороны'), ('main_block_w_subblocks', 'Блок с подблоками'), ('present_technology_block', 'описание и НАЗВАНИЕ слева + Картинка справа'), ('photo150_n_title', 'Фото 150x150 сверху + заголовок под фото'), ('how_work', 'Как с нами работать'), ('how_dev', 'Как ведется разработка'), ('feedback_form', 'Форма обратной связи')], default='photo_n_text', max_length=100, verbose_name='Тип блока'),
),
]

View File

@@ -49,7 +49,7 @@ class Admin_Section(SuperModelAdmin, Admin_Trans_BaseModelViewPage):
fieldsets = [
(None, {
'classes': ['wide'],
'fields': ('name',
'fields': ('name', 'page_scheme',
'url',
'title',
'description', 'text',

View File

@@ -8,11 +8,15 @@ def get_sections():
def get_section_views_Dict(section):
services = section.rel_services_for_section.filter(enable=True).order_by('order')
services_view_scheme = '2_cols_wo_group'
for service in services:
if service.rel_children_for_service.filter(enable=True):
services_view_scheme = '3_cols_w_group'
break
services_view_scheme = None
if services:
services_view_scheme = '2_cols_wo_group'
for service in services:
if service.rel_children_for_service.filter(enable=True):
services_view_scheme = '3_cols_w_group'
break
Dict = {
'sections': get_sections(),

View File

@@ -0,0 +1,18 @@
# Generated by Django 4.2.7 on 2023-12-06 12:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ServicesApp', '0006_alter_blockpluginpresentation_options'),
]
operations = [
migrations.AddField(
model_name='section',
name='page_scheme',
field=models.CharField(choices=[('projecting', 'Проектирование'), ('services', 'Разработка'), ('plugin', 'Плагин')], default='projecting', max_length=100, verbose_name='Схема страницы'),
),
]

View File

@@ -43,8 +43,18 @@ def preSave_BlockPluginPresentation(sender, instance, **kwargs):
pre_save.connect(preSave_BlockPluginPresentation, sender=BlockPluginPresentation, dispatch_uid='pre_save_connect')
page_scheme_choices = (
('projecting', _('Проектирование')),
('services', _('Разработка')),
('plugin', _('Плагин')),
)
class Section(BaseModelViewPage):
page_scheme = models.CharField(
max_length=100, verbose_name=_('Схема страницы'), choices=page_scheme_choices, default='projecting')
plugin_presentation = GenericRelation('ServicesApp.BlockPluginPresentation',
related_query_name='grel_%(class)s_for_block_plugin_presentation')

View File

@@ -1,13 +1,11 @@
{#{% include 'blocks/dynamic/b_sections_buttons.html' %}#}
{#{% if services_view_scheme == '3_cols_w_group' %}#}
{# {% include 'blocks/b_service.html' %}#}
{# {% include 'blocks/b_services_3cols_w_groups.html' %}#}
{#{% elif services_view_scheme == '2_cols_wo_group' %}#}
{# {% include 'blocks/b_service_2_col.html' %}#}
{# {% include 'blocks/b_services_2_col_wo_group.html' %}#}
{#{% endif %}#}
{% if page.url == '3d-security-designer' and page.plugin_presentation.all %}
{% include 'blocks/b_3d_s_d.html' with block=page.plugin_presentation.all.0 %}
{% endif %}
{#{% include 'blocks/b_how_with_us_working.html' %}#}
@@ -27,7 +25,5 @@
{% endif %}
{% endfor %}
{% if page.url != '3d-security-designer' and page.plugin_presentation.all %}
{% include 'blocks/b_3d_s_d.html' with block=page.plugin_presentation.all.0 %}
{% endif %}

View File

@@ -1,32 +1,25 @@
{% include 'blocks/dynamic/b_sections_buttons.html' %}
<div class="cut-width">
{% if page.description %}
<div class="description_page standart_txt">{{ page.description }}</div>
{% endif %}
{% if page.title %}
<div class="title_page standart_txt">{{ page.title }}</div>
{% if page.description or page.title %}
<div style="padding-top: 40px;">
{% if page.description %}
<div class="description_page standart_txt">{{ page.description }}</div>
{% endif %}
{% if page.title %}
<div class="title_page standart_txt">{{ page.title }}</div>
{% endif %}
</div>
{% endif %}
</div>
{% if services_view_scheme == '3_cols_w_group' %}
{% include 'blocks/b_service.html' %}
{% elif services_view_scheme == '2_cols_wo_group' %}
{% include 'blocks/b_service_2_col.html' %}
{% if page.page_scheme == 'projecting' %}
{% include "pages/page_schemes/ps_projecting.html" %}
{% elif page.page_scheme == 'services' %}
{% include "pages/page_schemes/ps_services.html" %}
{% elif page.page_scheme == 'plugin' %}
{% include "pages/page_schemes/ps_plugin.html" %}
{% endif %}
{% include "pages/content/c_blocks_constructor.html" %}
{#{% for block in page.blocks.all %}#}
{# {% if block.block_type == 'photo150_n_title' %}#}
{# {% include 'blocks/b_photo150_n_title.html' %}#}
{# {% elif block.block_type == 'how_work' %}#}
{# {% include 'blocks/b_how_with_us_working.html' %}#}
{# {% elif block.block_type == 'feedback_form' %}#}
{# {% include 'forms/f_consultation.html' %}#}
{# {% elif block.block_type == 'how_dev' %}#}
{# {% include 'blocks/b_how_dev.html' %}#}
{# {% endif %}#}
{##}
{#{% endfor %}#}
{#{% if page.plugin_presentation.all %}#}
{# {% include 'blocks/b_3d_s_d.html' with block=page.plugin_presentation.all.0 %}#}
{#{% endif %}#}

View File

@@ -0,0 +1,8 @@
{% if page.plugin_presentation.all %}
{% include 'blocks/b_3d_s_d.html' with block=page.plugin_presentation.all.0 %}
{% endif %}
{% include "pages/content/c_blocks_constructor.html" %}
{% include 'blocks/b_services_2_col_wo_group.html' %}

View File

@@ -0,0 +1,9 @@
{% include 'blocks/b_services_3cols_w_groups.html' %}
{% if page.plugin_presentation.all %}
{% include 'blocks/b_3d_s_d.html' with block=page.plugin_presentation.all.0 %}
{% endif %}
{% include "pages/content/c_blocks_constructor.html" %}

View File

@@ -0,0 +1,9 @@
{% include 'blocks/b_services_2_col_wo_group.html' %}
{% if page.plugin_presentation.all %}
{% include 'blocks/b_3d_s_d.html' with block=page.plugin_presentation.all.0 %}
{% endif %}
{% include "pages/content/c_blocks_constructor.html" %}