2017-07-06 12:24:03 -04:00
|
|
|
- @hide_top_links = true
|
|
|
|
- @hide_breadcrumbs = true
|
2019-09-03 05:03:35 -04:00
|
|
|
- @no_container = true
|
2020-11-26 07:09:48 -05:00
|
|
|
- page_title user_display_name(@user)
|
2021-11-23 16:10:02 -05:00
|
|
|
- page_description @user.bio unless @user.blocked? || !@user.confirmed?
|
2020-11-05 13:08:48 -05:00
|
|
|
- page_itemtype 'http://schema.org/Person'
|
2020-03-16 08:09:12 -04:00
|
|
|
- link_classes = "flex-grow-1 mx-1 "
|
2015-05-01 05:33:54 -04:00
|
|
|
|
2015-04-21 10:31:40 -04:00
|
|
|
= content_for :meta_tags do
|
2015-04-21 11:03:23 -04:00
|
|
|
= auto_discovery_link_tag(:atom, user_url(@user, format: :atom), title: "#{@user.name} activity")
|
2015-04-21 10:31:40 -04:00
|
|
|
|
2016-03-02 14:08:03 -05:00
|
|
|
.user-profile
|
2019-06-19 13:31:05 -04:00
|
|
|
.cover-block.user-cover-block{ class: [('border-bottom' if profile_tabs.empty?)] }
|
2020-03-16 08:09:12 -04:00
|
|
|
= render layout: 'users/cover_controls' do
|
2016-03-02 14:08:03 -05:00
|
|
|
- if @user == current_user
|
2021-02-15 10:08:59 -05:00
|
|
|
= link_to profile_path, class: link_classes + 'btn gl-button btn-default btn-icon has-tooltip',
|
|
|
|
title: s_('UserProfile|Edit profile'), 'aria-label': 'Edit profile', data: { toggle: 'tooltip', placement: 'bottom', container: 'body' } do
|
2020-07-20 20:09:37 -04:00
|
|
|
= sprite_icon('pencil')
|
2016-03-02 14:08:03 -05:00
|
|
|
- elsif current_user
|
2016-09-16 14:31:55 -04:00
|
|
|
- if @user.abuse_report
|
2021-02-02 16:09:04 -05:00
|
|
|
%button{ class: link_classes + 'btn gl-button btn-danger btn-icon', title: s_('UserProfile|Already reported for abuse'),
|
2020-09-02 05:10:23 -04:00
|
|
|
data: { toggle: 'tooltip', placement: 'bottom', container: 'body' } }>
|
|
|
|
= sprite_icon('error')
|
2016-09-16 14:31:55 -04:00
|
|
|
- else
|
2021-06-16 05:10:10 -04:00
|
|
|
= link_to new_abuse_report_path(user_id: @user.id, ref_url: request.referer), class: link_classes + 'btn gl-button btn-default btn-icon',
|
2018-10-04 03:55:37 -04:00
|
|
|
title: s_('UserProfile|Report abuse'), data: { toggle: 'tooltip', placement: 'bottom', container: 'body' } do
|
2020-09-02 05:10:23 -04:00
|
|
|
= sprite_icon('error')
|
2021-08-30 05:09:12 -04:00
|
|
|
- verified_gpg_keys = @user.gpg_keys.select(&:verified?)
|
|
|
|
- if verified_gpg_keys.any?
|
|
|
|
= link_to user_gpg_keys_path,
|
|
|
|
class: link_classes + 'btn btn-default btn-md gl-button btn-icon has-tooltip',
|
|
|
|
title: n_('View public GPG key', 'View public GPG keys', verified_gpg_keys.length),
|
|
|
|
data: { toggle: 'tooltip', placement: 'bottom', container: 'body' } do
|
|
|
|
= sprite_icon('key', css_class: 'gl-button-icon gl-icon')
|
2018-07-24 08:46:19 -04:00
|
|
|
- if can?(current_user, :read_user_profile, @user)
|
2021-02-02 16:09:04 -05:00
|
|
|
= link_to user_path(@user, rss_url_options), class: link_classes + 'btn gl-button btn-default btn-icon has-tooltip',
|
2021-01-27 07:09:01 -05:00
|
|
|
title: s_('UserProfile|Subscribe'), data: { toggle: 'tooltip', placement: 'bottom', container: 'body' } do
|
2020-08-10 14:09:54 -04:00
|
|
|
= sprite_icon('rss', css_class: 'qa-rss-icon')
|
2017-02-28 15:50:57 -05:00
|
|
|
- if current_user && current_user.admin?
|
2021-02-02 16:09:04 -05:00
|
|
|
= link_to [:admin, @user], class: link_classes + 'btn gl-button btn-default btn-icon', title: s_('UserProfile|View user in admin area'),
|
2017-02-28 15:50:57 -05:00
|
|
|
data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
|
2020-08-21 05:10:08 -04:00
|
|
|
= sprite_icon('user')
|
2021-03-10 13:09:32 -05:00
|
|
|
- if current_user && current_user.id != @user.id
|
|
|
|
- if current_user.following?(@user)
|
|
|
|
= link_to user_unfollow_path(@user, :json) , class: link_classes + 'btn gl-button btn-default', method: :post do
|
|
|
|
= _('Unfollow')
|
|
|
|
- else
|
2021-05-06 23:10:17 -04:00
|
|
|
= link_to user_follow_path(@user, :json) , class: link_classes + 'btn gl-button btn-confirm', method: :post, data: { qa_selector: 'follow_user_link' } do
|
2021-03-10 13:09:32 -05:00
|
|
|
= _('Follow')
|
2016-03-02 14:08:03 -05:00
|
|
|
|
2018-12-10 02:57:38 -05:00
|
|
|
.profile-header{ class: [('with-no-profile-tabs' if profile_tabs.empty?)] }
|
2016-09-16 14:31:55 -04:00
|
|
|
.avatar-holder
|
2018-02-09 05:43:12 -05:00
|
|
|
= link_to avatar_icon_for_user(@user, 400), target: '_blank', rel: 'noopener noreferrer' do
|
2020-11-05 13:08:48 -05:00
|
|
|
= image_tag avatar_icon_for_user(@user, 90), class: "avatar s90", alt: '', itemprop: 'image'
|
2016-09-26 12:33:35 -04:00
|
|
|
|
2020-11-26 07:09:48 -05:00
|
|
|
- if @user.blocked? || !@user.confirmed?
|
2019-12-16 13:08:22 -05:00
|
|
|
.user-info
|
|
|
|
.cover-title
|
2020-11-26 07:09:48 -05:00
|
|
|
= user_display_name(@user)
|
2019-12-16 13:08:22 -05:00
|
|
|
= render "users/profile_basic_info"
|
|
|
|
- else
|
|
|
|
.user-info
|
2020-11-05 13:08:48 -05:00
|
|
|
.cover-title{ itemprop: 'name' }
|
2019-12-16 13:08:22 -05:00
|
|
|
= @user.name
|
2021-06-07 17:10:00 -04:00
|
|
|
- if @user.pronouns.present?
|
|
|
|
%span.gl-font-base.gl-text-gray-500.gl-vertical-align-middle
|
|
|
|
= "(#{@user.pronouns})"
|
2020-11-17 10:09:28 -05:00
|
|
|
- if @user&.status && user_status_set_to_busy?(@user.status)
|
|
|
|
%span.gl-font-base.gl-text-gray-500.gl-vertical-align-middle= s_("UserProfile|(Busy)")
|
2019-12-16 13:08:22 -05:00
|
|
|
|
2021-08-04 02:09:49 -04:00
|
|
|
- if @user.pronunciation.present?
|
|
|
|
.gl-align-items-center
|
|
|
|
%p.gl-mb-4.gl-text-gray-500= s_("UserProfile|Pronounced as: %{pronunciation}") % { pronunciation: @user.pronunciation }
|
|
|
|
|
2020-11-17 10:09:28 -05:00
|
|
|
- if show_status_emoji?(@user.status)
|
2021-02-12 13:08:59 -05:00
|
|
|
.cover-status.gl-display-inline-flex.gl-align-items-center
|
|
|
|
= emoji_icon(@user.status.emoji, class: 'gl-mr-2')
|
2019-12-16 13:08:22 -05:00
|
|
|
= markdown_field(@user.status, :message)
|
|
|
|
= render "users/profile_basic_info"
|
2021-08-25 20:09:31 -04:00
|
|
|
.gl-text-gray-900.mb-1.mb-sm-2
|
2020-03-16 08:09:12 -04:00
|
|
|
- unless @user.location.blank?
|
2021-08-25 20:09:31 -04:00
|
|
|
= render 'middle_dot_divider', stacking: true, itemprop: 'address', itemscope: true, itemtype: 'https://schema.org/PostalAddress' do
|
2021-04-10 17:09:34 -04:00
|
|
|
= sprite_icon('location', css_class: 'fgray')
|
|
|
|
%span{ itemprop: 'addressLocality' }
|
2020-03-16 08:09:12 -04:00
|
|
|
= @user.location
|
2021-10-01 11:12:53 -04:00
|
|
|
- user_local_time = local_time(@user.timezone)
|
|
|
|
- unless user_local_time.nil?
|
|
|
|
= render 'middle_dot_divider', stacking: true, data: { testid: 'user-local-time' } do
|
|
|
|
= sprite_icon('clock', css_class: 'fgray')
|
|
|
|
%span
|
|
|
|
= user_local_time
|
2020-03-16 08:09:12 -04:00
|
|
|
- unless work_information(@user).blank?
|
2021-08-25 20:09:31 -04:00
|
|
|
= render 'middle_dot_divider', stacking: true do
|
2021-04-10 17:09:34 -04:00
|
|
|
= sprite_icon('work', css_class: 'fgray')
|
|
|
|
%span
|
2020-11-05 13:08:48 -05:00
|
|
|
= work_information(@user, with_schema_markup: true)
|
2021-08-25 20:09:31 -04:00
|
|
|
.gl-text-gray-900
|
2019-12-16 13:08:22 -05:00
|
|
|
- unless @user.skype.blank?
|
2021-08-25 20:09:31 -04:00
|
|
|
= render 'middle_dot_divider' do
|
|
|
|
= link_to "skype:#{@user.skype}", class: 'gl-hover-text-decoration-none', title: "Skype" do
|
2022-01-07 01:14:36 -05:00
|
|
|
= sprite_icon('skype', css_class: 'skype-icon')
|
2019-12-16 13:08:22 -05:00
|
|
|
- unless @user.linkedin.blank?
|
2021-08-25 20:09:31 -04:00
|
|
|
= render 'middle_dot_divider' do
|
|
|
|
= link_to linkedin_url(@user), class: 'gl-hover-text-decoration-none', title: "LinkedIn", target: '_blank', rel: 'noopener noreferrer nofollow' do
|
2022-01-07 01:14:36 -05:00
|
|
|
= sprite_icon('linkedin', css_class: 'linkedin-icon')
|
2019-12-16 13:08:22 -05:00
|
|
|
- unless @user.twitter.blank?
|
2021-08-25 20:09:31 -04:00
|
|
|
= render 'middle_dot_divider', breakpoint: 'sm' do
|
|
|
|
= link_to twitter_url(@user), class: 'gl-hover-text-decoration-none', title: "Twitter", target: '_blank', rel: 'noopener noreferrer nofollow' do
|
2022-01-07 01:14:36 -05:00
|
|
|
= sprite_icon('twitter', css_class: 'twitter-icon')
|
2019-12-16 13:08:22 -05:00
|
|
|
- unless @user.website_url.blank?
|
2021-08-25 20:09:31 -04:00
|
|
|
= render 'middle_dot_divider', stacking: true do
|
2020-10-15 14:08:43 -04:00
|
|
|
- if Feature.enabled?(:security_auto_fix) && @user.bot?
|
|
|
|
= sprite_icon('question', css_class: 'gl-text-blue-600')
|
2021-08-25 20:09:31 -04:00
|
|
|
= link_to @user.short_website_url, @user.full_website_url, target: '_blank', rel: 'me noopener noreferrer nofollow', itemprop: 'url'
|
2020-03-16 08:09:12 -04:00
|
|
|
- unless @user.public_email.blank?
|
2021-08-25 20:09:31 -04:00
|
|
|
= render 'middle_dot_divider', stacking: true do
|
|
|
|
= link_to @user.public_email, "mailto:#{@user.public_email}", itemprop: 'email'
|
|
|
|
.gl-text-gray-900
|
2021-02-15 16:08:59 -05:00
|
|
|
= sprite_icon('users', css_class: 'gl-vertical-align-middle gl-text-gray-500')
|
2021-08-25 20:09:31 -04:00
|
|
|
= render 'middle_dot_divider' do
|
|
|
|
= link_to user_followers_path do
|
2021-02-15 16:08:59 -05:00
|
|
|
- count = @user.followers.count
|
|
|
|
= n_('1 follower', '%{count} followers', count) % { count: count }
|
2021-08-25 20:09:31 -04:00
|
|
|
= render 'middle_dot_divider' do
|
|
|
|
= link_to user_following_path, data: { qa_selector: 'following_link' } do
|
2021-02-15 16:08:59 -05:00
|
|
|
= @user.followees.count
|
|
|
|
= _('following')
|
2018-11-17 17:12:53 -05:00
|
|
|
- if @user.bio.present?
|
2021-08-25 20:09:31 -04:00
|
|
|
.gl-text-gray-900
|
2020-07-23 11:09:28 -04:00
|
|
|
.profile-user-bio
|
2021-09-06 11:10:54 -04:00
|
|
|
= @user.bio
|
2020-07-09 20:09:13 -04:00
|
|
|
|
2016-02-24 11:08:00 -05:00
|
|
|
|
2018-07-24 08:46:19 -04:00
|
|
|
- unless profile_tabs.empty?
|
|
|
|
.scrolling-tabs-container
|
2020-06-25 08:09:00 -04:00
|
|
|
.fade-left= sprite_icon('chevron-lg-left', size: 12)
|
|
|
|
.fade-right= sprite_icon('chevron-lg-right', size: 12)
|
2018-07-24 08:46:19 -04:00
|
|
|
%ul.nav-links.user-profile-nav.scrolling-tabs.nav.nav-tabs
|
2018-10-04 03:55:37 -04:00
|
|
|
- if profile_tab?(:overview)
|
|
|
|
%li.js-overview-tab
|
|
|
|
= link_to user_path, data: { target: 'div#js-overview', action: 'overview', toggle: 'tab' } do
|
|
|
|
= s_('UserProfile|Overview')
|
2018-07-24 08:46:19 -04:00
|
|
|
- if profile_tab?(:activity)
|
|
|
|
%li.js-activity-tab
|
2018-10-04 03:55:37 -04:00
|
|
|
= link_to user_activity_path, data: { target: 'div#activity', action: 'activity', toggle: 'tab' } do
|
|
|
|
= s_('UserProfile|Activity')
|
2020-10-15 14:08:43 -04:00
|
|
|
- unless Feature.enabled?(:security_auto_fix) && @user.bot?
|
|
|
|
- if profile_tab?(:groups)
|
|
|
|
%li.js-groups-tab
|
|
|
|
= link_to user_groups_path, data: { target: 'div#groups', action: 'groups', toggle: 'tab', endpoint: user_groups_path(format: :json) } do
|
|
|
|
= s_('UserProfile|Groups')
|
|
|
|
- if profile_tab?(:contributed)
|
|
|
|
%li.js-contributed-tab
|
|
|
|
= link_to user_contributed_projects_path, data: { target: 'div#contributed', action: 'contributed', toggle: 'tab', endpoint: user_contributed_projects_path(format: :json) } do
|
|
|
|
= s_('UserProfile|Contributed projects')
|
|
|
|
- if profile_tab?(:projects)
|
|
|
|
%li.js-projects-tab
|
|
|
|
= link_to user_projects_path, data: { target: 'div#projects', action: 'projects', toggle: 'tab', endpoint: user_projects_path(format: :json) } do
|
|
|
|
= s_('UserProfile|Personal projects')
|
|
|
|
- if profile_tab?(:starred)
|
|
|
|
%li.js-starred-tab
|
|
|
|
= link_to user_starred_projects_path, data: { target: 'div#starred', action: 'starred', toggle: 'tab', endpoint: user_starred_projects_path(format: :json) } do
|
|
|
|
= s_('UserProfile|Starred projects')
|
|
|
|
- if profile_tab?(:snippets)
|
|
|
|
%li.js-snippets-tab
|
|
|
|
= link_to user_snippets_path, data: { target: 'div#snippets', action: 'snippets', toggle: 'tab', endpoint: user_snippets_path(format: :json) } do
|
|
|
|
= s_('UserProfile|Snippets')
|
2021-02-15 16:08:59 -05:00
|
|
|
- if profile_tab?(:followers)
|
|
|
|
%li.js-followers-tab
|
|
|
|
= link_to user_followers_path, data: { target: 'div#followers', action: 'followers', toggle: 'tab', endpoint: user_followers_path(format: :json) } do
|
|
|
|
= s_('UserProfile|Followers')
|
|
|
|
- if profile_tab?(:following)
|
|
|
|
%li.js-following-tab
|
|
|
|
= link_to user_following_path, data: { target: 'div#following', action: 'following', toggle: 'tab', endpoint: user_following_path(format: :json) } do
|
|
|
|
= s_('UserProfile|Following')
|
2017-02-23 16:23:33 -05:00
|
|
|
|
2016-03-02 14:08:03 -05:00
|
|
|
%div{ class: container_class }
|
2017-02-16 17:02:40 -05:00
|
|
|
.tab-content
|
2018-10-04 03:55:37 -04:00
|
|
|
- if profile_tab?(:overview)
|
|
|
|
#js-overview.tab-pane
|
|
|
|
= render "users/overview"
|
|
|
|
|
2017-12-11 09:21:06 -05:00
|
|
|
- if profile_tab?(:activity)
|
|
|
|
#activity.tab-pane
|
2021-04-06 14:09:02 -04:00
|
|
|
.flash-container
|
2017-12-11 09:21:06 -05:00
|
|
|
- if can?(current_user, :read_cross_project)
|
|
|
|
%h4.prepend-top-20
|
2018-10-04 03:55:37 -04:00
|
|
|
= s_('UserProfile|Most Recent Activity')
|
2020-12-01 07:09:17 -05:00
|
|
|
.content_list{ data: { href: user_activity_path } }
|
2020-02-10 07:08:59 -05:00
|
|
|
.loading
|
2021-04-29 17:10:03 -04:00
|
|
|
.gl-spinner.gl-spinner-md
|
2020-10-15 14:08:43 -04:00
|
|
|
- unless @user.bot?
|
|
|
|
- if profile_tab?(:groups)
|
|
|
|
#groups.tab-pane
|
|
|
|
-# This tab is always loaded via AJAX
|
|
|
|
|
|
|
|
- if profile_tab?(:contributed)
|
|
|
|
#contributed.tab-pane
|
|
|
|
-# This tab is always loaded via AJAX
|
|
|
|
|
|
|
|
- if profile_tab?(:projects)
|
|
|
|
#projects.tab-pane
|
|
|
|
-# This tab is always loaded via AJAX
|
|
|
|
|
|
|
|
- if profile_tab?(:starred)
|
|
|
|
#starred.tab-pane
|
|
|
|
-# This tab is always loaded via AJAX
|
|
|
|
|
|
|
|
- if profile_tab?(:snippets)
|
|
|
|
#snippets.tab-pane
|
|
|
|
-# This tab is always loaded via AJAX
|
2016-05-02 05:37:12 -04:00
|
|
|
|
2021-02-15 16:08:59 -05:00
|
|
|
- if profile_tab?(:followers)
|
|
|
|
#followers.tab-pane
|
|
|
|
-# This tab is always loaded via AJAX
|
|
|
|
|
|
|
|
- if profile_tab?(:following)
|
|
|
|
#following.tab-pane
|
|
|
|
-# This tab is always loaded via AJAX
|
|
|
|
|
2020-02-10 07:08:59 -05:00
|
|
|
.loading.hide
|
2021-04-29 17:10:03 -04:00
|
|
|
.gl-spinner.gl-spinner-md
|
2018-07-24 08:46:19 -04:00
|
|
|
|
2020-08-18 08:10:16 -04:00
|
|
|
- if profile_tabs.empty?
|
|
|
|
.svg-content
|
|
|
|
= image_tag 'illustrations/profile_private_mode.svg'
|
|
|
|
.text-content.text-center
|
|
|
|
%h4
|
|
|
|
- if @user.blocked?
|
|
|
|
= s_('UserProfile|This user is blocked')
|
|
|
|
- else
|
|
|
|
= s_('UserProfile|This user has a private profile')
|