<commit_before><% if @highlight_words.nil?
      @highlight_words = []
end %>

<div class="request_listing">
  <div class="request_left">
      <span class="head">
        <% if event.is_incoming_message? %>
            <%= link_to highlight_words(info_request.title, @highlight_words), incoming_message_url(event.incoming_message_selective_columns("incoming_messages.id")) %>
        <% elsif event.is_outgoing_message? and event.event_type == 'followup_sent' %>
            <%= link_to highlight_words(info_request.title, @highlight_words), outgoing_message_url(event.outgoing_message) %>
        <% elsif event.is_comment? %>
            <%= link_to highlight_words(info_request.title, @highlight_words), comment_url(event.comment) %>
        <% else %>
            <%= link_to highlight_words(info_request.title, @highlight_words), request_url(info_request) %>
        <% end %>
      </span>
      <div class="requester">
        <% if event.event_type == 'sent' %>
            <%= _('Request sent to {{public_body_name}} by {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at )) %>
        <% elsif event.event_type == 'followup_sent' %>
            <%=event.display_status %>
            <%= _('sent to {{public_body_name}} by {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at )) %>
        <% elsif event.event_type == 'response' %>
            <%=event.display_status %>
            <%= _('by {{public_body_name}} to {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at )) %>
        <% elsif event.event_type == 'comment' %>
            <%= _('Request to {{public_body_name}} by {{info_request_user}}. Annotated by {{event_comment_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>user_link_absolute(info_request.user),:event_comment_user=>user_link_absolute(event.comment.user),:date=>simple_date(event.created_at)) %>
        <% else %>
            <%# Events of other types will not be indexed: see InfoRequestEvent#indexed_by_search?
                However, it can happen that we see other types of event transiently here in the period
                between a change being made and the update-xapian-index job being run. %>
            <!-- Event of type '<%= event.event_type %>', id=<%= event.id %> -->
        <% end %>
      </div>
      <span class="bottomline icon_<%= info_request.calculate_status %>">
        <strong>
        <%= info_request.display_status(cached_value_ok=true) %>
        </strong><br>
      </span>
  </div>
  <div class="request_right">
    <span class="desc">
        <%= highlight_and_excerpt(event.search_text_main(true), @highlight_words, 150) %>
    </span>
  </div>
</div>
<commit_msg>Handle the case of a comment on an external request.<commit_after><% if @highlight_words.nil?
      @highlight_words = []
end %>

<div class="request_listing">
  <div class="request_left">
      <span class="head">
        <% if event.is_incoming_message? %>
            <%= link_to highlight_words(info_request.title, @highlight_words), incoming_message_url(event.incoming_message_selective_columns("incoming_messages.id")) %>
        <% elsif event.is_outgoing_message? and event.event_type == 'followup_sent' %>
            <%= link_to highlight_words(info_request.title, @highlight_words), outgoing_message_url(event.outgoing_message) %>
        <% elsif event.is_comment? %>
            <%= link_to highlight_words(info_request.title, @highlight_words), comment_url(event.comment) %>
        <% else %>
            <%= link_to highlight_words(info_request.title, @highlight_words), request_url(info_request) %>
        <% end %>
      </span>
      <div class="requester">
        <% if event.event_type == 'sent' %>
            <%= _('Request sent to {{public_body_name}} by {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at )) %>
        <% elsif event.event_type == 'followup_sent' %>
            <%=event.display_status %>
            <%= _('sent to {{public_body_name}} by {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at )) %>
        <% elsif event.event_type == 'response' %>
            <%=event.display_status %>
            <%= _('by {{public_body_name}} to {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at )) %>
        <% elsif event.event_type == 'comment' %>
            <%= _('Request to {{public_body_name}} by {{info_request_user}}. Annotated by {{event_comment_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:event_comment_user=>user_link_absolute(event.comment.user),:date=>simple_date(event.created_at)) %>
        <% else %>
            <%# Events of other types will not be indexed: see InfoRequestEvent#indexed_by_search?
                However, it can happen that we see other types of event transiently here in the period
                between a change being made and the update-xapian-index job being run. %>
            <!-- Event of type '<%= event.event_type %>', id=<%= event.id %> -->
        <% end %>
      </div>
      <span class="bottomline icon_<%= info_request.calculate_status %>">
        <strong>
        <%= info_request.display_status(cached_value_ok=true) %>
        </strong><br>
      </span>
  </div>
  <div class="request_right">
    <span class="desc">
        <%= highlight_and_excerpt(event.search_text_main(true), @highlight_words, 150) %>
    </span>
  </div>
</div>

{'fraction_non_alphanumeric': 0.14757709251101322, 'fraction_numerical': 0.0009439899307740718, 'mean_word_length': 4.0532591414944354, 'pattern_counts': {'":': 0, '<': 95, '<?xml version=': 0, '>': 121, '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': '6713848', 'n_tokens_mistral': 2074, 'n_tokens_neox': 1937, 'n_words': 311}