{#
/**
* @file post.html.twig
* Default theme implementation to present Post data.
*
* This template is used when viewing Post pages.
*
*
* Available variables:
* - content: A list of content items. Use 'content' to print all content, or
* - attributes: HTML attributes for the container element.
*
* @see template_preprocess_post()
*
* @ingroup themeable
*/
#}

{{ attach_library('socialbase/comment') }}
{{ attach_library('socialbase/post') }}
{{ attach_library('socialbase/page-node')}}

{%
  set classes = [
  'media',
  not published ? 'post-unpublished',
]
%}

<div class="card">
  <div class="card__block">

    <div class="media-wrapper">
      <div {{ attributes.addClass(classes) }}>
        <div class="media-left avatar">
          {% if author_picture %}
            {{ author_picture }}
          {% endif %}
        </div>
        <div class="media-body">
          <div class="media-heading text-m">
            {% if content.user_id %}
              {{ content.user_id }}
            {% endif %}
            <div class="post-date">
              {{ date }}
              {% if visibility_icon and visibility_label %}
                <svg class="margin-left-s icon-visibility">
                  <title>{% trans %} Visibility {% endtrans %}</title>
                  <use xlink:href="#icon-{{ visibility_icon }}"></use>
                </svg>
                <strong>{{ visibility_label }}</strong>
              {% endif %}
              {% if not published %}
                <span class="badge badge-default badge--pill">
                  {% trans %} unpublished {% endtrans %}
                </span>
              {% endif %}
            </div>
          </div>
        </div>
      </div>
      {% if content.links %}
          {{ content.links }}
      {% endif %}
    </div>
    <div class="margin-top-s iframe-container">

        <div class="body-text">
            {{ content|without('links', 'field_post_comments', 'like_and_dislike', 'field_post_image', 'user_id') }}
        </div>

      {% if content.field_post_image|render %}
        <p>{{ content.field_post_image }}</p>
      {% endif %}

      <div class="clearfix"></div>
      {{ content.like_and_dislike }}
    </div>

    {% if content.field_post_comments %}
        {{ content.field_post_comments }}
    {% endif %}

  </div>
</div>
