1- form = local_assigns.fetch(:form) 2- readonly = @user.read_only_attribute?(:email) 3- email_change_disabled = local_assigns.fetch(:email_change_disabled, nil) 4- read_only_help_text = readonly ? s_("Profiles|Your email address was automatically set based on your %{provider_label} account") % { provider_label: attribute_provider_label(:email) } : user_email_help_text(@user) 5- help_text = email_change_disabled ? s_("Your account uses dedicated credentials for the \"%{group_name}\" group and can only be updated through SSO.") % { group_name: @user.managing_group.name } : read_only_help_text 6- password_automatically_set = @user.password_automatically_set? 7 8= form.text_field :email, required: true, class: 'input-lg gl-form-input', value: (@user.email unless @user.temp_oauth_email?), help: help_text.html_safe, readonly: readonly || email_change_disabled 9- unless password_automatically_set 10 = hidden_field_tag 'user[validation_password]', :validation_password, class: 'js-password-prompt-field', help: s_("Profiles|Enter your password to confirm the email change") 11= form.select :public_email, options_for_select(@user.public_verified_emails, selected: @user.public_email), 12 { help: s_("Profiles|This email will be displayed on your public profile"), include_blank: s_("Profiles|Do not show on profile") }, 13 control_class: 'select2 input-lg', disabled: email_change_disabled 14- commit_email_link_url = help_page_path('user/profile/index', anchor: 'change-the-email-displayed-on-your-commits', target: '_blank') 15- commit_email_link_start = '<a href="%{url}">'.html_safe % { url: commit_email_link_url } 16- commit_email_docs_link = s_('Profiles|This email will be used for web based operations, such as edits and merges. %{commit_email_link_start}Learn more%{commit_email_link_end}').html_safe % { commit_email_link_start: commit_email_link_start, commit_email_link_end: '</a>'.html_safe } 17= form.select :commit_email, options_for_select(commit_email_select_options(@user), selected: @user.commit_email), 18 { help: commit_email_docs_link }, 19 control_class: 'select2 input-lg', disabled: email_change_disabled 20