adjust template preferences
This commit is contained in:
@@ -37,7 +37,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<% if !template.archived_at? %>
|
<% if !template.archived_at? %>
|
||||||
<div class="flex items-center space-x-2">
|
<div class="flex items-center space-x-2">
|
||||||
<% if can?(:update, template) && (Docuseal.multitenant? || current_account.testing? || current_account.id == 1) %>
|
<% if can?(:update, template) %>
|
||||||
<div class="tooltip" data-tip="Preferences">
|
<div class="tooltip" data-tip="Preferences">
|
||||||
<%= 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 %>
|
<%= 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 %>
|
||||||
<span class="flex items-center justify-center space-x-2">
|
<span class="flex items-center justify-center space-x-2">
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
<%= render 'shared/turbo_modal_large', 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']] %>
|
<% show_api = Docuseal.multitenant? || current_account.testing? || !current_account.linked_account_account %>
|
||||||
|
<% options = [%w[General general]] %>
|
||||||
|
<% options << ['API and Embedding', 'api'] if show_api %>
|
||||||
|
<% if options.size > 1 %>
|
||||||
<toggle-visible data-element-ids="<%= options.map(&:last).to_json %>" class="relative text-center mt-3 block">
|
<toggle-visible data-element-ids="<%= options.map(&:last).to_json %>" class="relative text-center mt-3 block">
|
||||||
<div class="join">
|
<div class="join">
|
||||||
<% options.each_with_index do |(label, value), index| %>
|
<% options.each_with_index do |(label, value), index| %>
|
||||||
@@ -12,6 +15,7 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</toggle-visible>
|
</toggle-visible>
|
||||||
|
<% end %>
|
||||||
<div id="general" class="px-5 mb-4">
|
<div id="general" class="px-5 mb-4">
|
||||||
<%= form_for @template, url: template_preferences_path(@template), method: :post, html: { autocomplete: 'off', class: 'mt-1' } do |f| %>
|
<%= form_for @template, url: template_preferences_path(@template), method: :post, html: { autocomplete: 'off', class: 'mt-1' } do |f| %>
|
||||||
<toggle-on-submit data-element-id="email_saved_alert"></toggle-on-submit>
|
<toggle-on-submit data-element-id="email_saved_alert"></toggle-on-submit>
|
||||||
@@ -62,6 +66,7 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
<%= render 'templates_code_modal/preferences' %>
|
<%= render 'templates_code_modal/preferences' %>
|
||||||
</div>
|
</div>
|
||||||
|
<% if show_api %>
|
||||||
<div id="api" class="hidden mt-2 mb-4 px-5">
|
<div id="api" class="hidden mt-2 mb-4 px-5">
|
||||||
<div>
|
<div>
|
||||||
<label class="text-sm font-semibold" for="template_id">
|
<label class="text-sm font-semibold" for="template_id">
|
||||||
@@ -98,3 +103,4 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
|||||||
Reference in New Issue
Block a user