<commit_before>- @title = 'Forum'

- content_for :body_class do
  myapnea-sky-bg

- content_for :header do
  .header-container
    .container
      %h1.page-heading
        .pull-right
          %span#forum-top-container= link_to 'Start New Topic', async_forum_new_topic_path, method: :post, remote: true, class: 'btn btn-accent btn-shadow'
          = render 'layouts/per_page', per_page: 40, object_count: @topics.total_count
        = @title
        = render 'search/toggle'

= render 'search/simple', url: search_path

#new-topic-container{ style: 'display:none;' }

.dashboard-container
  %table.table.table-striped.table-borderless
    %col
    %col.hidden-xs{ width: '50px' }
    %col.hidden-xs.hidden-sm{ width: '50px' }
    %col.hidden-xs.hidden-sm{ width: '150px' }
    %thead
      %tr
        %th.small= link_to 'Topics', topics_path
        = th_sort_field_rev @order, 'reply_count', 'Replies', extra_class: 'small hidden-xs center'
        = th_sort_field_rev @order, 'topics.view_count', 'Views', extra_class: 'small hidden-xs hidden-sm center'
        = th_sort_field_rev @order, 'topics.last_reply_at', 'Last Post', extra_class: 'small hidden-xs hidden-sm center'
    %tbody
      - @topics.each do |topic|
        - unread_replies = topic.unread_replies(current_user)
        - next_unread_reply = topic.next_unread_reply(current_user)
        %tr
          %td.breakword{ class: current_user && (!topic.started_reading?(current_user) || unread_replies > 0) ? 'topic-line-unread' : 'topic-line-read' }
            .pull-right
              - if next_unread_reply
                %small
                  = link_to next_unread_reply, data: { turbolinks: false }, class: 'link-accent' do
                    = unread_replies
                    new
                    %fa.fa.fa-comments-o
              - elsif topic.last_page > 1
                %span.hidden-xs
                  = link_to '1', topic, class: 'btn btn-xs btn-default'
                  \...
                  = link_to topic.last_page, page_topic_path(topic, page: topic.last_page), class: 'btn btn-xs btn-default'
            = image_tag user_photo_url(topic.user), alt: '', style: "max-height:#{16+3}px;border-radius:4px", title: topic.user.forum_name, data: { toggle: 'tooltip', container: 'body', placement: 'top' }
            - if current_user && current_user.admin? && topic.user.shadow_banned?
              %span.glyphicon.glyphicon-eye-close.text-muted
            - if topic.pinned?
              %span.glyphicon.glyphicon-pushpin.text-muted
            - if next_unread_reply
              = link_to topic.title, next_unread_reply, data: { turbolinks: false }, class: (topic.started_reading?(current_user) && unread_replies.zero?) ? 'topic-read' : 'topic-unread'
            - else
              = link_to topic.title, topic, class: (topic.started_reading?(current_user) && unread_replies.zero?) ? 'topic-read' : 'topic-unread'
          %td.text-muted.hidden-xs.center
            %span.small= number_with_delimiter topic.reply_count - 1
          %td.text-muted.hidden-xs.hidden-sm.center
            %span.small= number_to_human topic.view_count, precision: 2
          %td.text-muted.hidden-xs.hidden-sm.center
            %span.small= time_ago_in_words(topic.last_reply_at).gsub('about ', '').gsub('less than ', '').gsub('minutes', 'mins').gsub('hours', 'hrs') + ' ago'

.center= paginate @topics, theme: 'bootstrap-small'<commit_msg>Added time abbreviations for months and years on forum index<commit_after>- @title = 'Forum'

- content_for :body_class do
  myapnea-sky-bg

- content_for :header do
  .header-container
    .container
      %h1.page-heading
        .pull-right
          %span#forum-top-container= link_to 'Start New Topic', async_forum_new_topic_path, method: :post, remote: true, class: 'btn btn-accent btn-shadow'
          = render 'layouts/per_page', per_page: 40, object_count: @topics.total_count
        = @title
        = render 'search/toggle'

= render 'search/simple', url: search_path

#new-topic-container{ style: 'display:none;' }

.dashboard-container
  %table.table.table-striped.table-borderless
    %col
    %col.hidden-xs{ width: '50px' }
    %col.hidden-xs.hidden-sm{ width: '50px' }
    %col.hidden-xs.hidden-sm{ width: '150px' }
    %thead
      %tr
        %th.small= link_to 'Topics', topics_path
        = th_sort_field_rev @order, 'reply_count', 'Replies', extra_class: 'small hidden-xs center'
        = th_sort_field_rev @order, 'topics.view_count', 'Views', extra_class: 'small hidden-xs hidden-sm center'
        = th_sort_field_rev @order, 'topics.last_reply_at', 'Last Post', extra_class: 'small hidden-xs hidden-sm center'
    %tbody
      - @topics.each do |topic|
        - unread_replies = topic.unread_replies(current_user)
        - next_unread_reply = topic.next_unread_reply(current_user)
        %tr
          %td.breakword{ class: current_user && (!topic.started_reading?(current_user) || unread_replies > 0) ? 'topic-line-unread' : 'topic-line-read' }
            .pull-right
              - if next_unread_reply
                %small
                  = link_to next_unread_reply, data: { turbolinks: false }, class: 'link-accent' do
                    = unread_replies
                    new
                    %fa.fa.fa-comments-o
              - elsif topic.last_page > 1
                %span.hidden-xs
                  = link_to '1', topic, class: 'btn btn-xs btn-default'
                  \...
                  = link_to topic.last_page, page_topic_path(topic, page: topic.last_page), class: 'btn btn-xs btn-default'
            = image_tag user_photo_url(topic.user), alt: '', style: "max-height:#{16+3}px;border-radius:4px", title: topic.user.forum_name, data: { toggle: 'tooltip', container: 'body', placement: 'top' }
            - if current_user && current_user.admin? && topic.user.shadow_banned?
              %span.glyphicon.glyphicon-eye-close.text-muted
            - if topic.pinned?
              %span.glyphicon.glyphicon-pushpin.text-muted
            - if next_unread_reply
              = link_to topic.title, next_unread_reply, data: { turbolinks: false }, class: (topic.started_reading?(current_user) && unread_replies.zero?) ? 'topic-read' : 'topic-unread'
            - else
              = link_to topic.title, topic, class: (topic.started_reading?(current_user) && unread_replies.zero?) ? 'topic-read' : 'topic-unread'
          %td.text-muted.hidden-xs.center
            %span.small= number_with_delimiter topic.reply_count - 1
          %td.text-muted.hidden-xs.hidden-sm.center
            %span.small= number_to_human topic.view_count, precision: 2
          %td.text-muted.hidden-xs.hidden-sm.center
            %span.small= time_ago_in_words(topic.last_reply_at).gsub('about ', '').gsub('less than ', '').gsub('minutes', 'mins').gsub('minute', 'min').gsub('hours', 'hrs').gsub('hour', 'hr').gsub('months', 'mths').gsub('month', 'mth').gsub('years', 'yrs').gsub('year', 'yr') + ' ago'

.center= paginate @topics, theme: 'bootstrap-small'
{'fraction_non_alphanumeric': 0.13774495881851748, 'fraction_numerical': 0.005396194262993468, 'mean_word_length': 2.5897043832823647, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4916225', 'n_tokens_mistral': 2387, 'n_tokens_neox': 2328, 'n_words': 434}