{% extends "layout-8x4.html" %}

{% load pgcomment_tags i18n djinn_contenttypes djinn_contenttypes_tags %}
{% load djinn_auth_tags auth_tags djinn_workflow_tags %}
{% load djinn_likes %}

{% block body_class %}ct {{ object.ct_name }} view {% pub_classes object %}
{% endblock %}

{% block left-pane %}

<article>

  {% block header %}
  <header>
    <h1>{% block title %}{% title object %}{% endblock %}
      {% if_has_perm object request.user 'change' %}
      {% include "djinn_contenttypes/snippets/publabels.html" %}
      {% endif_has_perm %}
    </h1>
  </header>

  {% block metainfo %}
  <div class="meta-info">
  {% with highlight_from=object.highlight_from %}
    <span class="profile-type">{{ object.ct_label }}</span>

    {% if_has_perm object request.user 'change' %}
    {% include "djinn_contenttypes/snippets/publine.html" %}
    {% endif_has_perm %}

    <span class="byline">
      {% trans "Created" context "content meta info" %}: {{ view.created }},
      
      {% if not highlight_from or highlight_from > highlight_from.now %}
        {% trans "Last change" %}: {{ object.changed }},
      {% endif %}
        
      {% if object|implements:"djinn_contenttypes.Commentable" %}
        {% trans "Reactions" %}: {% comment_count_for user object %}
      {% endif %}
    </span>

  {% endwith %}
  </div>

  {% likes object %}

  {% endblock metainfo %}
  {% endblock header %}

  {% block content %}
  {% endblock content %}

  {% if object|implements:"djinn_contenttypes.Commentable" %}
  {% comments_for object %}
  {% endif %}
</article>
{% endblock left-pane %}


{% block right-pane %}
<div class="action-bar">
  {% like_button object %}
  {% block extra_actions %}{% endblock extra_actions %}
  {% if_has_perm object request.user 'change' %}
  {% edit_action object %}
  {% endif_has_perm %}
</div>

<section id="ownership">
  {% owner object 'False' %}
</section>

{% if object.parentusergroup %}

<section id="content-for-group">

  <h3>Geplaatst in de groep</h3>

  {% with group=object.parentusergroup.profile %}
  <div class="groupprofilesummary">

    <figure>
      <a class="groupprofile" href="{{ group.get_absolute_url }}">
        <img src="{{ group.avatar_url }}"/>
      </a>
    </figure>

    <div class="text">
      <a class="groupprofile"
         href="{{ group.get_absolute_url }}">{{ group }}</a>
    </div>

  </div>
  {% endwith %}

</section>

{% endif %}

{% block right-pane-extra %}
{% endblock %}

{% endblock right-pane %}
