diff options
Diffstat (limited to 'app/views/users/show.html.haml')
-rw-r--r-- | app/views/users/show.html.haml | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index debfe57dbd7..cdaa739a7b3 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -26,6 +26,13 @@ = link_to new_abuse_report_path(user_id: @user.id, ref_url: request.referrer), class: link_classes + 'btn gl-button btn-default btn-icon', title: s_('UserProfile|Report abuse'), data: { toggle: 'tooltip', placement: 'bottom', container: 'body' } do = sprite_icon('error') + - 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 + = link_to user_follow_path(@user, :json) , class: link_classes + 'btn gl-button btn-default', method: :post do + = _('Follow') - if can?(current_user, :read_user_profile, @user) = link_to user_path(@user, rss_url_options), class: link_classes + 'btn gl-button btn-default btn-icon has-tooltip', title: s_('UserProfile|Subscribe'), data: { toggle: 'tooltip', placement: 'bottom', container: 'body' } do @@ -89,6 +96,16 @@ - unless @user.public_email.blank? .profile-link-holder.middle-dot-divider-sm.d-block.d-sm-inline.mt-1.mt-sm-0 = link_to @user.public_email, "mailto:#{@user.public_email}", class: 'text-link', itemprop: 'email' + .cover-desc.gl-text-gray-900.gl-mb-2.mb-sm-2 + = sprite_icon('users', css_class: 'gl-vertical-align-middle gl-text-gray-500') + .profile-link-holder.middle-dot-divider + = link_to user_followers_path, class: 'text-link' do + - count = @user.followers.count + = n_('1 follower', '%{count} followers', count) % { count: count } + .profile-link-holder.middle-dot-divider + = link_to user_following_path, class: 'text-link' do + = @user.followees.count + = _('following') - if @user.bio.present? .cover-desc.cgray .profile-user-bio @@ -129,6 +146,14 @@ %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') + - 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') %div{ class: container_class } .tab-content @@ -165,6 +190,14 @@ #snippets.tab-pane -# This tab is always loaded via AJAX + - 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 + .loading.hide .spinner.spinner-md |