diff --git a/app/javascript/elements/autoresize_textarea.js b/app/javascript/elements/autoresize_textarea.js index 470f7a39..8fd25801 100644 --- a/app/javascript/elements/autoresize_textarea.js +++ b/app/javascript/elements/autoresize_textarea.js @@ -7,7 +7,7 @@ export default class extends HTMLElement { resize () { if (this.textarea.clientHeight < this.textarea.scrollHeight) { - this.textarea.style.height = `${this.textarea.scrollHeight}px` + this.textarea.style.height = `${this.textarea.scrollHeight + 5}px` } } diff --git a/app/views/shared/_turbo_modal_large.html.erb b/app/views/shared/_turbo_modal_large.html.erb new file mode 100644 index 00000000..7a1c841d --- /dev/null +++ b/app/views/shared/_turbo_modal_large.html.erb @@ -0,0 +1,18 @@ + + +
+
+ <% if local_assigns[:title] %> +
+ + <%= local_assigns[:title] %> + + × +
+ <% end %> +
+ <%= yield %> +
+
+
+
diff --git a/app/views/templates/_title.html.erb b/app/views/templates/_title.html.erb index 2394a143..fce98283 100644 --- a/app/views/templates/_title.html.erb +++ b/app/views/templates/_title.html.erb @@ -39,7 +39,7 @@
<% if can?(:update, template) && (Docuseal.multitenant? || current_account.testing? || current_account.id == 1) %>
- <%= link_to template_preferences_path(template), class: 'btn border border-base-200 bg-base-200 hover:bg-base-300 hover:border-base-300 btn-sm flex-1 hidden md:flex', data: { turbo_frame: :drawer } do %> + <%= link_to template_preferences_path(template), class: 'btn border border-base-200 bg-base-200 hover:bg-base-300 hover:border-base-300 btn-sm flex-1 hidden md:flex', data: { turbo_frame: :modal } do %> <%= svg_icon('adjustments_horizontal', class: 'w-6 h-6') %> diff --git a/app/views/templates_preferences/show.html.erb b/app/views/templates_preferences/show.html.erb index 6d1861a1..2ab3093f 100644 --- a/app/views/templates_preferences/show.html.erb +++ b/app/views/templates_preferences/show.html.erb @@ -1,4 +1,4 @@ -<%= render 'shared/turbo_drawer', title: 'Preferences', close_after_submit: false do %> +<%= render 'shared/turbo_modal_large', title: 'Preferences', close_after_submit: false do %> <% options = [['General', 'general'], ['API and Embedding', 'api']] %>
@@ -12,7 +12,7 @@ <% end %>
-
+
<%= form_for @template, url: template_preferences_path(@template), method: :post, html: { autocomplete: 'off', class: 'mt-1' } do |f| %> <%= f.fields_for :preferences, Struct.new(:request_email_subject, :request_email_body).new(*(@template.preferences.values_at('request_email_subject', 'request_email_body').compact_blank.presence || AccountConfigs.find_or_initialize_for_key(current_account, AccountConfig::SUBMITTER_INVITATION_EMAIL_KEY).value.values_at('subject', 'body'))) do |ff| %> @@ -62,7 +62,7 @@ <% end %> <%= render 'templates_code_modal/preferences' %>
-