<commit_before>- threaded = false unless local_assigns[:threaded]
- simpleconv = false unless local_assigns[:simpleconv]

- cache_editable_comment(comment, threaded, simpleconv) do
  %div[comment]{ :'data-editable-before' => datetime_ms(15.minutes.since(comment.created_at)) }
    .info
      - if threaded
        = micro_avatar(comment.user)
      - else
        = thumb_avatar(comment.user)
    .block
      - unless rss?
        .actions_menu
          %span.actiondate= posted_date comment.created_at
          = image_tag('triangle.png', :class => 'triangle')
          .extra
            - case comment.target
            - when Conversation
              = link_to t('comments.actions.conversation_url'), project_conversation_path(comment.project, comment.target)
            - if can?(:update, comment)
              = link_to t('comments.actions.edit'), [:edit, comment.project, comment.target, comment],
                  :rel => 'facebox', :'data-uneditable-message' => t('.cannot_edit')
            - else
              %span= t('.cannot_edit')
            - if can?(:destroy, comment)
              = link_to t('common.delete'), [comment.project, comment.target, comment], :'data-method' => 'delete',
                  :'data-confirm' => t('.confirm_delete'), :'data-remote' => true
      .body.textilized
        .before
          = link_to(comment.user.name, comment.user, :class => :user) + " "
          - if comment.task_comment?
            = comment_task_status(comment)
          - if comment.hours?
            = content_tag(:span, friendly_hours_value(comment.hours), :class => :hours)
        ~ comment.body_html

      - if comment.uploads.any?
        - if comment.uploads.all? { |upload| upload.image? }
          .upload_images
            = list_uploads_inline_with_thumbnails(comment.uploads)
        - else
          .upload_list
            = list_uploads_inline(comment.uploads)
    .clear<commit_msg>Legacy comments targeting projects raised an exception<commit_after>- threaded = false unless local_assigns[:threaded]
- simpleconv = false unless local_assigns[:simpleconv]

- cache_editable_comment(comment, threaded, simpleconv) do
  %div[comment]{ :'data-editable-before' => datetime_ms(15.minutes.since(comment.created_at)) }
    .info
      - if threaded
        = micro_avatar(comment.user)
      - else
        = thumb_avatar(comment.user)
    .block
      - unless rss?
        .actions_menu
          %span.actiondate= posted_date comment.created_at
          = image_tag('triangle.png', :class => 'triangle')
          .extra
            - case comment.target
            - when Conversation
              = link_to t('comments.actions.conversation_url'), project_conversation_path(comment.project, comment.target)
            - if can?(:update, comment)
              = link_to t('comments.actions.edit'), [:edit, comment.project, comment.target, comment],
                  :rel => 'facebox', :'data-uneditable-message' => t('.cannot_edit')
            - else
              %span= t('.cannot_edit')
            - if can?(:destroy, comment)
              - if comment.target.is_a? Project # legacy comments targeting a Project
                = link_to t('common.delete'), [comment.project, comment], :'data-method' => 'delete',
                    :'data-confirm' => t('.confirm_delete'), :'data-remote' => true
              - else
                = link_to t('common.delete'), [comment.project, comment.target, comment], :'data-method' => 'delete',
                    :'data-confirm' => t('.confirm_delete'), :'data-remote' => true
      .body.textilized
        .before
          = link_to(comment.user.name, comment.user, :class => :user) + " "
          - if comment.task_comment?
            = comment_task_status(comment)
          - if comment.hours?
            = content_tag(:span, friendly_hours_value(comment.hours), :class => :hours)
        ~ comment.body_html

      - if comment.uploads.any?
        - if comment.uploads.all? { |upload| upload.image? }
          .upload_images
            = list_uploads_inline_with_thumbnails(comment.uploads)
        - else
          .upload_list
            = list_uploads_inline(comment.uploads)
    .clear
{'fraction_non_alphanumeric': 0.12903992395437264, 'fraction_numerical': 0.0009505703422053232, 'mean_word_length': 2.240184757505774, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 24, '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': '6623696', 'n_tokens_mistral': 1236, 'n_tokens_neox': 1177, 'n_words': 222}