realsuayip / django-sozluk

an exhaustive ekşi sözlük clone, powered by Python
https://sozluk.me
BSD 3-Clause "New" or "Revised" License
320 stars 79 forks source link

Show & Update Entry Votes Dynamically #67

Closed jsdev11 closed 2 years ago

jsdev11 commented 2 years ago

I have two questions.

  1. Is it possible to show total entry votes value? Is there something like {{entry.total_vote}}? For now, I use entry.vote_rate but I don't think this is the correct way to show the total votes for an entry. Let's say upvote and downvote rates are 1 and if there is 5 upvotes and 2 downvotes for an entry, I would like to show 3 for the entry.

  2. If the answer is yes for the first question, then how can I update this value dynamically without browser refreshing. e.g. when user clicks the upvote or downvote, the entry's total vote value will be updated in the html without any browser refresh.

realsuayip commented 2 years ago

This functionality is only available for "replied" entries. You'll have to do some programming to get it to regular entries though.

image