From 1b21b0c65b2ef28417e59d28fedb2aaafef77d90 Mon Sep 17 00:00:00 2001 From: Pete Matsyburka Date: Tue, 22 Sep 2026 17:44:19 +0300 Subject: [PATCH] adjust ui --- app/controllers/template_folders_controller.rb | 4 ++-- app/controllers/templates_dashboard_controller.rb | 4 ++-- app/javascript/template_builder/contenteditable.vue | 13 +++++++++---- app/javascript/template_builder/field.vue | 1 + 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/app/controllers/template_folders_controller.rb b/app/controllers/template_folders_controller.rb index 3a305e3b0..17fbc806f 100644 --- a/app/controllers/template_folders_controller.rb +++ b/app/controllers/template_folders_controller.rb @@ -62,7 +62,7 @@ class TemplateFoldersController < ApplicationController end def render_infinite_scroll(pagy, templates, template_folders) - rendering = + render_params = if templates.present? { partial: 'templates/template', collection: templates } else @@ -70,7 +70,7 @@ class TemplateFoldersController < ApplicationController end render turbo_stream: [ - turbo_stream.before('infinite_scroll', **rendering), + turbo_stream.before('infinite_scroll', **render_params), turbo_stream.replace('infinite_scroll', partial: 'shared/infinite_scroll', locals: { pagy: }) ] end diff --git a/app/controllers/templates_dashboard_controller.rb b/app/controllers/templates_dashboard_controller.rb index faedcdfdb..32ca3fe39 100644 --- a/app/controllers/templates_dashboard_controller.rb +++ b/app/controllers/templates_dashboard_controller.rb @@ -50,7 +50,7 @@ class TemplatesDashboardController < ApplicationController private def render_infinite_scroll(pagy, templates, template_folders) - rendering = + render_params = if templates.present? { partial: 'templates/template', collection: templates } else @@ -58,7 +58,7 @@ class TemplatesDashboardController < ApplicationController end render turbo_stream: [ - turbo_stream.before('infinite_scroll', **rendering), + turbo_stream.before('infinite_scroll', **render_params), turbo_stream.replace('infinite_scroll', partial: 'shared/infinite_scroll', locals: { pagy: }) ] end diff --git a/app/javascript/template_builder/contenteditable.vue b/app/javascript/template_builder/contenteditable.vue index 7836e29ac..306da7248 100644 --- a/app/javascript/template_builder/contenteditable.vue +++ b/app/javascript/template_builder/contenteditable.vue @@ -10,7 +10,7 @@ :data-placeholder="placeholder" :data-empty="isEmpty" :style="{ minWidth }" - :class="[iconInline ? (isEmpty ? 'inline-block' : 'inline') : 'block', hideIcon ? 'focus:block' : '', { 'py-2 -my-2': isMobile && iconInline && !isEmpty }]" + :class="[iconInline ? (isEmpty ? 'inline-block' : 'inline') : 'block', hideIcon ? 'focus:block' : '', contenteditableClasses]" class="peer relative inline-block outline-none before:pointer-events-none before:absolute before:left-0 before:top-0 before:select-none before:whitespace-pre before:text-neutral-400 before:content-[attr(data-placeholder)] before:opacity-0 data-[empty=true]:before:opacity-100" @paste.prevent="onPaste" @keydown.enter.prevent="blurContenteditable" @@ -23,15 +23,15 @@ {{ value }}