diff options
author | Senorsen <sen@senorsen.com> | 2015-04-14 00:28:49 +0800 |
---|---|---|
committer | Senorsen <sen@senorsen.com> | 2015-04-14 19:42:48 +0800 |
commit | 7b28218f96d14c9650484a183ffab3b2132b05db (patch) | |
tree | a79cbd394f52a00ba69b1d9b9f192d7ce0b35082 /app/views | |
parent | ae6d0aaae0d8f6251b30a8e5243a98f083f0cac9 (diff) | |
download | gitlab-ce-7b28218f96d14c9650484a183ffab3b2132b05db.tar.gz |
Allow user to choose which email to be public
This commit allows user to show one of their emails in profile page,
or don't show email in this page.
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/profiles/emails/index.html.haml | 4 | ||||
-rw-r--r-- | app/views/profiles/show.html.haml | 5 | ||||
-rw-r--r-- | app/views/users/_profile.html.haml | 4 |
3 files changed, 13 insertions, 0 deletions
diff --git a/app/views/profiles/emails/index.html.haml b/app/views/profiles/emails/index.html.haml index 9d8f33cbbaa..09f290429ea 100644 --- a/app/views/profiles/emails/index.html.haml +++ b/app/views/profiles/emails/index.html.haml @@ -20,9 +20,13 @@ %li %strong= @primary %span.label.label-success Primary Email + - if @primary === @public_email + %span.label.label-info Public Email - @emails.each do |email| %li %strong= email.email + - if email.email === @public_email + %span.label.label-info Public Email %span.cgray added #{time_ago_with_tooltip(email.created_at)} = link_to 'Remove', profile_email_path(email), data: { confirm: 'Are you sure?'}, method: :delete, class: 'btn btn-sm btn-remove pull-right' diff --git a/app/views/profiles/show.html.haml b/app/views/profiles/show.html.haml index 5a501e43149..6c745e69e40 100644 --- a/app/views/profiles/show.html.haml +++ b/app/views/profiles/show.html.haml @@ -42,6 +42,11 @@ - else %span.help-block We also use email for avatar detection if no avatar is uploaded. .form-group + = f.label :public_email, class: "control-label" + .col-sm-10 + = f.select :public_email, options_for_select(@user.all_emails, selected: @user.public_email), {include_blank: 'Do not show in profile'}, class: "form-control" + %span.help-block This email will be displayed on your public profile. + .form-group = f.label :skype, class: "control-label" .col-sm-10= f.text_field :skype, class: "form-control" .form-group diff --git a/app/views/users/_profile.html.haml b/app/views/users/_profile.html.haml index bca71444956..90d9980c85c 100644 --- a/app/views/users/_profile.html.haml +++ b/app/views/users/_profile.html.haml @@ -5,6 +5,10 @@ %li %span.light Member since %strong= user.created_at.stamp("Aug 21, 2011") + - unless user.public_email.blank? + %li + %span.light E-mail: + %strong= link_to user.public_email, "mailto:#{user.public_email}" - unless user.skype.blank? %li %span.light Skype: |