From 8636b7854c3604e06236473f8de97dc12da745cb Mon Sep 17 00:00:00 2001 From: erjemin Date: Fri, 2 Jan 2026 20:11:12 +0300 Subject: [PATCH] =?UTF-8?q?mod:=20=D0=BD=D0=B0=D1=81=D1=82=D1=80=D0=BE?= =?UTF-8?q?=D0=B9=D0=BA=D0=B8=20=D1=82=D0=B8=D0=BF=D0=BE=D0=B3=D1=80=D0=B0?= =?UTF-8?q?=D1=84=D0=B0=20(06)=20=D1=80=D0=B5=D0=B6=D0=B8=D0=BC=D1=8B=20la?= =?UTF-8?q?yout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../typograph/templates/typograph/index.html | 32 +++++++++++++------ etpgrf_site/typograph/views.py | 11 ++++++- 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/etpgrf_site/typograph/templates/typograph/index.html b/etpgrf_site/typograph/templates/typograph/index.html index 4604528..1a2615d 100644 --- a/etpgrf_site/typograph/templates/typograph/index.html +++ b/etpgrf_site/typograph/templates/typograph/index.html @@ -7,8 +7,7 @@
{% csrf_token %} - -
+ {# ГЛАВНОЕ ПОЛЕ ВВОДА: ТЕКСТ ДЛЯ ФОТОГРАФИРОВАНИЯ #}
@@ -55,22 +54,37 @@
- -
+ {# Группа "Компоновка и отбивка" (Layout) #}
-
+ + +
- - + +
-
- + + +
+ + + +
+ +
+ + +
+ Обработка тире, чисел, инициалов, сокращений и единиц измерения отключена. +
diff --git a/etpgrf_site/typograph/views.py b/etpgrf_site/typograph/views.py index 8c708e2..c74ea24 100644 --- a/etpgrf_site/typograph/views.py +++ b/etpgrf_site/typograph/views.py @@ -18,11 +18,20 @@ def process_text(request): layout_option = False # По умолчанию выключен if layout_enabled: + # Обработка единиц измерения + process_units = request.POST.get('layout_units') == 'on' + if process_units: + # Если включено, проверяем кастомные единицы + custom_units = request.POST.get('layout_units_custom', '').strip() + if custom_units: + # Если есть кастомные, передаем их списком (библиотека сама объединит с дефолтными) + process_units = custom_units.split() + # Если включен, создаем процессор с тонкими настройками layout_option = LayoutProcessor( langs=langs, process_initials_and_acronyms=request.POST.get('layout_initials') == 'on', - process_units=request.POST.get('layout_units') == 'on' + process_units=process_units ) # 3. Читаем Sanitizer