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

edit avatar #207

Closed ogurec-ogurec closed 4 years ago

ogurec-ogurec commented 4 years ago

I am trying to put my avatar next to a comment. For example, I want to remove the "gravatar". Editing template _templates/django-comments-xtd/commenttree.html I remove the line:

<div class = "mr-3"> {{item.comment.user_email | xtd_comment_gravatar}} </div>

And I insert:

<img src = "{{user.profile.image.url}}" width = "100" height = "100">

But nothing happens (the avatar is still a gravatar). Also I try to edit html through templates other changes in code - nothing comes out. Changes are only received if I make changes to js (plugin-2.7.1).

How to edit html templates correctly?

danirus commented 4 years ago

Django templates are not used to render comments when using the ReactJS plugin. But you don't have to change the code of the plugin, there's a solution for what you are trying to do. I recently updated the docs with a use case covering this situation: Change user image or avatar. Your particular case is documented in the section "When using the web API".

ogurec-ogurec commented 4 years ago

Thanks