{# Generic renderer for activity streams #}
{%- macro m_activities(entries, ignore_communities=False) %}
  <ul class="activities">
    {%- for entry in entries %}
      {%- set actor_href = url_for("social.user", user_id=entry.actor.id) %}
      {%- set actor_img = user_photo_url(entry.actor, size=45) %}

      <li>
        <a href="{{ actor_href }}"><img class="avatar" alt="" src="{{ actor_img }}"></a>

        <div class="entry">
          <span class="arrow"></span>
          <a href="{{ actor_href }}" class="name">{{ entry.actor }}</a>,
          <span class="datetime">{{ entry.happened_at|datetimeformat }}</span>
          <span class="message">{{ entry.message(ignore_communities)|safe }}</span>

          {%- set body = entry.body %}
          {%- if body %}
            {{ body }}
          {%- endif %}
        </div>
      </li>
    {%- endfor %}
  </ul>
{% endmacro %}
