Files
docuseal/app/views/shared/_settings_nav.html.erb
T

167 lines
8.3 KiB
Plaintext
Raw Normal View History

2026-07-23 14:31:53 +03:00
<% expanded = local_assigns[:expanded] %>
<% unless expanded %>
<div class="md:hidden w-full">
<a href="<%= settings_index_path %>" class="flex items-center space-x-0.5 font-medium">
<%= svg_icon('arrow_left', class: 'w-4 h-4 stroke-2') %>
<span><%= t('settings') %></span>
</a>
</div>
<% end %>
<div class="<%= expanded ? 'block max-md:-mx-3' : 'hidden md:block w-full md:w-52 flex-none' %>">
2023-07-04 23:37:40 +03:00
<menu-active>
2025-02-21 23:56:18 +02:00
<ul id="account_settings_menu" class="menu px-0">
2026-07-23 14:31:53 +03:00
<% unless expanded %>
<li class="menu-title py-0 !bg-transparent mb-3 -mt-5">
<a href="<%= root_path %>" class="!bg-transparent !text-neutral font-medium flex items-center space-x-0.5">
<%= svg_icon('arrow_left', class: 'w-4 h-4 stroke-2') %>
<span><%= t('back') %></span>
</a>
</li>
<% end %>
2024-09-18 19:47:47 +03:00
<li class="menu-title py-0 !bg-transparent">
<span class="!bg-transparent"><%= t('settings') %></span>
</li>
2023-05-30 00:55:14 +03:00
<li></li>
<li>
2024-09-18 19:47:47 +03:00
<%= link_to t('profile'), settings_profile_index_path, class: 'text-base hover:bg-base-300' %>
2023-05-30 00:55:14 +03:00
</li>
2023-06-30 01:26:13 +03:00
<li>
2024-09-18 19:47:47 +03:00
<%= link_to t('account'), settings_account_path, class: 'text-base hover:bg-base-300' %>
2023-06-30 01:26:13 +03:00
</li>
2026-07-13 10:19:47 +03:00
<% if (!Docuseal.multitenant? || EncryptedConfig.exists?(key: EncryptedConfig::EMAIL_SMTP_KEY, account: current_account)) && can?(:read, EncryptedConfig.new(key: EncryptedConfig::EMAIL_SMTP_KEY, account: current_account)) && ENV['SMTP_ADDRESS'].blank? && true_user == current_user %>
<li>
<%= link_to t('email'), settings_email_index_path, class: 'text-base hover:bg-base-300' %>
</li>
<% end %>
2023-06-30 20:31:17 +03:00
<% unless Docuseal.multitenant? %>
2026-03-03 22:01:44 +02:00
<% if can?(:read, EncryptedConfig.new(key: EncryptedConfig::FILES_STORAGE_KEY, account: current_account)) && true_user == current_user && ENV['S3_ATTACHMENTS_BUCKET'].blank? && ENV['GCS_BUCKET'].blank? && ENV['AZURE_CONTAINER'].blank? %>
2023-09-17 00:45:57 +03:00
<li>
2024-09-18 19:47:47 +03:00
<%= link_to t('storage'), settings_storage_index_path, class: 'text-base hover:bg-base-300' %>
2023-09-17 00:45:57 +03:00
</li>
<% end %>
2024-01-20 23:53:14 +02:00
<% if can?(:read, EncryptedConfig.new(key: 'submitter_invitation_sms', account: current_account)) && true_user == current_user %>
2023-09-17 00:45:57 +03:00
<li>
<%= link_to 'SMS', settings_sms_path, class: 'text-base hover:bg-base-300' %>
</li>
<% end %>
<% end %>
2023-09-17 20:38:09 +03:00
<% if can?(:read, AccountConfig) %>
<li>
2024-09-18 19:47:47 +03:00
<%= link_to t('notifications'), settings_notifications_path, class: 'text-base hover:bg-base-300' %>
2023-09-17 20:38:09 +03:00
</li>
<% end %>
2023-09-17 00:45:57 +03:00
<% if can?(:read, EncryptedConfig.new(key: EncryptedConfig::ESIGN_CERTS_KEY, account: current_account)) %>
2023-06-30 20:31:17 +03:00
<li>
2024-09-18 19:47:47 +03:00
<%= link_to t('e_signature'), settings_esign_path, class: 'text-base hover:bg-base-300' %>
2023-06-30 20:31:17 +03:00
</li>
2023-09-17 00:45:57 +03:00
<% end %>
2024-04-28 10:27:44 +03:00
<% if can?(:read, AccountConfig) %>
<li>
2024-09-18 19:47:47 +03:00
<%= link_to t('personalization'), settings_personalization_path, class: 'text-base hover:bg-base-300' %>
2024-04-28 10:27:44 +03:00
</li>
<% end %>
2023-09-17 00:45:57 +03:00
<% if can?(:read, User) %>
2023-09-03 14:05:31 +03:00
<li>
2024-09-18 19:47:47 +03:00
<%= link_to t('users'), settings_users_path, class: 'text-base hover:bg-base-300' %>
2023-09-03 14:05:31 +03:00
</li>
2023-06-30 20:31:17 +03:00
<% end %>
2024-04-28 10:27:44 +03:00
<%= render 'shared/settings_nav_extra' %>
2023-08-05 21:39:59 +03:00
<% if Docuseal.demo? || !Docuseal.multitenant? %>
2023-09-17 00:45:57 +03:00
<% if can?(:read, AccessToken) %>
<li>
<%= link_to 'API', settings_api_index_path, class: 'text-base hover:bg-base-300' %>
</li>
<% end %>
2025-09-01 18:19:01 +03:00
<% end %>
<% if Docuseal.demo? || !Docuseal.multitenant? || (current_user != true_user && !current_account.testing?) %>
<% if can?(:read, WebhookUrl) %>
2023-09-17 00:45:57 +03:00
<li>
<%= link_to 'Webhooks', settings_webhooks_path, class: 'text-base hover:bg-base-300' %>
</li>
<% end %>
<% end %>
2024-05-14 23:32:11 +03:00
<% if !Docuseal.demo? && can?(:manage, EncryptedConfig) && (current_user != true_user || !current_account.linked_account_account) %>
2023-10-24 23:16:02 +03:00
<li>
2025-11-24 12:28:13 +02:00
<%= content_for(:pro_link) || link_to(Docuseal.multitenant? ? console_redirect_index_path(redir: "#{Docuseal::CONSOLE_URL}/plans") : "#{Docuseal::CLOUD_URL}/sign_up?#{{ redir: "#{Docuseal::CONSOLE_URL}/on_premises" }.to_query}", class: 'text-base hover:bg-base-300', data: { turbo: false }) do %>
2024-09-18 19:47:47 +03:00
<%= t('plans') %>
2025-07-11 21:19:03 +03:00
<span class="badge badge-warning"><%= t('pro') %></span>
2023-10-24 23:16:02 +03:00
<% end %>
</li>
<% end %>
2025-09-01 18:19:01 +03:00
<% if !Docuseal.demo? && can?(:manage, EncryptedConfig) && (current_user == true_user || current_account.testing?) %>
2023-08-05 21:39:59 +03:00
<li>
2025-11-24 12:28:13 +02:00
<%= link_to Docuseal.multitenant? ? console_redirect_index_path(redir: "#{Docuseal::CONSOLE_URL}#{'/test' if current_account.testing?}/api") : "#{Docuseal::CONSOLE_URL}/on_premises", class: 'text-base hover:bg-base-300', data: { turbo: false } do %>
2024-09-18 19:47:47 +03:00
<% if Docuseal.multitenant? %> API <% else %> <%= t('console') %> <% end %>
2023-08-05 21:39:59 +03:00
<% end %>
</li>
2023-11-11 11:56:54 +02:00
<% if Docuseal.multitenant? %>
<li>
2025-11-24 12:28:13 +02:00
<%= link_to console_redirect_index_path(redir: "#{Docuseal::CONSOLE_URL}#{'/test' if current_account.testing?}/embedding/form"), class: 'text-base hover:bg-base-300', data: { turbo: false } do %>
2024-09-18 19:47:47 +03:00
<%= t('embedding') %>
2023-11-11 11:56:54 +02:00
<% end %>
</li>
<% end %>
2024-04-07 17:12:46 +03:00
<% if (!Docuseal.multitenant? || can?(:manage, :saml_sso)) && can?(:read, EncryptedConfig.new(key: 'saml_configs', account: current_account)) && true_user == current_user %>
2024-04-06 12:56:05 +03:00
<li>
<%= link_to 'SSO', settings_sso_index_path, class: 'text-base hover:bg-base-300' %>
</li>
<% end %>
2026-03-05 12:17:14 +02:00
<% if !Docuseal.multitenant? && can?(:read, McpToken) && can?(:manage, :mcp) %>
<li>
<%= link_to 'MCP', settings_mcp_index_path, class: 'text-base hover:bg-base-300' %>
</li>
<% end %>
2024-06-26 13:34:47 +03:00
<%= render 'shared/settings_nav_extra2' %>
2024-01-20 23:53:14 +02:00
<% if (can?(:manage, EncryptedConfig) && current_user == true_user) || (current_user != true_user && current_account.testing?) %>
2026-04-27 12:13:53 +03:00
<%= form_for '', url: testing_account_path, method: current_account.testing? ? :delete : :post, html: { class: 'w-full' } do |f| %>
<li>
2024-01-20 23:53:14 +02:00
<label class="flex items-center text-base hover:bg-base-300 w-full justify-between" for="testing_toggle">
<span class="mr-2 w-full">
<%= t('test_mode') %>
2024-01-20 23:53:14 +02:00
</span>
2025-09-24 12:07:54 +03:00
<submit-form data-on="change" class="flex">
<%= f.check_box :testing_toggle, class: 'toggle toggle-sm', checked: current_account.testing? %>
</submit-form>
2024-01-20 23:53:14 +02:00
</label>
</li>
<% end %>
2024-01-20 23:53:14 +02:00
<% end %>
2023-08-05 21:39:59 +03:00
<% end %>
2023-05-30 00:55:14 +03:00
</ul>
2023-07-04 23:05:22 +03:00
</menu-active>
2024-01-20 23:53:14 +02:00
<% if Docuseal.multitenant? || cannot?(:manage, :tenants) %>
2026-07-23 14:31:53 +03:00
<div id="support_channels" class="mx-4 border-t border-base-300 <%= 'hidden md:block' unless expanded %>">
2023-10-08 12:04:32 +03:00
<div class="text-sm mt-3">
2024-09-18 19:47:47 +03:00
<%= t('need_help_ask_a_question_') %>
2023-10-08 16:49:09 +03:00
</div>
2023-10-08 12:04:32 +03:00
<div class="flex mt-3 space-x-3">
2026-07-22 18:06:04 +03:00
<div class="tooltip tooltip-no-touch" data-tip="GitHub">
2023-10-08 12:04:32 +03:00
<a href="<%= Docuseal::GITHUB_URL %>" target="_blank" class="btn btn-circle btn-primary btn-md">
<%= svg_icon('brand_github', class: 'w-8 h-8') %>
</a>
</div>
2026-07-22 18:06:04 +03:00
<div class="tooltip tooltip-no-touch" data-tip="<%= t('discord_community') %>">
2023-10-08 12:04:32 +03:00
<a href="<%= Docuseal::DISCORD_URL %>" target="_blank" class="btn btn-circle btn-primary btn-md">
<%= svg_icon('brand_discord', class: 'w-8 h-8') %>
</a>
</div>
2024-08-07 14:34:32 +03:00
<%= capture do %>
2026-07-22 18:06:04 +03:00
<div class="tooltip tooltip-no-touch" data-tip="<%= t('ai_assistant') %>">
2024-06-30 16:21:19 +03:00
<a href="<%= Docuseal::CHATGPT_URL %>" target="_blank" class="btn btn-circle btn-primary btn-md">
2026-07-13 17:16:42 +03:00
<%= svg_icon('message', class: 'w-8 h-8') %>
2024-06-30 16:21:19 +03:00
</a>
</div>
<% end %>
2023-10-08 16:49:09 +03:00
</div>
2023-10-08 12:04:32 +03:00
<a href="mailto:<%= Docuseal::SUPPORT_EMAIL %>" target="_blank" class="w-full block mt-4 underline text-center">
<%= Docuseal::SUPPORT_EMAIL %>
</a>
2026-01-13 12:17:03 +02:00
<% if Docuseal.version.present? && !Docuseal.multitenant? && can?(:manage, EncryptedConfig) %>
2024-01-07 14:25:38 +02:00
<a href="https://github.com/docusealco/docuseal/releases" target="_blank" class="badge badge-outline text-xs block mx-auto mt-4">
2024-01-06 22:58:26 +02:00
v<%= Docuseal.version %>
</a>
<% end %>
2023-07-04 23:05:22 +03:00
</div>
2023-10-08 12:04:32 +03:00
<% end %>
2023-07-04 23:05:22 +03:00
</div>