Files
docuseal/app/views/profile/index.html.erb
T

96 lines
4.6 KiB
Plaintext
Raw Normal View History

2023-06-03 00:16:38 +03:00
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0">
2023-05-31 23:49:19 +03:00
<%= render 'shared/settings_nav' %>
2023-06-03 00:16:38 +03:00
<div class="flex-grow max-w-xl mx-auto">
2024-09-18 19:47:47 +03:00
<h1 class="text-4xl font-bold mb-4">
<%= t('profile') %>
</h1>
2023-06-07 01:36:47 +03:00
<%= form_for current_user, url: update_contact_settings_profile_index_path, method: :patch, html: { autocomplete: 'off', class: 'space-y-4' } do |f| %>
2023-05-31 23:49:19 +03:00
<div class="grid md:grid-cols-2 gap-4">
<div class="form-control">
2024-09-18 19:47:47 +03:00
<%= f.label :first_name, t('first_name'), class: 'label' %>
2024-01-07 14:19:21 +02:00
<%= f.text_field :first_name, required: true, class: 'base-input', dir: 'auto' %>
2023-05-31 23:49:19 +03:00
</div>
<div class="form-control">
2024-09-18 19:47:47 +03:00
<%= f.label :last_name, t('last_name'), class: 'label' %>
2024-01-07 14:19:21 +02:00
<%= f.text_field :last_name, required: true, class: 'base-input', dir: 'auto' %>
2023-05-31 23:49:19 +03:00
</div>
</div>
2023-06-07 12:04:11 +03:00
<div class="form-control">
2024-09-18 19:47:47 +03:00
<%= f.label :email, t('email'), class: 'label' %>
2023-06-07 12:04:11 +03:00
<%= f.email_field :email, autocomplete: 'off', class: 'base-input' %>
</div>
2023-06-30 01:26:13 +03:00
<div class="form-control pt-2">
2024-09-18 19:47:47 +03:00
<%= f.button button_title(title: t('update'), disabled_with: t('updating')), class: 'base-button' %>
2023-05-31 23:49:19 +03:00
</div>
<% end %>
2023-09-25 01:57:10 +03:00
<%= render 'email_configs' %>
2024-09-18 19:47:47 +03:00
<p class="text-2xl font-bold mt-8 mb-4">
<%= t('signature') %>
</p>
2023-09-22 21:50:39 +03:00
<% signature = UserConfigs.load_signature(current_user) %>
<% if signature %>
<div class="flex justify-center mb-4 relative">
2024-09-18 19:47:47 +03:00
<%= button_to button_title(title: t('remove'), disabled_with: t('removing')), user_signature_path, method: :delete, class: 'right-0 top-0 absolute link' %>
2023-09-22 21:50:39 +03:00
<img src="<%= signature.url %>" style="max-height: 200px; width: auto" width="<%= signature.metadata['width'] %>" height="<%= signature.metadata['height'] %>">
</div>
<% end %>
2024-09-18 19:47:47 +03:00
<a href="<%= edit_user_signature_path %>" data-turbo-frame="modal" class="base-button w-full">
<%= t('update_signature') %>
</a>
<p class="text-2xl font-bold mt-8 mb-4">
<%= t('initials') %>
</p>
2024-06-02 17:06:09 +03:00
<% initials = UserConfigs.load_initials(current_user) %>
<% if initials %>
<div class="flex justify-center mb-4 relative">
2024-09-18 19:47:47 +03:00
<%= button_to button_title(title: t('remove'), disabled_with: t('removing')), user_initials_path, method: :delete, class: 'right-0 top-0 absolute link' %>
2024-06-02 17:06:09 +03:00
<img src="<%= initials.url %>" style="max-height: 200px; width: auto" width="<%= initials.metadata['width'] %>" height="<%= initials.metadata['height'] %>">
</div>
<% end %>
2024-09-18 19:47:47 +03:00
<a href="<%= edit_user_initials_path %>" data-turbo-frame="modal" class="base-button w-full">
<%= t('update_initials') %>
</a>
2024-03-07 21:36:41 +02:00
<% if true_user == current_user && !current_account.testing? %>
2024-09-18 19:47:47 +03:00
<p class="text-2xl font-bold mt-8 mb-4">
<%= t('change_password') %>
</p>
2024-03-07 21:36:41 +02:00
<%= form_for current_user, url: update_password_settings_profile_index_path, method: :patch, html: { autocomplete: 'off', class: 'space-y-4' } do |f| %>
<div class="form-control">
2024-09-18 19:47:47 +03:00
<%= f.label :password, t('new_password'), class: 'label' %>
2024-03-07 21:36:41 +02:00
<%= f.password_field :password, autocomplete: 'off', class: 'base-input' %>
</div>
<div class="form-control">
2024-09-18 19:47:47 +03:00
<%= f.label :password_confirmation, t('confirm_password'), class: 'label' %>
2024-03-07 21:36:41 +02:00
<%= f.password_field :password_confirmation, autocomplete: 'off', class: 'base-input' %>
</div>
<div class="form-control pt-2">
2024-09-18 19:47:47 +03:00
<%= f.button button_title(title: t('update'), disabled_with: t('updating')), class: 'base-button' %>
2024-03-07 21:36:41 +02:00
</div>
<% end %>
2024-09-18 19:47:47 +03:00
<p class="text-2xl font-bold mt-8 mb-4">
<%= t('two_factor_authentication') %>
</p>
2024-03-07 21:36:41 +02:00
<div class="space-y-4">
<% if current_user.otp_required_for_login %>
<p class="flex items-center space-x-1">
<%= svg_icon('circle_check', class: 'stroke-success inline flex-none w-5 h-5') %>
<span>
2024-09-18 19:47:47 +03:00
<%= t('2fa_has_been_configured') %>
2024-03-07 21:36:41 +02:00
</span>
</p>
2024-09-18 19:47:47 +03:00
<a href="<%= edit_mfa_setup_path %>" data-turbo-frame="modal" class="white-button w-full !px-8">🔓 <%= t('remove_2fa') %></a>
2024-03-07 21:36:41 +02:00
<% else %>
<p class="flex items-center space-x-1">
<%= svg_icon('info_circle', class: 'stroke-warning inline flex-none w-5 h-5') %>
<span>
2024-09-18 19:47:47 +03:00
<%= t('2fa_is_not_configured') %>
2024-03-07 21:36:41 +02:00
</span>
</p>
2024-09-18 19:47:47 +03:00
<a href="<%= new_mfa_setup_path %>" data-turbo-frame="modal" class="base-button w-full !px-8">🔒 <%= t('set_up_2fa') %></a>
2024-03-07 21:36:41 +02:00
<% end %>
</div>
<% end %>
2023-05-31 23:49:19 +03:00
</div>
2023-06-03 00:16:38 +03:00
<div class="w-0 md:w-52"></div>
2023-05-31 23:49:19 +03:00
</div>