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

110 lines
5.7 KiB
Plaintext
Raw Normal View History

2025-01-21 13:05:12 +02:00
<%= render 'shared/navbar_warning' %>
2023-06-01 01:13:12 +03:00
<div class="max-w-6xl mb-4 mx-auto px-4 md:px-2 py-3 flex items-center justify-between">
2023-07-04 23:05:22 +03:00
<div class="flex items-center space-x-4">
<a href="<%= root_path %>" class="text-2xl font-bold items-center flex space-x-2">
2023-10-08 12:04:32 +03:00
<%= render 'shared/title' %>
2023-07-04 23:05:22 +03:00
</a>
2023-10-30 23:03:52 +02:00
<span class="hidden sm:inline">
2025-07-11 21:19:03 +03:00
<%= render 'shared/github' if request.path.starts_with?('/settings') %>
2023-10-30 23:03:52 +02:00
</span>
2023-07-04 23:05:22 +03:00
</div>
2023-05-29 21:20:39 +03:00
<% if signed_in? %>
2023-07-12 01:24:25 +03:00
<div class="space-x-4 flex items-center">
<% if Docuseal.demo? %>
2024-10-26 09:54:41 +03:00
<a href="https://docuseal.com/sign_up" class="btn btn-neutral btn-sm btn-outline inline-flex items-center justify-center" style="height: 37px">
2024-06-08 23:02:29 +03:00
<%= t('sign_up') %>
2023-10-14 21:19:21 +03:00
</a>
<span class="hidden sm:inline">
<%= render 'shared/github_button' %>
</span>
2023-07-12 01:24:25 +03:00
<% else %>
2023-08-19 23:58:10 +03:00
<div class="flex items-center justify-center space-x-4 mr-1">
2023-11-05 14:03:24 +02:00
<%= render 'shared/navbar_buttons' %>
2025-02-21 23:56:18 +02:00
<%= link_to t('settings'), settings_profile_index_path, class: 'hidden md:inline-flex font-medium text-lg', id: 'account_settings_button' %>
2023-08-19 23:58:10 +03:00
</div>
2023-07-12 01:24:25 +03:00
<% end %>
2023-07-02 00:14:26 +03:00
<div class="dropdown dropdown-end">
2023-06-29 02:04:17 +03:00
<label tabindex="0" class="cursor-pointer bg-base-content text-purple-300 rounded-full p-2 w-9 justify-center flex">
2023-05-30 21:03:47 +03:00
<span class="text-sm align-text-top"><%= current_user.initials %></span>
2023-05-29 23:26:17 +03:00
</label>
2024-09-28 01:21:35 +03:00
<ul tabindex="0" class="z-10 dropdown-content p-2 mt-2 shadow menu text-base bg-base-100 rounded-box min-w-[160px] text-right">
2026-07-23 14:31:53 +03:00
<li class="md:hidden">
<%= link_to settings_index_path, class: 'flex items-center' do %>
<%= svg_icon('settings', class: 'w-5 h-5 flex-shrink-0 stroke-2') %>
<span class="mr-1"><%= t('settings') %></span>
<% end %>
</li>
<li class="max-md:hidden">
2023-08-19 23:58:10 +03:00
<%= link_to settings_profile_index_path, class: 'flex items-center' do %>
2024-05-22 15:12:33 +03:00
<%= svg_icon('adjustments', class: 'w-5 h-5 flex-shrink-0 stroke-2') %>
2024-09-18 19:47:47 +03:00
<span class="mr-1"><%= t('profile') %></span>
2023-07-02 13:30:11 +00:00
<% end %>
2023-05-29 23:26:17 +03:00
</li>
2023-10-08 12:04:32 +03:00
<% if !Docuseal.demo? && can?(:manage, EncryptedConfig) %>
2023-08-19 23:58:10 +03:00
<li>
<%= link_to Docuseal.multitenant? ? console_redirect_index_path : Docuseal::CONSOLE_URL, data: { prefetch: false }, class: 'flex items-center' do %>
2024-09-23 15:22:07 +03:00
<%= svg_icon('terminal', class: 'w-5 h-5 flex-shrink-0 stroke-2') %>
2024-09-18 19:47:47 +03:00
<%= t('console') %>
2023-08-19 23:58:10 +03:00
<% end %>
</li>
<% end %>
2023-10-08 12:04:32 +03:00
<% if can?(:read, EncryptedConfig.new(key: EncryptedConfig::ESIGN_CERTS_KEY, account: current_account)) %>
<li>
<%= link_to settings_esign_path, class: 'flex items-center' do %>
2024-09-23 15:22:07 +03:00
<%= svg_icon('zoom_check', class: 'w-5 h-5 flex-shrink-0 stroke-2') %>
2024-09-28 01:21:35 +03:00
<span class="mr-1 whitespace-nowrap"><%= t('verify_pdf') %></span>
2023-10-08 12:04:32 +03:00
<% end %>
</li>
<% end %>
2025-04-15 21:40:22 +03:00
<% if Docuseal.multitenant? || current_user.role == 'superadmin' %>
<li>
<%= link_to Docuseal::CHATGPT_URL, target: 'blank', class: 'flex items-center' do %>
<%= svg_icon('sparkles', class: 'w-5 h-5 flex-shrink-0 stroke-2') %>
<span class="mr-1 whitespace-nowrap"><%= t('ask_ai') %></span>
<% end %>
</li>
<% end %>
<% 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 py-1' } do |f| %>
<label class="flex items-center pl-6 pr-4 py-2 border-y border-base-300 -ml-2 -mr-2" for="testing_toggle">
2025-09-24 12:07:54 +03:00
<submit-form data-on="change" class="flex">
<%= f.check_box :testing_toggle, class: 'toggle', checked: current_account.testing?, style: 'height: 0.885rem; width: 1.35rem; --handleoffset: 0.395rem; margin-left: -2px; margin-right: 8px' %>
</submit-form>
<span class="whitespace-nowrap">
<%= t('test_mode') %>
</span>
</label>
<% end %>
<% end %>
2023-08-19 23:58:10 +03:00
<li>
<button form="destroy_user_session_form">
<%= svg_icon('logout', class: 'w-5 h-5 flex-shrink-0 stroke-2 inline') %>
<span class="whitespace-nowrap"><%= t('sign_out') %></span>
</button>
2026-07-18 00:32:09 +03:00
<%= button_to '', destroy_user_session_path, method: :delete, form: { id: 'destroy_user_session_form', data: { turbo: false } }, form_class: 'hidden' %>
2023-05-29 23:26:17 +03:00
</li>
</ul>
</div>
2023-05-29 21:20:39 +03:00
</div>
2023-06-19 21:44:41 +00:00
<% else %>
2023-10-15 00:58:03 +03:00
<div class="flex space-x-2">
2025-07-12 11:16:14 +03:00
<% if request.path != new_user_session_path && request.path != setup_index_path %>
2024-06-08 23:02:29 +03:00
<%= link_to new_user_session_path({ lang: params[:lang] }.compact_blank), class: 'font-medium text-lg' do %>
2023-10-15 00:58:03 +03:00
<span class="flex items-center justify-center space-x-1">
<%= svg_icon('login', class: 'w-6 h-6') %>
2024-06-08 23:02:29 +03:00
<span><%= t('sign_in') %></span>
2023-10-15 00:58:03 +03:00
</span>
<% end %>
2023-07-16 16:15:37 +03:00
<% end %>
2023-10-16 20:19:39 +03:00
<% if Docuseal.multitenant? && !request.path.in?([registration_path, new_registration_path]) %>
2024-06-08 23:02:29 +03:00
<%= link_to registration_path({ lang: params[:lang] }.compact_blank), class: 'btn btn-neutral btn-sm btn-outline' do %>
2023-07-16 16:15:37 +03:00
<span class="flex items-center justify-center space-x-1">
2024-09-18 19:47:47 +03:00
<span class="hidden sm:block capitalize"><%= t('create_free_account') %></span>
2024-06-08 23:02:29 +03:00
<span class="md:hidden"><%= t('sign_up') %></span>
2023-07-16 16:15:37 +03:00
</span>
<% end %>
<% end %>
</div>
2023-05-29 21:20:39 +03:00
<% end %>
</div>