{% load i18n misago_capture misago_shorthands %}
<li id="post-{{ post.pk }}" class="event {{ post.is_hidden|iftrue:'event-hidden' }}">
  {% if not post.is_read %}
    <div class="event-label">
      <span class="label label-unread">{% trans "New event" %}</span>
    </div>
  {% endif %}
  <div class="event-body">
    <div class="event-icon">
      <span class="event-icon-bg">
        <span class="material-icon">
          {% if post.event_type == 'changed_title' %}
            edit
          {% elif post.event_type == 'pinned_globally' %}
            bookmark
          {% elif post.event_type == 'pinned_locally' %}
            bookmark_border
          {% elif post.event_type == 'unpinned' %}
            panorama_fish_eye
          {% elif post.event_type == 'moved' %}
            arrow_forward
          {% elif post.event_type == 'merged' %}
            call_merge
          {% elif post.event_type == 'approved' %}
            done
          {% elif post.event_type == 'opened' %}
            lock_open
          {% elif post.event_type == 'closed' %}
            lock_outline
          {% elif post.event_type == 'unhid' %}
            visibility
          {% elif post.event_type == 'hid' %}
            visibility_off
          {% elif post.event_type == 'changed_owner' or post.event_type == 'tookover' %}
            grade
          {% elif post.event_type == 'added_participant' %}
            person_add
          {% elif post.event_type == 'owner_left' or post.event_type == 'participant_left' or post.event_type == 'removed_participant' %}
            person_outline
          {% elif post.event_type == 'removed_participant' %}
            remove_circle_outline
          {% endif %}
        </span>
      </span>
    </div>
    <div class="event-content">
      <p class="event-message">
        {% if post.event_type == 'changed_title' %}
          {% capture trimmed as old_title %}
            <span class="item-title">{{ post.event_context.old_title }}</span>
          {% endcapture %}
          {% blocktrans trimmed with old_title=old_title|safe %}
            Thread title has been changed from {{ old_title }}.
          {% endblocktrans %}
        {% elif post.event_type == 'pinned_globally' %}
          {% trans "Thread has been pinned globally." %}
        {% elif post.event_type == 'pinned_locally' %}
          {% trans "Thread has been pinned locally." %}
        {% elif post.event_type == 'unpinned' %}
          {% trans "Thread has been unpinned." %}
        {% elif post.event_type == 'moved' %}
          {% capture trimmed as from_category %}
            <a href="{{ post.event_context.from_category.url }}" class="item-title">{{ post.event_context.from_category.name }}</a>
          {% endcapture %}
          {% blocktrans trimmed with from_category=from_category|safe %}
            Thread has been moved from {{ from_category }}.
          {% endblocktrans %}
        {% elif post.event_type == 'merged' %}
          {% capture trimmed as merged_thread %}
            <span class="item-title">{{ post.event_context.merged_thread }}</span>
          {% endcapture %}
          {% blocktrans trimmed with merged_thread=merged_thread|safe %}
            The {{ merged_thread }} thread has been merged into this thread.
          {% endblocktrans %}
        {% elif post.event_type == 'approved' %}
          {% trans "Thread has been approved." %}
        {% elif post.event_type == 'opened' %}
          {% trans "Thread has been opened." %}
        {% elif post.event_type == 'closed' %}
          {% trans "Thread has been closed." %}
        {% elif post.event_type == 'unhid' %}
          {% trans "Thread has been revealed." %}
        {% elif post.event_type == 'hid' %}
          {% trans "Thread has been made hidden." %}
        {% elif post.event_type == 'tookover' %}
          {% trans "Took thread over." %}
        {% elif post.event_type == 'owner_left' %}
          {% trans "Owner has left thread. This thread is now closed." %}
        {% elif post.event_type == 'participant_left' %}
          {% trans "Participant has left thread." %}
        {% elif post.event_type == 'changed_owner' %}
          {% capture trimmed as user %}
            <a href="{{ post.event_context.user.url }}" class="item-title">{{ post.event_context.user.username }}</a>
          {% endcapture %}
          {% blocktrans trimmed with user=user|safe %}
            Changed thread owner to {{ user }}.
          {% endblocktrans %}
        {% elif post.event_type == 'added_participant' %}
          {% capture trimmed as user %}
            <a href="{{ post.event_context.user.url }}" class="item-title">{{ post.event_context.user.username }}</a>
          {% endcapture %}
          {% blocktrans trimmed with user=user|safe %}
            Added {{ user }} to thread.
          {% endblocktrans %}
        {% elif post.event_type == 'removed_participant' %}
          {% capture trimmed as user %}
            <a href="{{ post.event_context.user.url }}" class="item-title">{{ post.event_context.user.username }}</a>
          {% endcapture %}
          {% blocktrans trimmed with user=user|safe %}
            Removed {{ user }} from thread.
          {% endblocktrans %}
        {% endif %}
      </p>

      {% include "misago/thread/posts/event/info.html" %}

    </div>
  </div>
</li>