## -*- coding: utf-8 -*-

<%def name="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
</%def>

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


<%def name="comment_link_script()">
</%def>
