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

36 lines
2.4 KiB
ERB

<% if signed_in? %>
<native-action data-placement="profile" data-icon="user">
<%= link_to t('profile'), settings_profile_index_path %>
</native-action>
<native-action data-placement="profile" data-icon="settings">
<%= link_to t('settings'), settings_path %>
</native-action>
<% if current_account.testing? && (can?(:manage, EncryptedConfig) || current_user != true_user) %>
<native-action data-placement="test_mode" data-icon="code" data-label="<%= t('exit_test_mode') %>">
<%= button_to '', testing_account_path, method: :delete, form: { data: { turbo_action: 'replace' } } %>
</native-action>
<% end %>
<native-action data-placement="profile" data-icon="logout" data-native="sign_out" data-label="<%= t('sign_out') %>" data-destructive="true"></native-action>
<% if can?(:create, ::Template) %>
<native-upload class="hidden">
<%= form_for '', url: templates_upload_path, id: form_id = SecureRandom.uuid, method: :post, html: { enctype: 'multipart/form-data' } do %>
<input type="hidden" name="form_id" value="<%= form_id %>">
<input name="files[]" type="file" multiple>
<% end %>
</native-upload>
<% end %>
<% if can?(:create, ::Template) && controller_name.in?(%w[templates_dashboard submissions_dashboard template_folders templates_archived submissions_archived]) %>
<% folder_name = @template_folder&.full_name %>
<native-action data-placement="create" data-icon="upload" data-native="upload" data-label="<%= t('upload') %>" data-url="<%= templates_upload_path(folder_name: folder_name) %>" data-accept="image/*, application/pdf, application/zip, application/json<%= ", #{Templates::CreateAttachments::DOCUMENT_EXTENSIONS.join(', ')}" if Docuseal.advanced_formats? %>"></native-action>
<native-action data-placement="create" data-icon="scan" data-native="scan" data-label="<%= t('scan') %>" data-url="<%= templates_upload_path(folder_name: folder_name) %>"></native-action>
<% if Docuseal.multitenant? %>
<native-action data-placement="create" data-icon="brand_gdrive">
<%= link_to 'Google Drive', new_template_path(modal_tab: 'google_drive', folder_name: folder_name), data: { turbo_frame: :modal } %>
</native-action>
<% end %>
<native-action data-placement="create" data-icon="pencil_plus">
<%= link_to t('create'), new_template_path(folder_name: folder_name), data: { turbo_frame: :modal } %>
</native-action>
<% end %>
<% end %>