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