Commit Graph

39 Commits

Author SHA1 Message Date
evazion
8ef05ec69b Fix #5021: Downvoting/upvoting a revealed hidden comment will hide it again.
Fix it so that upvoting or downvoting a revealed thresholded comment
doesn't hide it again.

The fix is to explicitly store a `data-show-thresholded` flag on the
comment, instead of manually hiding elements with jQuery, and to morph
the comment HTML instead of replacing it so that the state isn't lost
after voting. Alpine.js is used for this, which isn't strictly necessary,
but is useful to test the library before adopting it on a wider scale.

https://alpinejs.dev/start-here
2022-02-28 20:11:22 -06:00
evazion
422dbbc72e Fix #4942: Missing Blacklist Controls. 2022-01-11 10:16:23 -06:00
evazion
a45e6b5cfe Fix #4931: Add popup voter list for comments.
Show the comment's upvote and downvote count when you hover over a
comment's score. For mods, show the list of voters as well.
2021-11-24 22:18:48 -06:00
evazion
ca8bfb9149 Update Ruby gems and Yarn packages. 2021-05-15 02:48:13 -05:00
evazion
b3c1c753b3 comments: allow admins to remove comment votes (fix #4640)
Allow admins to remove comment votes by other users. This is done by
clicking the comment score to get to the comment vote list, then
clicking the Remove button on every vote.
2021-03-30 00:10:25 -05:00
evazion
2eecf4d695 comments: let mods click score to see votes. 2021-01-22 04:26:55 -06:00
evazion
9efb374ae5 comments: allow swapping votes.
Allow users to upvote a comment, then downvote it, without raising an
error or having to manually remove the upvote first. The upvote is
automatically removed and replaced by the downvote.

Changes to the /comment_votes API:

* `POST /comment_votes` and `DELETE /comment_votes` now return a comment
  vote instead of a comment.
* The `score` param in `POST /comment_votes` is now 1 or -1, not
  `up` or `down.`
2021-01-21 07:58:50 -06:00
evazion
5780ed5768 comments: add scores, rework comment menu.
* Add comment scores.
* Rework voting buttons so that you can click the upvote/downvote
  buttons to toggle votes.
* Hide the edit, delete, undelete, and report buttons behind a popup menu.
* Show the upvote/downvote/reply buttons to logged out users. Redirect
  them to the login page instead.
2021-01-20 04:41:21 -06:00
evazion
1b30b71a07 posts: refactor post previews to use ViewComponent.
Refactor the post preview html to use the ViewComponent framework. This
lets us encapsulate all the HTML, CSS, and helper methods for a UI
component in a single place.

See https://viewcomponent.org.
2021-01-14 21:17:57 -06:00
evazion
20f8a26709 tests: fix rails 2.7 keyword parameter deprecation warnings. 2020-05-25 01:48:46 -05:00
evazion
3e792019e5 comments: link votes page in subnav for mods. 2020-04-03 15:43:01 -05:00
evazion
8024d9f0ba /comment_votes: fixup creator_name reference. 2020-02-16 03:28:45 -06:00
BrokenEagle
3ab2c4c3ea Use optional parameter to set column class
- Fixes the extremely long class name on the post versions view
- Can now use one value instead of having to set th and td
- Added missing column classes on all tables
2020-01-13 21:21:13 +00:00
evazion
5c913d8ad1 table builder: fix various incorrect css classes.
Change calling convention to explicitly indicate whether the attributes
are for the <th> element or the <td> element. Fixes various cases where
the two were mixed up.

* Fix .col-expand classes not being set correctly on the /post_versions,
  /pool_versions, and /notes pages.

* Fix .updater and .updated-at classes not being set correctly on the
  /forum_topics page.

* Fix the name param being ignored (noticeable in the post count field
  on the /tags page).

* Don't pass empty string when column has no name.
2020-01-07 02:40:59 -06:00
BrokenEagle
043944e1dd Convert index tables to using table builder 2020-01-04 22:02:43 +00:00
evazion
fd4a9d4d30 post/comment/forum votes: add vote counts to profile pages.
* Add post/comment/forum vote counts to user profiles.
* Show uploaders on post votes index and allow searching by uploader.
* Show forum posters on forum votes index and allow searching by poster.
* Add unvote link to forum votes index.
* Only show unvote links to current user.
2019-10-28 14:46:16 -05:00
evazion
d3165f78aa comment votes: add index page. 2019-10-28 14:12:40 -05:00
evazion
2cf929ad6e comments: show "undo vote" link by default on voted comments (fix #4143). 2019-08-20 21:17:02 -05:00
evazion
782d9f3d61 comment votes: fix error handling.
Return the comment itself and a standard error response on failure.
2019-08-19 17:22:36 -05:00
evazion
8d07ad7390 js: clean up notice/error messaging. 2019-08-14 01:46:44 -05:00
Albert Yi
6fa0ae2cf1 Migrate assets to use Webpacker 2018-07-27 15:24:05 -07:00
r888888888
651dad473d fixes #2884: Comment unvoting is broken 2017-02-14 10:35:27 -08:00
r888888888
1207faa600 fix tests 2017-01-24 16:05:06 -08:00
Albert Yi
bdac591266 fixes #2838 2017-01-16 12:57:43 -08:00
Albert Yi
5445b341bc fixes #2822: Post vote API: returns 200 for both success and failure; fixes bug with x-api-limit header 2017-01-09 17:31:14 -08:00
r888888888
ebff27c7c0 fixes #2700: Unvote Missing Template Exception 2016-10-04 14:42:48 -07:00
Toks
02c8df5beb fixes #1793 2013-07-08 21:58:32 -04:00
Toks
938e19f384 merge branch changeable-votes 2013-06-29 15:12:38 -04:00
Toks
badc3122f0 fixes #1263 for comments 2013-06-29 14:50:22 -04:00
r888888888
f6510703e0 fixes #1792 2013-06-21 17:29:48 -07:00
albert
b9b92b6264 fixes #477 2013-03-02 19:21:39 -05:00
albert
d09e80d2f4 style/js fixes 2011-11-03 16:30:06 -04:00
albert
22074eed1f fixes #69: Comment voting non functional 2011-09-14 17:46:42 -04:00
albert
b4ae7648d4 added comment vote views 2011-04-01 19:01:39 -04:00
albert
cbd877d020 fixed comment vote functional test 2011-04-01 19:01:17 -04:00
albert
9c0a961ab2 major refactoring of javascripts 2011-03-10 17:59:42 -05:00
albert
2b2be3263b upgraded to jquery 1.5.1, fixed comment voting ajax 2011-03-08 18:23:16 -05:00
albert
976a25a6c6 additional functional tests, some controller fixes 2010-12-01 18:50:04 -05:00
albert
f9cdcef2c0 * Implemented comment votes
* Refactored voting code a bit
2010-10-27 19:51:01 -04:00