Commit Graph

38 Commits

Author SHA1 Message Date
Earlopain
fc7d84affd
[RuboCop] Enable Style/FrozenStringLiteralComment
This reduces allocations on the posts page by about 5%, from basic testing
2024-02-25 18:15:55 +01:00
Earlopain
c2d224cba9
[Votes] Unify index view code 2022-10-08 23:59:33 +02:00
Earlopain
696ae62ef6
[Votes] Deduplicate Comment/Post vote code 2022-10-08 12:04:17 +02:00
Earlopain
2f5b55a0bc
[Comments] Hide a few buttons on sticky 2022-05-16 14:42:44 +02:00
Earlopain
dd194122a0
[Comments] Refactor showing the reply button 2022-05-16 13:34:25 +02:00
Jason Gronn
23253d6766
[Comments] Disable downvoting own comment (#397)
* Disable downvoting own comment; hide vote buttons for own comment

* Revert hiding buttons; merge upvote/downvote paths; fix tests that relied on previous behaviour

* Undo some changes I did not mean to make

* Fix a mistake I made

* Fix some other unit tests
2022-04-30 12:48:53 +02:00
Earlopain
2d45fda8fe
[Votes] Improve search
* search by ip and score
* search by comment creator name
* display email and signup date
2022-03-30 15:08:52 +02:00
Earlopain
1f52f7beeb
[Votes] Add option to only show duplicates 2022-03-21 13:35:03 +01:00
Earlopain
9e6327c8ad
[Votes] Limit complex parameters to only post/comment search 2022-03-21 10:46:22 +01:00
Earlopain
2bf48d3236
[Votes] Allow ordering by ip and limiting timeframe 2021-11-17 18:09:45 +01:00
Kira
28606dc2e6 [Comments] Fix vote viewer sorting order 2020-06-12 22:25:51 -07:00
Kira
e074080ade Potentially fix vote cheating 2019-09-19 14:41:55 -07:00
Kira
d52d184873 Fix bad user reference in comment votes
Site can't decide if the person who created something is the
'creator' or 'user'. This has been the source of many bugs, this
is just another of them.
2019-09-14 17:55:54 -07:00
Kira
b64d223b46 Update validations to use new syntax 2019-09-05 05:59:51 -07:00
Kira
e94bb0f30e User limit 2019-09-03 21:56:41 -07:00
Kira
84ba528cff Fix comment vote search filtering 2019-07-22 11:52:42 -07:00
Kira
9dceee4648 Move comment vote loading to controllers
This avoids using a very hacking preloading scheme that involved
a singleton value that could change at runtime and chaining model
associations together.
2019-04-10 17:21:27 -07:00
Kira
44ab7b1a8c Comment votes and vote fixups and interface 2019-04-09 13:04:40 -07:00
Kira
0503d7bb8c Most of comment voting fixes and vote viewer
TODO: locking and admin deletion
2019-04-07 21:46:08 -07:00
r888888888
abce4d2551 Raise error on unpermitted params.
Fail loudly if we forget to whitelist a param instead of silently
ignoring it.

misc models: convert to strong params.

artist commentaries: convert to strong params.

* Disallow changing or setting post_id to a nonexistent post.

artists: convert to strong params.

* Disallow setting `is_banned` in create/update actions. Changing it
  this way instead of with the ban/unban actions would leave the artist in
  a partially banned state.

bans: convert to strong params.

* Disallow changing the user_id after the ban has been created.

comments: convert to strong params.

favorite groups: convert to strong params.

news updates: convert to strong params.

post appeals: convert to strong params.

post flags: convert to strong params.

* Disallow users from setting the `is_deleted` / `is_resolved` flags.

ip bans: convert to strong params.

user feedbacks: convert to strong params.

* Disallow users from setting `disable_dmail_notification` when creating feedbacks.
* Disallow changing the user_id after the feedback has been created.

notes: convert to strong params.

wiki pages: convert to strong params.

* Also fix non-Builders being able to delete wiki pages.

saved searches: convert to strong params.

pools: convert to strong params.

* Disallow setting `post_count` or `is_deleted` in create/update actions.

janitor trials: convert to strong params.

post disapprovals: convert to strong params.

* Factor out quick-mod bar to shared partial.
* Fix quick-mod bar to use `Post#is_approvable?` to determine visibility
  of Approve button.

dmail filters: convert to strong params.

password resets: convert to strong params.

user name change requests: convert to strong params.

posts: convert to strong params.

users: convert to strong params.

* Disallow setting password_hash, last_logged_in_at, last_forum_read_at,
  has_mail, and dmail_filter_attributes[user_id].

* Remove initialize_default_image_size (dead code).

uploads: convert to strong params.

* Remove `initialize_status` because status already defaults to pending
  in the database.

tag aliases/implications: convert to strong params.

tags: convert to strong params.

forum posts: convert to strong params.

* Disallow changing the topic_id after creating the post.
* Disallow setting is_deleted (destroy/undelete actions should be used instead).
* Remove is_sticky / is_locked (nonexistent attributes).

forum topics: convert to strong params.

* merges https://github.com/evazion/danbooru/tree/wip-rails-5.1
* lock pg gem to 0.21 (1.0.0 is incompatible with rails 5.1.4)
* switch to factorybot and change all references

Co-authored-by: r888888888 <r888888888@gmail.com>
Co-authored-by: evazion <noizave@gmail.com>

add diffs
2018-04-06 18:09:57 -07:00
evazion
c1834ab8dd Inherit models from ApplicationRecord instead of ActiveRecord::Base. 2017-06-16 13:28:31 -05:00
evazion
82e93b3c12 Allow downvoting admin comments. 2016-12-26 23:52:45 -06:00
evazion
1047d7c96b Prevent users from upvoting their own comments. 2016-11-06 01:32:54 -06:00
r888888888
2a87aad34e implement super voters 2016-02-22 14:11:25 -08:00
r888888888
fad0ab7c93 fixes #2133 2014-04-16 17:43:34 -07:00
r888888888
3ea606d116 fixes #1975 2014-03-19 15:25:40 -07:00
Toks
9a337346df fixes #1230 2013-04-07 07:11:27 -04:00
小太
cba839ba76 Kill trailing whitespace in ruby files 2013-03-19 23:10:10 +11:00
albert
733c64ff2a fixes #744 2013-03-08 17:14:40 -05:00
albert
72b7651169 improved search methods 2013-01-11 17:13:55 -05:00
albert
c7ffda81bf improved artist test 2013-01-11 16:38:06 -05:00
albert
22074eed1f fixes #69: Comment voting non functional 2011-09-14 17:46:42 -04:00
albert
cbd877d020 fixed comment vote functional test 2011-04-01 19:01:17 -04:00
albert
fc0a076aca * Missing files
* Work on post exploration code by traversing dates
2010-10-27 20:16:43 -04:00
albert
ad39553aac updated tests, switched to rails 3.0.0rc2 2010-08-26 14:36:02 -04:00
albert
23656e3fa9 * Continued work on improving post view templates
* Added statistics-based estimator for related tag calculator
* Fleshed out IpBan class based on changes to Danbooru 1.xx
2010-04-29 17:32:15 -04:00
albert
9f353c32f4 added post voting 2010-02-15 17:45:09 -05:00
albert
e9c2d1e636 added artists, comments 2010-02-15 13:59:58 -05:00