2019-09-04 21:01:54 +05:30
- page_title _('Emails')
2017-09-10 17:25:29 +05:30
- @content_class = "limit-container-width" unless fluid_layout
2014-09-02 18:07:02 +05:30
2022-11-25 23:54:43 +05:30
.row.gl-mt-3.js-search-settings-section
2017-09-10 17:25:29 +05:30
.col-lg-4.profile-settings-sidebar
2020-06-23 00:09:42 +05:30
%h4.gl-mt-0
2016-06-02 11:05:42 +05:30
= page_title
%p
2019-09-04 21:01:54 +05:30
= _('Control emails linked to your account')
2017-09-10 17:25:29 +05:30
.col-lg-8
2020-06-23 00:09:42 +05:30
%h4.gl-mt-0
2019-09-04 21:01:54 +05:30
= _('Add email address')
2022-11-25 23:54:43 +05:30
= gitlab_ui_form_for 'email', url: profile_emails_path do |f|
2016-06-02 11:05:42 +05:30
.form-group
2019-09-04 21:01:54 +05:30
= f.label :email, _('Email'), class: 'label-bold'
2021-03-11 19:13:27 +05:30
= f.text_field :email, class: 'form-control gl-form-input', data: { qa_selector: 'email_address_field' }
2020-07-28 23:09:34 +05:30
.gl-mt-3
2022-11-25 23:54:43 +05:30
= f.submit _('Add email address'), data: { qa_selector: 'add_email_address_button' }, pajamas_button: true
2016-06-02 11:05:42 +05:30
%hr
2020-06-23 00:09:42 +05:30
%h4.gl-mt-0
2022-08-27 11:52:29 +05:30
= _('Linked emails (%{email_count})') % { email_count: @emails.load.size }
2020-07-28 23:09:34 +05:30
.account-well.gl-mb-3
2016-06-02 11:05:42 +05:30
%ul
%li
2021-09-04 01:27:46 +05:30
- profile_message = _('Your primary email is used for avatar detection. You can change it in your %{openingTag}profile settings%{closingTag}.') % { openingTag: "<a href='#{profile_path}'>".html_safe, closingTag: '</a>'.html_safe}
= profile_message.html_safe
2018-12-05 23:21:45 +05:30
%li
2021-09-04 01:27:46 +05:30
= _('Your commit email is used for web based operations, such as edits and merges.')
2016-06-02 11:05:42 +05:30
%li
2021-09-04 01:27:46 +05:30
- notification_message = _('Your default notification email is used for account notifications if a %{openingTag}group-specific email address%{closingTag} is not set.') % { openingTag: "<a href='#{profile_notifications_path}'>".html_safe, closingTag: '</a>'.html_safe}
2019-09-04 21:01:54 +05:30
= notification_message.html_safe
2016-06-02 11:05:42 +05:30
%li
2021-09-04 01:27:46 +05:30
= _('Your public email will be displayed on your public profile.')
2016-06-02 11:05:42 +05:30
%li
2019-09-04 21:01:54 +05:30
= _('All email addresses will be used to identify your commits.')
2018-11-08 19:23:39 +05:30
%ul.content-list
2014-09-02 18:07:02 +05:30
%li
2018-03-17 18:26:18 +05:30
= render partial: 'shared/email_with_badge', locals: { email: @primary_email, verified: current_user.confirmed? }
2022-08-27 11:52:29 +05:30
%ul
%li= s_('Profiles|Primary email')
2022-10-11 01:57:18 +05:30
- if @primary_email == current_user.commit_email_or_default
2022-08-27 11:52:29 +05:30
%li= s_('Profiles|Commit email')
2022-10-11 01:57:18 +05:30
- if @primary_email == current_user.public_email
2022-08-27 11:52:29 +05:30
%li= s_('Profiles|Public email')
2022-10-11 01:57:18 +05:30
- if @primary_email == current_user.notification_email_or_default
2022-08-27 11:52:29 +05:30
%li= s_('Profiles|Default notification email')
2021-12-11 22:18:48 +05:30
- @emails.reject(&:user_primary_email?).each do |email|
2019-12-21 20:55:43 +05:30
%li{ data: { qa_selector: 'email_row_content' } }
2022-10-11 01:57:18 +05:30
.gl-display-flex.gl-justify-content-space-between.gl-flex-wrap.gl-gap-3
2022-08-27 11:52:29 +05:30
%div
= render partial: 'shared/email_with_badge', locals: { email: email.email, verified: email.confirmed? }
2022-10-11 01:57:18 +05:30
%ul
- if email.email == current_user.commit_email_or_default
%li= s_('Profiles|Commit email')
- if email.email == current_user.public_email
%li= s_('Profiles|Public email')
- if email.email == current_user.notification_email_or_default
%li= s_('Profiles|Notification email')
.gl-display-flex.gl-justify-content-end.gl-align-items-flex-end.gl-flex-grow-1.gl-flex-wrap-wrap-reverse.gl-gap-3
2022-08-27 11:52:29 +05:30
- unless email.confirmed?
- confirm_title = "#{email.confirmation_sent_at ? _('Resend confirmation email') : _('Send confirmation email')}"
2022-10-11 01:57:18 +05:30
= link_to confirm_title, resend_confirmation_instructions_profile_email_path(email), method: :put, class: 'gl-button btn btn-sm btn-default'
2022-08-27 11:52:29 +05:30
2022-10-11 01:57:18 +05:30
= link_to profile_email_path(email), data: { confirm: _('Are you sure?'), qa_selector: 'delete_email_link'}, method: :delete, class: 'gl-button btn btn-sm btn-danger' do
2022-08-27 11:52:29 +05:30
%span.sr-only= _('Remove')
= sprite_icon('remove')