You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
docuseal/app/views/personalization_settings/_ui_visibility_form.html.erb

34 lines
1.4 KiB

<div class="space-y-2">
<p class="text-4xl font-bold mb-4 mt-8"><%= t('ui_visibility') %></p>
<% [
[AccountConfig::SHOW_CONSOLE_LINK_KEY, t('show_console_link')],
[AccountConfig::SHOW_API_LINK_KEY, t('show_api_link')],
[AccountConfig::SHOW_TEST_MODE_KEY, t('show_test_mode')]
].each do |key, label| %>
<% env_var_name = "DOCUSEAL_CONFIG_#{key.upcase}" %>
<% locked = ENV.fetch(env_var_name, nil).present? %>
<% current = current_account.ui_visible?(key, default: true) %>
<%= form_for(AccountConfig.new,
url: settings_personalization_index_path,
method: :post,
html: { class: 'flex items-center justify-between py-1' }) do |f| %>
<%= f.hidden_field :key, value: key %>
<%= f.hidden_field :value, value: current ? 'false' : 'true' %>
<label class="flex items-center space-x-3 flex-grow"
<%= "title=\"#{t('locked_by_env')}\"".html_safe if locked %>>
<submit-form data-on="change" class="flex">
<input type="checkbox"
class="toggle toggle-sm"
<%= 'checked' if current %>
<%= 'disabled' if locked %>
onchange="this.form.submit()">
</submit-form>
<span class="text-base"><%= label %></span>
<% if locked %>
<span class="text-xs text-base-content/60">(<%= t('locked_by_env') %>)</span>
<% end %>
</label>
<% end %>
<% end %>
</div>