enforce order toggle
This commit is contained in:
committed by
Oleksandr Turchyn
parent
7e537e4232
commit
fd7d0eaf53
@@ -24,6 +24,7 @@ class TemplatesPreferencesController < ApplicationController
|
||||
documents_copy_email_enabled documents_copy_email_attach_audit
|
||||
completed_notification_email_attach_documents
|
||||
completed_redirect_url
|
||||
submitters_order
|
||||
completed_notification_email_subject completed_notification_email_body
|
||||
completed_notification_email_enabled completed_notification_email_attach_audit] +
|
||||
[completed_message: %i[title body]]
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<% if template.submitters.size > 1 %>
|
||||
<% if template.preferences['submitters_order'] == 'preserved' %>
|
||||
<%= f.hidden_field :preserve_order, value: '1' %>
|
||||
<% elsif template.submitters.size > 1 %>
|
||||
<div class="form-control">
|
||||
<%= f.label :preserve_order, for: uuid = SecureRandom.uuid, class: 'flex items-center cursor-pointer' do %>
|
||||
<%= f.check_box :preserve_order, id: uuid, class: 'base-checkbox', checked: template.submissions.last&.submitters_order.in?(['preserved', nil]) %>
|
||||
|
||||
@@ -256,10 +256,20 @@
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="form-control mt-6 pb-2">
|
||||
<%= f.button button_title(title: t('save'), disabled_with: t('updating')), class: 'base-button' %>
|
||||
<% end %>
|
||||
<%= form_for @template, url: template_preferences_path(@template), method: :post, html: { autocomplete: 'off', class: 'mt-2' }, data: { close_on_submit: false } do |f| %>
|
||||
<div class="flex items-center pt-4 mt-4 justify-between border-t w-full">
|
||||
<span>
|
||||
<%= t('enforce_recipients_order') %>
|
||||
</span>
|
||||
<%= f.fields_for :preferences, Struct.new(:submitters_order).new(@template.preferences['submitters_order']) do |ff| %>
|
||||
<%= ff.check_box :submitters_order, { class: 'toggle', onchange: 'this.form.requestSubmit()' }, 'preserved', '' %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="form-control mt-5 pb-2">
|
||||
<%= button_tag button_title(title: t('save'), disabled_with: t('updating')), class: 'base-button', form: :submitters_form %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if show_api %>
|
||||
@@ -285,7 +295,7 @@
|
||||
<%= render 'templates_code_modal/placeholder' %>
|
||||
<%= render 'templates/embedding', template: @template %>
|
||||
<% if can?(:manage, TemplateSharing.new(template: @template)) %>
|
||||
<%= form_for '', url: template_sharings_testing_index_path, method: :post, html: { class: 'mt-1' } do |f| %>
|
||||
<%= form_for '', url: template_sharings_testing_index_path, method: :post, html: { class: 'mt-1' }, data: { close_on_submit: false } do |f| %>
|
||||
<%= f.hidden_field :template_id, value: @template.id %>
|
||||
<div class="flex items-center justify-between">
|
||||
<span>
|
||||
|
||||
@@ -72,6 +72,7 @@ en: &en
|
||||
reason: Reason
|
||||
provide_your_email_to_start: Provide your email to start
|
||||
start: Start
|
||||
enforce_recipients_order: Enforce recipients order
|
||||
starting: Starting
|
||||
form_has_been_deleted_by_html: 'Form has been deleted by <span class="font-semibold">%{name}</span>.'
|
||||
invited_by_html: 'Invited by <span class="font-semibold">%{name}</span>'
|
||||
|
||||
Reference in New Issue
Block a user