django-activity-stream icon indicating copy to clipboard operation
django-activity-stream copied to clipboard

Javascript Follow/Unfollow, No Redirection

Open bobozar opened this issue 6 years ago • 1 comments

Can I get a proper documentation on how to use ajax or javascript to follow and unfollow objects then return - 'unfollow' if I follow and 'Follow' if I unfollow. Just like the way Twitter 'follow and unfollow' works. I don't want any redirection. Kindly help with what I'm missing.

In the template, I just have this.

<a href="{% follow_url other_user %}">
    {% if request.user|is_following:other_user %}
        stop following
    {% else %}
        follow
    {% endif %}
</a>

bobozar avatar Mar 20 '18 17:03 bobozar

Use the Follow/Unfollow API from actstream and send ajax requests to it. What is unclear?

asdfkaba avatar Mar 21 '18 23:03 asdfkaba