{% if isWicmsCommentsEnabled() %}
    <div style="margin: 50px 15px; width:500px;" class="comment-box">
        <h2 class="comments">Komentarze</h2>

        {% include '@templates/default/view/News/Components/comment_list.html.twig' %}
        <div id="reply-box"></div>

        {% if comment.enableGuest|i|b %}{# Zezwolenie komentowania przez gości #}
            {% include '@templates/default/view/News/Components/comment_form.html.twig' %}
        {% else %} {# Tylko zalogowani użytkownicy #}
            {% if is_granted('ROLE_USER') %}
                {% include '@templates/default/view/News/Components/comment_form.html.twig' %}
            {% else %}
                <div class="deny-comment-from-guest">Aby skomentować, <a href="{{ path('wi_front_user_login', { 'relocate': url('wi_front_news_show', { 'id': news.id, 'slug': slugify(news.title), '_fragment': 'comment_form' }) }) }}" title="Zaloguj się">zaloguj się</a> lub <a href="{{ path('wi_front_user_register') }}">zarejestuj</a></div>
            {% endif %}
        {% endif %}
    </div>
{% endif %}
{% if isDisqusCommentsEnabled() %}
    <div class="comment-box-disqus">
        <div id="disqus_thread"></div>
        <script>
            var disqus_config = function () {
                this.page.url = '{{ getCanonical(news) }}';
                this.page.identifier = {{ news.id }};
            };

            (function() { // DON'T EDIT BELOW THIS LINE
                var d = document, s = d.createElement('script');
                s.src = 'https://{{ comment.disqusShortname|s }}.disqus.com/embed.js';
                s.setAttribute('data-timestamp', +new Date());
                (d.head || d.body).appendChild(s);
            })();
        </script>
        <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
    </div>
{% endif %}
{% if isFacebookCommentsEnabled() %}
    <div id="fb-root"></div>
    <script>(function(d, s, id) {
            var js, fjs = d.getElementsByTagName(s)[0];
            if (d.getElementById(id)) return;
            js = d.createElement(s); js.id = id;
            js.src = 'https://connect.facebook.net/pl_PL/sdk.js#xfbml=1&version=v2.12&appId={{ comment.fbAppId }}&autoLogAppEvents=1';
            fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'facebook-jssdk'));</script>
    <div class="fb-comments" data-href="{{ getCanonical(news) }}" data-numposts="5" data-width="500"></div>
{% endif %}
