![]() |
Summary | Discourse Topic Voting gives the ability to vote on topics in a specified category.[1] |
![]() |
Repository Link | https://github.com/discourse/discourse-topic-voting |
![]() |
Install Guide | How to install plugins in Discourse |
Features
To enable it, edit any category, look on the settings tab for the “Allow users to vote on topics in this category” checkbox:
Once enabled, a “Votes” item is available in the top menu. The topics in that category can be voted on with the count of votes added next to the topic title.
The vote count is also included next to the title when scrolled.
To make it easier to see vote counts from a topic list, the vote count is also added under the topic titles.
Here are the views you’ll see given different states of the user and topic:
There is also a section in the user’s profile page that displays their active votes:
Configuration
A few points about the backend:
- The number of active votes is configurable and defaults to 10.
- If the topic is closed or archived, the votes are released to the users and can be applied to other topics but the vote count on the topic remains.
- If a topic is re-opened or unarchived, the votes are reclaimed and applied back to the users active vote count.
- If a topic reclaims the votes of a user and they go over their limit, they simply need to wait until topics are closed or archived to allow them to vote again.
CHANGELOG
TODO
- Create a section for the user to see their active and archived votes.
- Allow moderators/staff/admins to see who has voted on a topic.
NOTES
In the categories where the Voting plugin is activated, Likes are automatically deactivated. Some sites may want to use both functions at the same time to like replies, see how to re-enable Likes.
EXTRAS
Data Explorer Queries
List people who voted for a topic along with their email addresses:
--[params]
-- int :topic_id
SELECT
dvv.user_id,
email
FROM discourse_voting_votes dvv
JOIN user_emails ue ON ue.user_id = dvv.user_id
WHERE topic_id = :topic_id
AND ue.primary = true
-
and is the result of this spec put together by @erlend_sh ↩︎