<commit_before>extends ../layout

block content
    include ../partials/joinsite

    if !filteredUser
        .page-header
            h4
              if filteredSource
                | News from #{filteredSource}
              else
                | Top News
    else
        .row.user-profile
            .col-md-6
                if userProfile
                    h1
                        if userProfile.picture
                            img(src='#{userProfile.picture}')
                        if userProfile.name
                            | #{userProfile.name}
            .col-md-6
                dl.pull-right
                    dt GitHub:
                    dd
                        a(href='http://github.com/#{filteredUser}', target='_blank') http://github.com/#{filteredUser}
                    br
                    if userProfile.location
                        dt Location:
                        dd= userProfile.location
                        br
                    if userProfile.website
                        dt Website:
                        dd
                            a(href='#{userProfile.website}', target='_blank') #{userProfile.website}
        .page-header
          ul.nav.nav-tabs
            li.active
              a(href='#news', data-toggle='tab')
                h4 News Submitted
            li
              a(href='#comments', data-toggle='tab')
                h4 Comments

    div.tab-content
      div#news.tab-pane.fade.in.active
        table.table.table-condensed
            thead
                tr
                    th.text-muted #
                    th
                    th Votes
                    th Title
                    if !filteredSource
                        th Source
            tbody.news-table
                each item, index in items
                    tr
                        td.text-muted= index + 1
                        td
                            if !item.votedFor
                                form(action='/news/' + item._id, method='POST', class='upvote-form')
                                    input(type='hidden', name='amount', value='1')
                                    button(type='submit', class='upvote')
                                        i.fa.fa-chevron-up

                        td
                            span.badge= item.votes
                        td
                            a(href=item.url)
                                | #{item.title}
                            if item.summary
                                | &nbsp;
                                a(href="#", class="show-summary")
                                    | ...
                            br
                            span
                                small.submit-date(title="#{item.created}")= timeago(item.created)
                                small #{' '}by#{' '}
                                if item.poster
                                    a(href='/news/user/' + item.poster.username)
                                        small #{item.poster.username}
                                else
                                    span.text-muted
                                        | [deleted]
                                small #{' '}with#{' '}
                                a(class="comment-link", id="comment_"+item._id, href='/news/' + item._id)
                                    case item.comment_count
                                        when 0
                                            small no comments
                                        when 1
                                            small 1 comment
                                        default
                                            small #{item.comment_count} comments
                            br
                            p(class='hidden summary')
                                em= item.summary
                        if !filteredSource
                            td
                                a(href='/news/source/' + item.source)
                                    | #{item.source}

      if filteredUser
        div#comments.tab-pane.fade
            table.table.table-condensed
                thead
                    tr<commit_msg>added latest comment time data object to index view<commit_after>extends ../layout

block content
    include ../partials/joinsite

    if !filteredUser
        .page-header
            h4
              if filteredSource
                | News from #{filteredSource}
              else
                | Top News
    else
        .row.user-profile
            .col-md-6
                if userProfile
                    h1
                        if userProfile.picture
                            img(src='#{userProfile.picture}')
                        if userProfile.name
                            | #{userProfile.name}
            .col-md-6
                dl.pull-right
                    dt GitHub:
                    dd
                        a(href='http://github.com/#{filteredUser}', target='_blank') http://github.com/#{filteredUser}
                    br
                    if userProfile.location
                        dt Location:
                        dd= userProfile.location
                        br
                    if userProfile.website
                        dt Website:
                        dd
                            a(href='#{userProfile.website}', target='_blank') #{userProfile.website}
        .page-header
          ul.nav.nav-tabs
            li.active
              a(href='#news', data-toggle='tab')
                h4 News Submitted
            li
              a(href='#comments', data-toggle='tab')
                h4 Comments

    div.tab-content
      div#news.tab-pane.fade.in.active
        table.table.table-condensed
            thead
                tr
                    th.text-muted #
                    th
                    th Votes
                    th Title
                    if !filteredSource
                        th Source
            tbody.news-table
                each item, index in items
                    tr
                        td.text-muted= index + 1
                        td
                            if !item.votedFor
                                form(action='/news/' + item._id, method='POST', class='upvote-form')
                                    input(type='hidden', name='amount', value='1')
                                    button(type='submit', class='upvote')
                                        i.fa.fa-chevron-up

                        td
                            span.badge= item.votes
                        td
                            a(href=item.url)
                                | #{item.title}
                            if item.summary
                                | &nbsp;
                                a(href="#", class="show-summary")
                                    | ...
                            br
                            span
                                small.submit-date(title="#{item.created}")= timeago(item.created)
                                small #{' '}by#{' '}
                                if item.poster
                                    a(href='/news/user/' + item.poster.username)
                                        small #{item.poster.username}
                                else
                                    span.text-muted
                                        | [deleted]
                                small #{' '}with#{' '}
                                a(data-last-comment="#{item.latestCommentTime}" class="comment-link", id="comment_"+item._id, href='/news/' + item._id)
                                    case item.comment_count
                                        when 0
                                            small no comments
                                        when 1
                                            small 1 comment
                                        default
                                            small #{item.comment_count} comments
                            br
                            p(class='hidden summary')
                                em= item.summary
                        if !filteredSource
                            td
                                a(href='/news/source/' + item.source)
                                    | #{item.source}

      if filteredUser
        div#comments.tab-pane.fade
            table.table.table-condensed
                thead
                    tr
{'fraction_non_alphanumeric': 0.07790858725761773, 'fraction_numerical': 0.0025392428439519853, 'mean_word_length': 0.6501618739287754, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 50, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3587055', 'n_tokens_mistral': 1860, 'n_tokens_neox': 1703, 'n_words': 348}