adjust template preferences

pull/267/head
Pete Matsyburka 2 years ago
parent 7adeaf93cd
commit 859892d1fd

@ -37,7 +37,7 @@
</div>
<% if !template.archived_at? %>
<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">
<%= 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">

@ -1,5 +1,8 @@
<%= 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">
<div class="join">
<% options.each_with_index do |(label, value), index| %>
@ -12,6 +15,7 @@
<% end %>
</div>
</toggle-visible>
<% end %>
<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| %>
<toggle-on-submit data-element-id="email_saved_alert"></toggle-on-submit>
@ -62,6 +66,7 @@
<% end %>
<%= render 'templates_code_modal/preferences' %>
</div>
<% if show_api %>
<div id="api" class="hidden mt-2 mb-4 px-5">
<div>
<label class="text-sm font-semibold" for="template_id">
@ -97,4 +102,5 @@
</div>
<% end %>
</div>
<% end %>
<% end %>

Loading…
Cancel
Save