Add user following functionality

This commit is contained in:
spikecodes 2021-04-06 10:23:05 -07:00
parent 4a42a25ed3
commit b3e4b7bfae
No known key found for this signature in database
GPG key ID: 004CECFF9B463BCB
6 changed files with 35 additions and 16 deletions

View file

@ -75,6 +75,18 @@
<div>{{ user.karma }}</div>
<div>{{ user.created }}</div>
</div>
<div id="user_subscription">
{% let name = ["u_", user.name.as_str()].join("") %}
{% if prefs.subscriptions.contains(name) %}
<form action="/r/u_{{ user.name }}/unsubscribe" method="POST">
<button class="unsubscribe">Unfollow</button>
</form>
{% else %}
<form action="/r/u_{{ user.name }}/subscribe" method="POST">
<button class="subscribe">Follow</button>
</form>
{% endif %}
</div>
</div>
</aside>
</main>