<commit_before>- content_for :title do @player.username end
%section
    - if @player.suspended?
        - content_for :noindex, true
        .row
            .col-md-12
                .alert.alert-danger
                    %strong Account Suspended
                    This account has been suspended.
    - if @cake_day
        .row
            .col-md-12
                .alert.alert-info
                    %i.fa.fa-gift
                    %strong Happy Cake Day!
                    - same_user = is_same_user?(@player)
                    #{same_user ? "You" : @player.username} joined us #{@cake_years} year#{@cake_years > 1 ? "s" : nil} ago, today. #{same_user ? "Thanks for hanging out!" : "Wish #{gender_pronoun_for(@player)[:singular]} a happy Cake Day!"}
    .row
        .col-md-12
            = render partial: "friendships/widget", locals: {user: @player}
            %h2.strong{style: "margin-top: 0"}
                %span{:style => "color: " + html_color(@player)}
                    = @player.username
                - if @previous_username
                    %small (formerly #{@previous_username})
            - if @actions.size > 0
                .btn-group.pull-right
                    %button.btn.btn-default.btn-sm.dropdown-toggle{:data => {:toggle => "dropdown"}}
                        %span.fa.fa-cog
                        %span.caret
                    %ul.dropdown-menu
                        - @actions.each do |text, method, path|
                            %li= link_to text, path, method: method
            %div
                - @player.badge_memberships.each do |mem|
                    = render_badge(@player, mem.group, tooltip: mem.staff_role.presence || mem.stop < Time::INF_FUTURE && "Expires in #{format_package_expire(mem.stop)}")
    .row{style: "margin-top: 20px"}
        .col-md-2.col-sm-3.col-xs-6
            %a{:href => "#", :style => "width: 130px; height: 130px;"}
                = avatar_for(@player, 130, glow: true)
            - if @last_sighting
                .last-seen
                    - if @last_sighting.online
                        .online online now
                        .server
                            - if @show_server && @last_sighting.server
                                - if current_user_safe.can_teleport_to?(@player)
                                    = teleport_button(@player)
                                %a{:href => main_app.play_path}
                                    = @last_sighting.server.name
                                    .datacenter
                                        = "[#{@last_sighting.server.datacenter}]"
                        .time{:rel => "tooltip", :title => format_time(@last_sighting.time), :data => {:placement => "bottom", :container => "body"}}
                            for
                            = time_ago_in_words(@last_sighting.time, false, :vague => true)
                        - if @last_sighting.session.nickname
                            .nickname
                                as
                                = @last_sighting.session.nickname
                    - else
                        .offline last seen
                        - if @show_server && @last_sighting.server
                            .server
                                - if @show_server && @last_sighting.server
                                    %a{:href => main_app.play_path}
                                        = @last_sighting.server.name
                                        .datacenter
                                            = "[#{@last_sighting.server.datacenter}]"
                        .time{:rel => "tooltip", :title => format_time(@last_sighting.time), :data => {:placement => "bottom", :container => "body"}}
                            = time_ago_in_words(@last_sighting.time, false, :vague => true)
                            ago
        .col-md-6.col-sm-3.col-xs-6
            .row.heads
                .col-md-4
                    - kills = @stats.pretty_stat(:kills)
                    .hidden-sm.hidden-xs
                        = join_safe(@kills[0...16].map{|kill| avatar_for(kill.victim_obj, 32, hover: true, link: true)})
                    .name kills
                    .number{:rel => (mega_stat(kills) ? "tooltip" : ""), :title => "#{kills} kills", :data => {:placement => "top"}}
                        = mega_stat(kills) ? number_to_human(kills, :format => "%n%u", :units => { :thousand => "k" }, :precision => 4) : kills
                .col-md-4
                    - deaths = @stats.pretty_stat(:deaths)
                    .hidden-sm.hidden-xs
                        = join_safe(@deaths[0...16].map{|death| avatar_for(death.killer_obj, 32, hover: true, link: true)})
                    .name deaths
                    .number{:rel => (mega_stat(deaths) ? "tooltip" : ""), :title => "#{deaths} deaths", :data => {:placement => "top"}}
                        = mega_stat(deaths) ? number_to_human(deaths, :format => "%n%u", :units => { :thousand => "k" }, :precision => 4) : deaths
                .col-md-4
                    .hidden-sm.hidden-xs
                        = join_safe(@friends.map{|friend| avatar_for(friend, 32, hover: true, link: true, glow: true) })
                    .name friends
                    .number
                        = @player.friendships.count
                    - if !@mutual_friends.nil? && @mutual_friends.length > 0
                        .mutual-friends{:rel => "tooltip", :title => @mutual_friends.to_sentence, :data => {:placement => "bottom"}}
                            #{@mutual_friends.length} in common
        .col-md-4.col-sm-6.col-xs-12
            .stats
                .well
                    - if  (defined? PlayerStat.for_period('eternity').for_user(@player).rank('kills')).nil?
                        .unqualified
                            %a{href: url_for(controller: 'users', action: 'stats')}
                            Player's rank unavailable
                    - else
                        .rank>
                            .number
                                = PlayerStat.for_period('eternity').for_user(@player).rank('kills')
                                %sup>= PlayerStat.for_period('eternity').for_user(@player).rank('kills').ordinalize[-2..-1]
                        .unqualified
                            %a{href: url_for(controller: 'users', action: 'stats')}
                            overall in kills
                    .rule
                    %div
                        .wellstats
                            .total>
                                .number= @stats.pretty_stat(:kd).round(1)
                                .name kd
                            .total>
                                .number= @stats.pretty_stat(:kk).round(1)
                                .name kk
                            .total>
                                .number= big_stat(@player.raindrops) ? number_to_human(@player.raindrops, :format => "%n%u", :units => { :thousand => "k", :million => "m" }, :precision => 3) : @player.raindrops
                                .name droplets
%section
    .row
        .col-md-12
            .tabbable
                %ul.nav.nav-tabs#user-tabs
                    %li.active
                        %a{:href => "#about", :data => {:toggle => "tab"}} About
                    %li
                        %a{:href => "#trophycase", :data => {:toggle => "tab"}} Trophy Case
                    %li
                        %a{:href => "#pvp-encounters", :data => {:toggle => "tab"}} PvP
                    %li
                        %a{:href => "#objectives", :data => {:toggle => "tab"}} Objectives
                    - unless @engagements.empty?
                        %li
                            %a{:href => "#matches", :data => {:toggle => "tab"}} Ranked Matches
                    - unless @maps.empty?
                        %li
                            %a{:href => "#maps", :data => {:toggle => "tab"}} Maps
                    - unless @punishments.nil?
                        %li
                            %a{:href => "#infractions", :data => {:toggle => "tab"}} Infractions
                    - if @appeals.exists?
                        %li
                            %a{:href => "#appeals", :data => {:toggle => "tab"}} Appeals
                    - unless @reports.values.all?(&:empty?)
                        %li
                            %a{:href => "#reports", :data => {:toggle => "tab"}} Reports
                    - if @alts_final || current_user_safe.has_permission?("misc", "name_change", "index", "all") || current_user_safe.has_permission?("misc", "name_change", "index", "own") && @same_user
                        %li
                            %a{:href => "#alts", :data => {:toggle => "tab"}} Alts
                .tab-content{:style => "overflow: visible;"}
                    .tab-pane.active#about
                        .row
                            - if !@player.public_email.to_s.empty?
                                .col-md-4.col-sm-6
                                    %h5.strong Email
                                    %blockquote
                                        %p
                                            %a{:href => "mailto:#{@player.public_email}"}= @player.public_email
                            - if !@player.twitter.to_s.empty?
                                .col-md-4.col-sm-6
                                    %h5.strong Twitter
                                    %blockquote
                                        %p
                                            %a{:href => "http://twitter.com/#{@player.twitter}", :target => "_blank"}= @player.twitter
                            - if !@player.steam.to_s.empty?
                                .col-md-4.col-sm-6
                                    %h5.strong Steam
                                    %blockquote
                                        %p
                                            %a{:href => "http://steamcommunity.com/id/#{@player.steam}", :target => "_blank"}= @player.steam
                            -#- if @player.channels_for(:youtube).exists?
                                .col-md-4.col-sm-6
                                    %h5.strong YouTube
                                    %blockquote
                                        %p
                                            %a= link_to_youtube_channel(@player)
                            - if !@player.twitch.to_s.empty?
                                .col-md-4.col-sm-6
                                    %h5.strong Twitch
                                    %blockquote
                                        %p
                                            %a{:href => "http://twitch.tv/#{@player.twitch}", :target => "_blank"}= @player.twitch
                            - if !@player.github.to_s.empty?
                                .col-md-4.col-sm-6
                                    %h5.strong Github
                                    %blockquote
                                        %p
                                            %a{:href => "https://github.com/#{@player.github}", :target => "_blank"}= @player.github
                            - if !@player.reddit.to_s.empty?
                                .col-md-4.col-sm-6
                                    %h5.strong Reddit
                                    %blockquote
                                        %p
                                            %a{:href => "http://reddit.com/user/#{@player.reddit}", :target => "_blank"}= @player.reddit
                            - if !@player.discord.to_s.empty?
                                .col-md-4.col-sm-6
                                    %h5.strong Discord
                                    %blockquote
                                        %p{:style => "color: #666"}
                                            = @player.discord
                            - if team = @player.team
                                .col-md-4.col-sm-6
                                    %h5.strong Team
                                    %blockquote
                                        %p
                                            %a{:href => team_path(team)}= team.name
                        .row
                            - if !@player.gender.to_s.empty?
                                .col-sm-6
                                    %h5.strong Gender
                                    %pre= @player.gender
                            - if !@player.location.to_s.empty?
                                .col-sm-6
                                    %h5.strong Location
                                    %pre= @player.location
                            - if !@player.occupation.to_s.empty?
                                .col-sm-6
                                    %h5.strong Occupation
                                    %pre= @player.occupation
                            - if !@player.interests.to_s.empty?
                                .col-sm-6
                                    %h5.strong Interests<commit_msg>Add join and play time stats, clean up social media<commit_after>- content_for :title do @player.username end
%section
    - if @player.suspended?
        - content_for :noindex, true
        .row
            .col-md-12
                .alert.alert-danger
                    %strong Account Suspended
                    This account has been suspended.
    - if @cake_day
        .row
            .col-md-12
                .alert.alert-info
                    %i.fa.fa-gift
                    %strong Happy Cake Day!
                    - same_user = is_same_user?(@player)
                    #{same_user ? "You" : @player.username} joined us #{@cake_years} year#{@cake_years > 1 ? "s" : nil} ago, today. #{same_user ? "Thanks for hanging out!" : "Wish #{gender_pronoun_for(@player)[:singular]} a happy Cake Day!"}
    .row
        .col-md-12
            = render partial: "friendships/widget", locals: {user: @player}
            %h2.strong{style: "margin-top: 0"}
                %span{:style => "color: " + html_color(@player)}
                    = @player.username
                - if @previous_username
                    %small (formerly #{@previous_username})
            - if @actions.size > 0
                .btn-group.pull-right
                    %button.btn.btn-default.btn-sm.dropdown-toggle{:data => {:toggle => "dropdown"}}
                        %span.fa.fa-cog
                        %span.caret
                    %ul.dropdown-menu
                        - @actions.each do |text, method, path|
                            %li= link_to text, path, method: method
            %div
                - @player.badge_memberships.each do |mem|
                    = render_badge(@player, mem.group, tooltip: mem.staff_role.presence || mem.stop < Time::INF_FUTURE && "Expires in #{format_package_expire(mem.stop)}")
    .row{style: "margin-top: 20px"}
        .col-md-2.col-sm-3.col-xs-6
            %a{:href => "#", :style => "width: 130px; height: 130px;"}
                = avatar_for(@player, 130, glow: true)
            - if @last_sighting
                .last-seen
                    - if @last_sighting.online
                        .online online now
                        .server
                            - if @show_server && @last_sighting.server
                                - if current_user_safe.can_teleport_to?(@player)
                                    = teleport_button(@player)
                                %a{:href => main_app.play_path}
                                    = @last_sighting.server.name
                                    .datacenter
                                        = "[#{@last_sighting.server.datacenter}]"
                        .time{:rel => "tooltip", :title => format_time(@last_sighting.time), :data => {:placement => "bottom", :container => "body"}}
                            for
                            = time_ago_in_words(@last_sighting.time, false, :vague => true)
                        - if @last_sighting.session.nickname
                            .nickname
                                as
                                = @last_sighting.session.nickname
                    - else
                        .offline last seen
                        - if @show_server && @last_sighting.server
                            .server
                                - if @show_server && @last_sighting.server
                                    %a{:href => main_app.play_path}
                                        = @last_sighting.server.name
                                        .datacenter
                                            = "[#{@last_sighting.server.datacenter}]"
                        .time{:rel => "tooltip", :title => format_time(@last_sighting.time), :data => {:placement => "bottom", :container => "body"}}
                            = time_ago_in_words(@last_sighting.time, false, :vague => true)
                            ago
        .col-md-6.col-sm-3.col-xs-6
            .row.heads
                .col-md-4
                    - kills = @stats.pretty_stat(:kills)
                    .hidden-sm.hidden-xs
                        = join_safe(@kills[0...16].map{|kill| avatar_for(kill.victim_obj, 32, hover: true, link: true)})
                    .name kills
                    .number{:rel => (mega_stat(kills) ? "tooltip" : ""), :title => "#{kills} kills", :data => {:placement => "top"}}
                        = mega_stat(kills) ? number_to_human(kills, :format => "%n%u", :units => { :thousand => "k" }, :precision => 4) : kills
                .col-md-4
                    - deaths = @stats.pretty_stat(:deaths)
                    .hidden-sm.hidden-xs
                        = join_safe(@deaths[0...16].map{|death| avatar_for(death.killer_obj, 32, hover: true, link: true)})
                    .name deaths
                    .number{:rel => (mega_stat(deaths) ? "tooltip" : ""), :title => "#{deaths} deaths", :data => {:placement => "top"}}
                        = mega_stat(deaths) ? number_to_human(deaths, :format => "%n%u", :units => { :thousand => "k" }, :precision => 4) : deaths
                .col-md-4
                    .hidden-sm.hidden-xs
                        = join_safe(@friends.map{|friend| avatar_for(friend, 32, hover: true, link: true, glow: true) })
                    .name friends
                    .number
                        = @player.friendships.count
                    - if !@mutual_friends.nil? && @mutual_friends.length > 0
                        .mutual-friends{:rel => "tooltip", :title => @mutual_friends.to_sentence, :data => {:placement => "bottom"}}
                            #{@mutual_friends.length} in common
        .col-md-4.col-sm-6.col-xs-12
            .stats
                .well
                    - if  (defined? PlayerStat.for_period('eternity').for_user(@player).rank('kills')).nil?
                        .unqualified
                            %a{href: url_for(controller: 'users', action: 'stats')}
                            Player's rank unavailable
                    - else
                        .rank>
                            .number
                                = PlayerStat.for_period('eternity').for_user(@player).rank('kills')
                                %sup>= PlayerStat.for_period('eternity').for_user(@player).rank('kills').ordinalize[-2..-1]
                        .unqualified
                            %a{href: url_for(controller: 'users', action: 'stats')}
                            overall in kills
                    .rule
                    %div
                        .wellstats
                            .total>
                                .number= @stats.pretty_stat(:kd).round(1)
                                .name kd
                            .total>
                                .number= @stats.pretty_stat(:kk).round(1)
                                .name kk
                            .total>
                                .number= big_stat(@player.raindrops) ? number_to_human(@player.raindrops, :format => "%n%u", :units => { :thousand => "k", :million => "m" }, :precision => 3) : @player.raindrops
                                .name droplets
%section
    .row
        .col-md-12
            .tabbable
                %ul.nav.nav-tabs#user-tabs
                    %li.active
                        %a{:href => "#about", :data => {:toggle => "tab"}} About
                    %li
                        %a{:href => "#trophycase", :data => {:toggle => "tab"}} Trophy Case
                    %li
                        %a{:href => "#pvp-encounters", :data => {:toggle => "tab"}} PvP
                    %li
                        %a{:href => "#objectives", :data => {:toggle => "tab"}} Objectives
                    - unless @engagements.empty?
                        %li
                            %a{:href => "#matches", :data => {:toggle => "tab"}} Ranked Matches
                    - unless @maps.empty?
                        %li
                            %a{:href => "#maps", :data => {:toggle => "tab"}} Maps
                    - unless @punishments.nil?
                        %li
                            %a{:href => "#infractions", :data => {:toggle => "tab"}} Infractions
                    - if @appeals.exists?
                        %li
                            %a{:href => "#appeals", :data => {:toggle => "tab"}} Appeals
                    - unless @reports.values.all?(&:empty?)
                        %li
                            %a{:href => "#reports", :data => {:toggle => "tab"}} Reports
                    - if @alts_final || current_user_safe.has_permission?("misc", "name_change", "index", "all") || current_user_safe.has_permission?("misc", "name_change", "index", "own") && @same_user
                        %li
                            %a{:href => "#alts", :data => {:toggle => "tab"}} Alts
                .tab-content{:style => "overflow: visible;"}
                    .tab-pane.active#about
                        .row
                            .col-md-3.col-sm-6
                                %h4.strong{:rel => "tooltip", :title => "First joined on " + vague_format_time(@initial_join), :data => {:placement => "top"}}
                                    = @days_here
                                    %small.strong days since first seen
                            .col-md-3.col-sm-6
                                %h4.strong
                                    = @hours_played
                                    %small.strong hours played
                            .col-md-3.col-sm-6
                                %h4.strong
                                    = @teams_joined
                                    %small.strong teams joined
                        .row
                            - if !@player.public_email.to_s.empty?
                                .col-md-3.col-sm-6
                                    %h5.strong Email
                                    %blockquote
                                        %p
                                            %a{:href => "mailto:#{@player.public_email}"}= @player.public_email
                            - if !@player.twitter.to_s.empty?
                                .col-md-3.col-sm-6
                                    %h5.strong Twitter
                                    %blockquote
                                        %p
                                            %a{:href => "http://twitter.com/#{@player.twitter}", :target => "_blank"}= @player.twitter
                            - if !@player.steam.to_s.empty?
                                .col-md-3.col-sm-6
                                    %h5.strong Steam
                                    %blockquote
                                        %p
                                            %a{:href => "http://steamcommunity.com/id/#{@player.steam}", :target => "_blank"}= @player.steam
                            -#- if @player.channels_for(:youtube).exists?
                                .col-md-3.col-sm-6
                                    %h5.strong YouTube
                                    %blockquote
                                        %p
                                            %a= link_to_youtube_channel(@player)
                            - if !@player.twitch.to_s.empty?
                                .col-md-3.col-sm-6
                                    %h5.strong Twitch
                                    %blockquote
                                        %p
                                            %a{:href => "http://twitch.tv/#{@player.twitch}", :target => "_blank"}= @player.twitch
                            - if !@player.github.to_s.empty?
                                .col-md-3.col-sm-6
                                    %h5.strong Github
                                    %blockquote
                                        %p
                                            %a{:href => "https://github.com/#{@player.github}", :target => "_blank"}= @player.github
                            - if !@player.reddit.to_s.empty?
                                .col-md-3.col-sm-6
                                    %h5.strong Reddit
                                    %blockquote
                                        %p
                                            %a{:href => "http://reddit.com/user/#{@player.reddit}", :target => "_blank"}= @player.reddit
                            - if !@player.discord.to_s.empty?
                                .col-md-3.col-sm-6
                                    %h5.strong Discord
                                    %blockquote
                                        %p{:style => "color: #666"}
                                            = @player.discord
                            - if team = @player.team
                                .col-md-3.col-sm-6
                                    %h5.strong Team
                                    %blockquote
                                        %p
                                            %a{:href => team_path(team)}= team.name
                        .row
                            - if !@player.gender.to_s.empty?
                                .col-sm-6
                                    %h5.strong Gender
                                    %pre= @player.gender
                            - if !@player.location.to_s.empty?
                                .col-sm-6
                                    %h5.strong Location
                                    %pre= @player.location
                            - if !@player.occupation.to_s.empty?
                                .col-sm-6
                                    %h5.strong Occupation
                                    %pre= @player.occupation
                            - if !@player.interests.to_s.empty?
                                .col-sm-6
                                    %h5.strong Interests
{'fraction_non_alphanumeric': 0.12029855114883653, 'fraction_numerical': 0.007207668666764233, 'mean_word_length': 0.8759780370624571, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 199, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 140, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5143039', 'n_tokens_mistral': 7164, 'n_tokens_neox': 6608, 'n_words': 1196}