2019-06-10 08:41:22 +00:00
- page_title _('Emails')
2017-06-22 14:47:50 +00:00
- @content_class = "limit-container-width" unless fluid_layout
2014-02-09 03:08:49 +00:00
2020-06-26 06:09:03 +00:00
.row.gl-mt-3
2017-06-22 14:47:50 +00:00
.col-lg-4.profile-settings-sidebar
2020-05-21 18:08:27 +00:00
%h4.gl-mt-0
2016-02-29 15:06:22 +00:00
= page_title
%p
2019-06-10 08:41:22 +00:00
= _('Control emails linked to your account')
2017-06-22 14:47:50 +00:00
.col-lg-8
2020-05-21 18:08:27 +00:00
%h4.gl-mt-0
2019-06-10 08:41:22 +00:00
= _('Add email address')
2016-02-29 15:06:22 +00:00
= form_for 'email', url: profile_emails_path do |f|
.form-group
2019-06-10 08:41:22 +00:00
= f.label :email, _('Email'), class: 'label-bold'
2021-01-28 18:09:27 +00:00
= f.text_field :email, class: 'form-control gl-form-input', data: { qa_selector: 'email_address_field' }
2020-06-26 06:09:03 +00:00
.gl-mt-3
2021-03-17 18:09:01 +00:00
= f.submit _('Add email address'), class: 'gl-button btn btn-confirm', data: { qa_selector: 'add_email_address_button' }
2016-02-29 15:06:22 +00:00
%hr
2020-05-21 18:08:27 +00:00
%h4.gl-mt-0
2022-08-03 09:12:13 +00:00
= _('Linked emails (%{email_count})') % { email_count: @emails.load.size }
2020-06-22 15:09:27 +00:00
.account-well.gl-mb-3
2016-02-29 15:06:22 +00:00
%ul
%li
2021-06-04 09:09:43 +00:00
- 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-09-14 09:52:09 +00:00
%li
2021-06-04 09:09:43 +00:00
= _('Your commit email is used for web based operations, such as edits and merges.')
2016-02-29 15:06:22 +00:00
%li
2021-06-04 09:09:43 +00:00
- 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-06-10 08:41:22 +00:00
= notification_message.html_safe
2016-02-29 15:06:22 +00:00
%li
2021-06-04 09:09:43 +00:00
= _('Your public email will be displayed on your public profile.')
2016-02-29 15:06:22 +00:00
%li
2019-06-10 08:41:22 +00:00
= _('All email addresses will be used to identify your commits.')
2018-05-29 19:45:34 +00:00
%ul.content-list
2014-02-09 03:08:49 +00:00
%li
2017-10-01 15:07:26 +00:00
= render partial: 'shared/email_with_badge', locals: { email: @primary_email, verified: current_user.confirmed? }
2018-04-09 17:42:45 +00:00
%span.float-right
2021-12-28 09:13:03 +00:00
= gl_badge_tag s_('Profiles|Primary email'), variant: :success
2021-09-16 15:12:47 +00:00
- if @primary_email === current_user.commit_email_or_default
2021-12-28 09:13:03 +00:00
= gl_badge_tag s_('Profiles|Commit email'), variant: :info
2017-10-01 15:07:26 +00:00
- if @primary_email === current_user.public_email
2021-12-28 09:13:03 +00:00
= gl_badge_tag s_('Profiles|Public email'), variant: :info
2021-09-16 15:12:47 +00:00
- if @primary_email === current_user.notification_email_or_default
2021-12-28 09:13:03 +00:00
= gl_badge_tag s_('Profiles|Default notification email'), variant: :info
2021-11-04 00:12:36 +00:00
- @emails.reject(&:user_primary_email?).each do |email|
2019-09-23 06:06:19 +00:00
%li{ data: { qa_selector: 'email_row_content' } }
2017-09-09 13:55:07 +00:00
= render partial: 'shared/email_with_badge', locals: { email: email.email, verified: email.confirmed? }
2018-04-09 17:42:45 +00:00
%span.float-right
2021-09-16 15:12:47 +00:00
- if email.email === current_user.commit_email_or_default
2021-12-28 09:13:03 +00:00
= gl_badge_tag s_('Profiles|Commit email'), variant: :info
2016-02-29 15:06:22 +00:00
- if email.email === current_user.public_email
2021-12-28 09:13:03 +00:00
= gl_badge_tag s_('Profiles|Public email'), variant: :info
2021-09-16 15:12:47 +00:00
- if email.email === current_user.notification_email_or_default
2021-12-28 09:13:03 +00:00
= gl_badge_tag s_('Profiles|Notification email'), variant: :info
2017-09-09 08:29:21 +00:00
- unless email.confirmed?
2019-06-10 08:41:22 +00:00
- confirm_title = "#{email.confirmation_sent_at ? _('Resend confirmation email') : _('Send confirmation email')}"
2022-05-26 21:08:54 +00:00
= link_to confirm_title, resend_confirmation_instructions_profile_email_path(email), method: :put, class: 'gl-button btn btn-sm btn-default gl-ml-3'
2017-09-24 20:21:00 +00:00
2020-10-19 12:09:20 +00:00
= 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 gl-ml-3' do
2019-06-10 08:41:22 +00:00
%span.sr-only= _('Remove')
2020-08-19 00:10:34 +00:00
= sprite_icon('remove')