<commit_before>extends ../layout

block content
  .page-header
    h3 Messages

  .message-layout-grid
    .sidebar
      .search-box
        input#message-search(type="text" placeholder="Search by name")
      ul.thread-list#thread-list
       each thread, i in threads
         - var participants = thread.participants.map(function(user){return user._id}).sort()
         li(data-thread-id="#{thread._id}" data-thread-participants=participants)
           .message-snippet
             img.profile-pic(src=thread.participants[0].profile.picture || "images/person_placeholder.gif")
             .snippet-text
               .timestamp=thread.messages.slice(-1)[0].timeSent.getHours() + ':' + ('0'+ thread.messages.slice(-1)[0].timeSent.getMinutes()).slice(-2)
               .sender=thread.participants[0].profile.name
               .message-content=thread.messages.slice(-1)[0].message
    .conversation-container
      .header#conversation-header
        h3= (threads.length > 0 ? threads[0].participants[0].profile.name : "No messages")
          button.new-message-button#new-message-button New Message
        input#name-input(type="text" placeholder="Type a name..." style="width:80%;display:none;")
      .conversation#conversation-list

      form.message-form
        .form-group
          textarea#text-input(placeholder="Write message" rows=4)
        .form-group
          button#send-button(type="submit") Send message
  script(src='/js/message.js')
  script(type='text/javascript').
    var local_user_data =!{JSON.stringify(user_data)}
<commit_msg>Add 'is-pending' class to unread threads<commit_after>extends ../layout

block content
  .page-header
    h3 Messages

  .message-layout-grid
    .sidebar
      .search-box
        input#message-search(type="text" placeholder="Search by name")
      ul.thread-list#thread-list
       each thread, i in threads
         - var participants = thread.participants.map(function(user){return user._id}).sort()
         - var thread_klass = user.unreadThreads.indexOf(thread._id) >= 0 ? 'is-pending' : ''
         li(data-thread-id="#{thread._id}" data-thread-participants=participants class="#{thread_klass}")
           .message-snippet
             img.profile-pic(src=thread.participants[0].profile.picture || "images/person_placeholder.gif")
             .snippet-text
               .timestamp=thread.messages.slice(-1)[0].timeSent.getHours() + ':' + ('0'+ thread.messages.slice(-1)[0].timeSent.getMinutes()).slice(-2)
               .sender=thread.participants[0].profile.name
               .message-content=thread.messages.slice(-1)[0].message
    .conversation-container
      .header#conversation-header
        h3= (threads.length > 0 ? threads[0].participants[0].profile.name : "No messages")
          button.new-message-button#new-message-button New Message
        input#name-input(type="text" placeholder="Type a name..." style="width:80%;display:none;")
      .conversation#conversation-list

      form.message-form
        .form-group
          textarea#text-input(placeholder="Write message" rows=4)
        .form-group
          button#send-button(type="submit") Send message
  script(src='/js/message.js')
  script(type='text/javascript').
    var local_user_data =!{JSON.stringify(user_data)}

{'fraction_non_alphanumeric': 0.14625954198473282, 'fraction_numerical': 0.011297709923664122, 'mean_word_length': 2.923353293413174, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '1343262', 'n_tokens_mistral': 979, 'n_tokens_neox': 956, 'n_words': 143}