danirus / django-comments-xtd

A pluggable Django comments application with thread support, follow-up notifications, mail confirmation, like/dislike flags, moderation, a ReactJS plugin and Bootstrap 5.3.
https://django-comments-xtd.readthedocs.io
BSD 2-Clause "Simplified" License
594 stars 158 forks source link

Nested comments not indenting #304

Closed woesoe closed 3 years ago

woesoe commented 3 years ago

I've been trying to get nested comments to work on my Wagtail/Puput blog. The comments are registered in django-admin as nested:

django-admin_nested_comments

But the nested comments don't indent to the right, but just show up straight below the original comment:

nested_comments_not_indenting

The html-file that serves the comments is located at blog_wout\blog_wout\templates\puput\comments\django_comments.html and it looks like this:

{% load comments %}
{% load comments_xtd %}

<div>
    <h3>Comments:</h3>
    {% render_comment_form for entry %}
    {% render_xtdcomment_tree for entry%}
</div>

Any help would be greatly appreciated!

danirus commented 3 years ago

In v2 of django-comments-xtd the indentation depends on loading bootstrap.css. It's not very well documented. Only if you go through the tutorial or install the demo/comp project you could see that:

<link href="{% static 'django_comments_xtd/css/bootstrap.min.css' %}" rel="stylesheet">

The future v3 (I'm working on it but I can't put a release date yet) will not depend on any frontend CSS or JS framework. But for the time being this is the way to go.

woesoe commented 3 years ago

Hi danirus, thank you for your comment.

Adding django_comments_xtd/css/bootstrap.min.css indeed does the trick when it comes to showing the indentation etc. But since Puput already uses a bootstrap css file, webpages on my blog that show the comments section are completely changed when I load the new django-comments-xtd bootstrap file.

I'm still looking for a good way to specifically change the css for only the comments section. I was thinking of making a custom css file that handles all the classes listed in django_comments.html. Would that be the way forward?

woesoe commented 3 years ago

Nvm, I've decided I'm going to try to use the django_comments_xtd/css/bootstrap.min.css, since it's a newer version of bootstrap anyway and I can actually get pretty good results with it if load it before the puput.css file is loaded in base.html.

Thanks again!