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