Add comment system with models, forms, and UI integration for lessons

This commit is contained in:
mrtoine 2025-12-10 22:22:17 +01:00
parent c22622ebc1
commit 95111240bc
26 changed files with 1001 additions and 77 deletions

View file

@ -2,39 +2,8 @@
{% block content %}
<section>
<h1>{{ course.name }}</h1>
<p class="def-author"><img src="/{{ course.author.profile.avatar }}" alt="Profile Picture" class="profile-picture-mini">Un cours proposé par&nbsp;<a href="{% url 'another_profile' course.author.id %}">{{ course.author }}</a></p>
<p>{{ course.content }}</p>
<aside class="courseNav">
<ol>
{% for lesson in lessons %}
<li><a href="#{{ lesson.name|slugify }}">{{ lesson.name }}</a></li>
{% endfor %}
<li><a href="#comments">Commentaires</a></li>
</ol>
</aside>
{% for lesson in lessons %}
<h2 id="{{ lesson.name|slugify }}">{{ lesson.name }}</h2>
{{ lesson.content|safe }}
{% endfor %}
<h1 id="comments">Commentaires</h1>
<div id="disqus_thread"></div>
<script>
/**
* RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
* LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables */
/**/
var disqus_config = function () {
this.page.url = "{{ request.build_absolute_uri|safe }}"; // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = "{{ course.id }}"; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = 'https://partirdezero.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>
{% include 'courses/partials/_course_header.html' %}
{% include 'courses/partials/_course_toc.html' %}
<p>Sélectionnez une leçon dans le sommaire pour commencer.</p>
</section>
{% endblock %}