django-comments-xtd icon indicating copy to clipboard operation
django-comments-xtd copied to clipboard

Setting for disabling Gravatar?

Open sabyasachi opened this issue 4 years ago • 3 comments

Thanks for the great project! 🙂

I'm trying to find a way to disable the Gravatar image. Is there a way to do it? I could not find any setting option. It will be nice to have.

sabyasachi avatar Jul 10 '21 13:07 sabyasachi

Hi @sabyasachi, there is a setting called COMMENTS_XTD_API_GET_USER_AVATAR that allows you to customize how to obtain the avatar. But there is no setting to disable the avatar. In v3 the app works as you want it by default, no avatar. But v3 is still under development. Slow development...

If you want to disable the avatar in v2, in the JavaScript plugin, go to line 412 of the file comment.jsx, in static/django_comments_xtd/js/src and follow the instructions here to rebuild the plugin. Let me know if you find any problem.

danirus avatar Jul 13 '21 06:07 danirus

Thank you @danirus for your reply!

I tried removing line 412 from static/django_comments_xtd/js/src/comment.jsx. It removes the Gravatar, but it also loses the indentation of inner comments.

After removing line#412:

after-removing-gravatar

Before removing line#412:

before-removing-gravatar

sabyasachi avatar Jul 19 '21 09:07 sabyasachi

Here is what I did:

To fix the indentation, add one ml-5 class in this line. But, this class should be added only for replies (should not be added for the first level comments.).

<div class="media {% if nested_reply %}ml-5{% endif %}">

Then I made the following change in the recursion call.

{% with nested_reply=True %}
    {% render_xtdcomment_tree with comments=item.children %}
{% endwith %}

sabyasachi avatar Aug 07 '21 04:08 sabyasachi