show.html.haml 5 KB
Newer Older
1
2
- page_title       @user.name
- page_description @user.bio
3
- content_for :page_specific_javascripts do
4
  = page_specific_javascript_bundle_tag('common_d3')
5
  = page_specific_javascript_bundle_tag('users')
6
- header_title     @user.name, user_path(@user)
7
- @no_container = true
Douwe Maan's avatar
Douwe Maan committed
8

9
= content_for :meta_tags do
10
  = auto_discovery_link_tag(:atom, user_url(@user, format: :atom), title: "#{@user.name} activity")
11

12
.user-profile
tauriedavis's avatar
tauriedavis committed
13
  .cover-block.user-cover-block
14
15
16
17
18
    .cover-controls
      - if @user == current_user
        = link_to profile_path, class: 'btn btn-gray' do
          = icon('pencil')
      - elsif current_user
tauriedavis's avatar
tauriedavis committed
19
20
        - if @user.abuse_report
          %button.btn.btn-danger{ title: 'Already reported for abuse',
21
            data: { toggle: 'tooltip', placement: 'bottom', container: 'body' } }
tauriedavis's avatar
tauriedavis committed
22
23
24
            = icon('exclamation-circle')
        - else
          = link_to new_abuse_report_path(user_id: @user.id, ref_url: request.referrer), class: 'btn btn-gray',
25
            title: 'Report abuse', data: { toggle: 'tooltip', placement: 'bottom', container: 'body' } do
tauriedavis's avatar
tauriedavis committed
26
            = icon('exclamation-circle')
27
28
29
30
31
32
      = link_to user_path(@user, rss_url_options), class: 'btn btn-gray' do
        = icon('rss')
      - if current_user && current_user.admin?
        = link_to [:admin, @user], class: 'btn btn-gray', title: 'View user in admin area',
          data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
          = icon('users')
33

tauriedavis's avatar
tauriedavis committed
34
35
    .profile-header
      .avatar-holder
36
        = link_to avatar_icon(@user, 400), target: '_blank', rel: 'noopener noreferrer' do
tauriedavis's avatar
tauriedavis committed
37
          = image_tag avatar_icon(@user, 90), class: "avatar s90", alt: ''
38

tauriedavis's avatar
tauriedavis committed
39
40
41
      .user-info
        .cover-title
          = @user.name
Alfredo Sumaran's avatar
Alfredo Sumaran committed
42

tauriedavis's avatar
tauriedavis committed
43
        .cover-desc.member-date
tauriedavis's avatar
tauriedavis committed
44
45
          %span.middle-dot-divider
            @#{@user.username}
tauriedavis's avatar
tauriedavis committed
46
          %span.middle-dot-divider
47
            Member since #{@user.created_at.to_date.to_s(:long)}
tauriedavis's avatar
tauriedavis committed
48

tauriedavis's avatar
tauriedavis committed
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
        .cover-desc
          - unless @user.public_email.blank?
            .profile-link-holder.middle-dot-divider
              = link_to @user.public_email, "mailto:#{@user.public_email}"
          - unless @user.skype.blank?
            .profile-link-holder.middle-dot-divider
              = link_to "skype:#{@user.skype}", title: "Skype" do
                = icon('skype')
          - unless @user.linkedin.blank?
            .profile-link-holder.middle-dot-divider
              = link_to "https://www.linkedin.com/in/#{@user.linkedin}", title: "LinkedIn" do
                = icon('linkedin-square')
          - unless @user.twitter.blank?
            .profile-link-holder.middle-dot-divider
              = link_to "https://twitter.com/#{@user.twitter}", title: "Twitter" do
                = icon('twitter-square')
          - unless @user.website_url.blank?
            .profile-link-holder.middle-dot-divider
              = link_to @user.short_website_url, @user.full_website_url
          - unless @user.location.blank?
            .profile-link-holder.middle-dot-divider
              = icon('map-marker')
              = @user.location
72
73
74
75
          - unless @user.organization.blank?
            .profile-link-holder.middle-dot-divider
              = icon('building')
              = @user.organization
76

77
78
79
80
    - if @user.bio.present?
      .cover-desc
        %p.profile-user-bio
          = @user.bio
81

82
    %ul.nav-links.center.user-profile-nav
83
      %li.js-activity-tab
84
        = link_to user_path, data: {target: 'div#activity', action: 'activity', toggle: 'tab'} do
85
          Activity
86
      %li.js-groups-tab
Long Nguyen's avatar
Long Nguyen committed
87
        = link_to user_groups_path, data: {target: 'div#groups', action: 'groups', toggle: 'tab'} do
88
          Groups
89
      %li.js-contributed-tab
Long Nguyen's avatar
Long Nguyen committed
90
        = link_to user_contributed_projects_path, data: {target: 'div#contributed', action: 'contributed', toggle: 'tab'} do
91
          Contributed projects
92
      %li.js-projects-tab
Long Nguyen's avatar
Long Nguyen committed
93
        = link_to user_projects_path, data: {target: 'div#projects', action: 'projects', toggle: 'tab'} do
94
          Personal projects
95
      %li.js-snippets-tab
Long Nguyen's avatar
Long Nguyen committed
96
        = link_to user_snippets_path, data: {target: 'div#snippets', action: 'snippets', toggle: 'tab'} do
97
          Snippets
98

99
  %div{ class: container_class }
100
    .user-callout{ 'callout-svg' => custom_icon('icon_customization') }
101
    .tab-content
102
      #activity.tab-pane
Annabel Dunstone's avatar
Annabel Dunstone committed
103
        .row-content-block.calender-block.white.second-block.hidden-xs
104
          .user-calendar{ data: { href: user_calendar_path } }
105
106
            %h4.center.light
              %i.fa.fa-spinner.fa-spin
107
108
          .user-calendar-activities

109
110
        %h4.prepend-top-20
          Most Recent Activity
111
        .content_list{ data: { href: user_path } }
112
113
114
        = spinner

      #groups.tab-pane
115
        -# This tab is always loaded via AJAX
116

117
      #contributed.tab-pane
118
        -# This tab is always loaded via AJAX
119
120

      #projects.tab-pane
121
        -# This tab is always loaded via AJAX
122

123
      #snippets.tab-pane
124
        -# This tab is always loaded via AJAX
125

126
127
    .loading-status
      = spinner
128
129

:javascript
130
  var userProfile;
131

132
  userProfile = new gl.User({
133
134
    action: "#{controller.action_name}"
  });