{#  -*- coding: utf-8 -*- #}

{% macro comment_form(url, title, identifier) %}
    {% if comment_system_id %}
        <div id="discourse-comments"></div>
        <script type="text/javascript">
            DiscourseEmbed = { discourseUrl: '{{ comment_system_id }}',
            discourseEmbedUrl: '{{ url }}' };

            (function() {
                var d = document.createElement('script'); d.type = 'text/javascript'; d.async = true;
                d.src = DiscourseEmbed.discourseUrl + 'javascripts/embed.js';
                (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(d);
            })();
        </script>
    {% endif %}
{% endmacro %}

{% macro comment_link(link, identifier) %}
    {% if comment_system_id %}
    <a href="{{ link }}#discourse-comments">{{ messages("Comments") }}</a>
    {% endif %}
{% endmacro %}


{% macro comment_link_script() %}
{% endmacro %}
