{#
/**
 * @file
 * Dark+'s theme implementation to display a Article node.
 */
#}

{% extends "node.html.twig" %}
{% block node_side %}
  {% if mt_setting.reading_time or mt_setting.share_links or mt_setting.font_resize or mt_setting.print_button or display_submitted or author_picture %}
    <div class="node__side">
        {% if author_picture %}
          <div class="user-picture">
            <div{{ author_attributes.removeClass('node__meta-user node__meta-item') }}>
              {{ author_picture }}
            </div>
          </div>
        {% endif %}
        {% if display_submitted %}
          <div{{ author_attributes.addClass('node-author') }}>
            {{ author_name }}
          </div>
          <div class="node-date">
            {{ node.createdtime|format_date('custom', 'M d, Y') }}
          </div>
          {{ metadata }}
        {% endif %}
        {% if mt_setting.reading_time %}
          {{ attach_library('darkplus/reading-time') }}
          <div class="reading-time">
            {% if minutes < 1 %}
              {% trans %}
                1<div class="reading-time__text">min read</div>
              {% endtrans %}
            {% else %}
              {% trans %}
                {{ minutes }}<div class="reading-time__text">min read</div>
              {% endtrans %}
            {% endif %}
          </div>
        {% endif %}
        {% if mt_setting.sticky_side %}
          {{ attach_library('darkplus/mt-sticky-element') }}
          <div class="mt-sticky-element">
        {% endif %}
        {% if mt_setting.font_resize %}
          {{ attach_library('darkplus/font-resize') }}
          <div class="content-font-settings">
              <div class="font-resize">
                <a href="#" id="decfont">A-</a>
                <a href="#" id="incfont">A+</a>
              </div>
          </div>
        {% endif %}
        {% if mt_setting.share_links_print_position == "node-side" and (mt_setting.share_links or mt_setting.print_button) %}
          {{ attach_library('darkplus/share-links') }}
          <div class="share-links">
            <ul>
              {% if mt_setting.share_links %}
                <li class="facebook{{ (mt_setting.print_button) ? ' print-button-enabled' : '' }}">
                  <a href="https://www.facebook.com/sharer/sharer.php?u={{ url('entity.node.canonical', {'node': node.id}) }}&t={{node.label | url_encode(true)}}" onclick="window.open(this.href, 'facebook-share','width=580,height=296');return false;">
                      <i class="fab fa-facebook"><span class="sr-only">facebook</span></i>
                  </a>
                </li>
                <li class="twitter{{ (mt_setting.print_button) ? ' print-button-enabled' : '' }}">
                  <a href="http://twitter.com/share?text={{node.label | url_encode(true)}}&url={{ url('entity.node.canonical', {'node': node.id}) }}" onclick="window.open(this.href, 'twitter-share', 'width=550,height=235');return false;">
                      <i class="fab fa-twitter"><span class="sr-only">twitter</span></i>
                  </a>
                </li>
                <li class="email{{ (mt_setting.print_button) ? ' print-button-enabled' : '' }}">
                  <a href="mailto:?Subject={{node.label | url_encode(true)}}&amp;Body={{ url('entity.node.canonical', {'node': node.id}) }}">
                      <i class="far fa-envelope"><span class="sr-only">envelope</span></i>
                  </a>
                </li>
              {% endif %}
              {% if mt_setting.print_button %}
                <li class="print{{ (mt_setting.share_links) ? ' share-links-enabled' : '' }}">
                  <div class="print">
                    <a href="javascript:window.print()" class="print-button">
                      <i class="fas fa-print"><span class="sr-only">print</span></i>
                    </a>
                  </div>
                </li>
              {% endif %}
            </ul>
          </div>
        {% endif %}
        {% if mt_setting.sticky_side %}
          </div>
        {% endif %}
        {% if mt_setting.share_links_print_position == "bottom" and (mt_setting.share_links or mt_setting.print_button) %}
          {{ attach_library('darkplus/share-links') }}
          {{ attach_library('darkplus/fixed-share-links') }}
          <div class="share-links">
            <ul>
              {% if mt_setting.share_links %}
                <li class="facebook{{ (mt_setting.print_button) ? ' print-button-enabled' : '' }}">
                  <a href="https://www.facebook.com/sharer/sharer.php?u={{ url('entity.node.canonical', {'node': node.id}) }}&t={{node.label | url_encode(true)}}" onclick="window.open(this.href, 'facebook-share','width=580,height=296');return false;">
                      <i class="fab fa-facebook"><span class="sr-only">facebook</span></i>
                  </a>
                </li>
                <li class="twitter{{ (mt_setting.print_button) ? ' print-button-enabled' : '' }}">
                  <a href="http://twitter.com/share?text={{node.label | url_encode(true)}}&url={{ url('entity.node.canonical', {'node': node.id}) }}" onclick="window.open(this.href, 'twitter-share', 'width=550,height=235');return false;">
                      <i class="fab fa-twitter"><span class="sr-only">twitter</span></i>
                  </a>
                </li>
                <li class="email{{ (mt_setting.print_button) ? ' print-button-enabled' : '' }}">
                  <a href="mailto:?Subject={{node.label | url_encode(true)}}&amp;Body={{ url('entity.node.canonical', {'node': node.id}) }}">
                      <i class="far fa-envelope"><span class="sr-only">envelope</span></i>
                  </a>
                </li>
              {% endif %}
              {% if mt_setting.print_button %}
                <li class="print{{ (mt_setting.share_links) ? ' share-links-enabled' : '' }}">
                  <div class="print">
                    <a href="javascript:window.print()" class="print-button">
                      <i class="fas fa-print"><span class="sr-only">print</span></i>
                    </a>
                  </div>
                </li>
              {% endif %}
            </ul>
          </div>
        {% endif %}
    </div>
  {% endif %}
{% endblock %}
{% block meta_area %}
  {{ title_prefix }}
  {% if not page %}
    <h2{{ title_attributes.addClass('node__title') }}>
      <a href="{{ url }}" rel="bookmark">{{ label }}</a>
    </h2>
  {% endif %}
  {{ title_suffix }}
{% endblock %}
{% block content %}
  {{ attach_library('darkplus/node-article') }}
  <div class="node__main-content-section">
    {{ content|without('comment', 'links', 'field_mt_banner_image') }}
  </div>
  {{ content.links }}
  {{ content.comment }}
{% endblock %}
