Skip to content

QDB Scoring System #78

@billdybas

Description

@billdybas

There are a lot of quotes in the QDB, but how do we know which quotes are the best, funniest, most memorable?

We could introduce an up-vote system where any member (has earned at least 1 membership ever), when logged-in to the website, can up-vote quotes they like. One up-vote per member per quote. They can rescind their upvotes. Perhaps there's even a page where members can see their upvoted quotes.

This would help in determining "fresh" quotes to include in the weekly email digest, since it may get unwieldy if the email is sending out dozens of quotes each week – it could send out say, the top 5 quotes added last week plus 2 from the archive. (#77)

This task requires:

  • Create an "Upvote" model that is associated to a User and a Quote
  • Create routes to vote and un-vote on a particular quote (authenticated routes & pull the currently signed in user)
  • Update existing quotes implementation to include votes
    • Unauthenticated, retrieving quotes should return just the count of upvotes
    • Authenticated, retrieving quotes should return the count of upvotes as well as whether the authenticated user voted on the particular quote

Also, a frontend experience should be designed:

  • Display an upvote icon with a count next to quotes; can't be clicked for un-authed users
  • For authed users, turn it into a button; when clicked, highlights, and indicates vote; when clicked again, un-highlights, and indicates un-vote; when you visit this page authed, the correct highlight status is displayed based on your previous voting choices
  • Filter on the QDB for authed users to filter quotes by upvote status
  • Filters on the QDB for "top" and "new" quotes

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions