{#
Copyright (C) 2015-2017 Michael Giesler, Stephan Kreutzer

This file is part of Dembelo.

Dembelo is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Dembelo is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License 3 for more details.

You should have received a copy of the GNU Affero General Public License 3
along with Dembelo. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends 'DembeloMain::base.html.twig' %}
{#% set showBackButton=true %#}
{% block textnavclass %}{% endblock %}
{% block textnavlink %}{{ path('reload') }}{% endblock %}

{% block bodyid %}content-page{% endblock %}

{% block body %}
    <div class="read">
        {{ textnode.textHyphenated | raw }}
    </div>

    {% if hitches|length > 0 %}
        <ul class="hitches">
            {% for hitch in hitches %}
                <li class="hitch">
                    {% if hitch.isFinanceNode %}
                        <a href="{{ path('financenode', {textnodeArbitraryId: hitch.arbitraryId}) }}" class="hitch-link-collect">{{ hitch.description }}</a>
                    {% elseif has_feature("paywall") %}
                        <a href="#" class="hitch-link" data-url="{{ path('paywall', {textnodeId: textnode.id, hitchIndex: hitch.index}) }}">{{ hitch.description }}</a>
                    {% else %}
                        <a href="{{ path('text', {textnodeArbitraryId: hitch.arbitraryId}) }}" class="hitch-link">{{ hitch.description }}</a>
                    {% endif %}
                </li>
            {% endfor %}
        </ul>
    {% endif %}

    <div id="social-sharing-bar">
        <a id="facebook-sharebutton" class="window-opener" data-href="https://www.facebook.com/sharer/sharer.php?kid_directed_site=0&sdk=joey&u={{ url('text', {textnodeArbitraryId: textnode.arbitraryId}) }}&display=popup&ref=plugin&src=share_button" target="_blank">
            <img src="{{ asset('build/images/share-facebook.png') }}" alt="diesen Textknoten auf Facebook teilen"/>
        </a>
    </div>

    {{ include('DembeloMain::default/read.metadata.html.twig') }}

    {% if has_feature("paywall") %}
        {{ include('DembeloMain::default/paywall.html.twig', {'dialogId': 'modalPaywall'}) }}
    {% endif %}

{% endblock %}
