{#
/**
 * @file argument.html.twig
 * Default theme implementation to present Argument data.
 *
 * This template is used when viewing Argument 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_argument()
 *
 * @ingroup themeable
 */
#}
{{ attach_library('argue_proscons/argue-proscons.teaser') }}

{% set date = content.changed|render|striptags|trim %}
{% set arg_type = content.argument_type|render|trim %}
{% set header_icon = (arg_type == 'pro') ? 'argue_pro' : 'argue_con' %}

{%
set classes = [
  'argument',
  'argument-teaser',
  'card',
]
%}
<article{{ attributes.addClass(classes) }}>
  <div class="argument-wrapper card__content-wrapper">
    <header class="card-header">
      <span class="card-header__icon"><i class="argue-icon" aria-hidden="true">{{ header_icon }}</i><mark class="mark-new hidden" data-comment-timestamp="{{ content.new_indicator_timestamp }}"></mark></span>
      <div class="card-header__text">
        <h3 class="card-header__text__top">{{ content.name }}</h3>
      </div>
    </header>

    <div class="card__content-item__extend" data-dense-height="10em">
      <div class="argument__content card__content-item">
        {{ content.argument }}
      </div>

      <div class="argument__details card__content-item">
        <div class="card__metadata">{% trans %}Changed {{ date }}{% endtrans %}</div>
        {{ content.type }}
        {{ content.field_change_requests }}
        {{ content.field_comments }}
      </div>
    </div>

    <button class="card__content-item__extend__toggle button button--extrasmall" role="switch">
      <span class="argue-icon more" aria-hidden="true">unfold_more</span>
      <span class="argue-icon less" aria-hidden="true">unfold_less</span>
      <span class="details--text">{{ 'Details'|t }}</span>
    </button>

    <div class="card-footer argue-card__actions">
      <div class="card-footer__action-buttons">
        {{ content.argue_meta }}
      </div>

      <div class="card-footer__action-icons">
        {% if content.vote_vote_field %}
          {{- content.vote_vote_field -}}
        {% endif %}
        {{ content.operations }}
      </div>
    </div>
  </div>

</article>
