Commit Graph

22 Commits

Author SHA1 Message Date
bitWolfy
b30b36b936 [Posts] Fix the "Borderline Relevancy" detailed disapproval option 2023-03-05 15:05:03 -08:00
Earlopain
42b345b864
[Posts] Add link to quickly see who disapproved the post
Also move your own disapproval below the others, which just makes sense.
2022-09-13 20:35:56 +02:00
Earlopain
eb5d001b55
[Posts] Remove the modqueue
Truly the end of an era. This page was trash and nobody was using it.
This will make it easier to make changes to the approval flow people actually use.
2022-09-13 16:14:00 +02:00
Earlopain
87500a4f01
[Forms] Use a custom form builder
This will  make it possible to write some custom logic and use it everywhere,
like generating submit buttons with text depending on the model state
2022-07-13 20:48:14 +02:00
Earlopain
28b041ab7e
[Posts] Make post disapprovals private 2022-04-20 21:27:33 +02:00
Kira
1161cecbf7 Make post disapprovals public 2020-04-05 08:51:10 -07:00
Kira
47de963b38 Change remote: true on approvals, appeals and flags to JS 2020-02-21 21:40:37 -08:00
Kira
cef4d5df1d Fix bad class constant reference in disapproval counts 2019-08-01 13:48:29 -07:00
Kira
152817a354 Mass revision of post approval/disapprovals to improve UI 2019-07-31 22:05:27 -07:00
Zwagoth
4a46874a50 Revert "Remove post disapproval"
This reverts commit c6df9a33e0.
2019-04-11 23:39:44 -04:00
Kira
c6df9a33e0 Remove post disapproval
This simplifies the approval system to be a single user with an
auditing table. The disapproval system was confusing and outright
post deletion replaces it on e6.

Slightly changes the rules of how post approvals work to remove
a few limits that are not reflected on e6.
2019-02-19 20:20:15 -08:00
Albert Yi
33063a72de Add a listing page for post disapprovals (accessible to approvers only) 2019-01-24 16:14:57 -08:00
evazion
10358d4211 Fix #3881: It has been reviewed by X moderators.“ message. 2018-09-10 17:39:49 -05: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
7cb7c2fbab Remove ruby DText implementation (#3206). 2017-07-19 16:48:42 -05:00
evazion
167d86d4ec Fix 'Posts Report "Reviewed by 0 Moderators"' (#2914). 2017-03-03 15:35:01 -06:00
evazion
83915a5d46 modqueue: avoid N+1 queries for disapprovals, uploaders.
Fixes an N+1 queries problem in the /moderator/post/queue view by
prefetching disapprovals and uploaders.

Also the way disapproval messages were previously rendered triggered a bunch
of sql queries for each post:

    SELECT COUNT(*) FROM "post_disapprovals" WHERE "post_disapprovals"."post_id" = $1 [["post_id", 52]]
    SELECT COUNT(*) FROM "post_disapprovals" WHERE "post_disapprovals"."post_id" = $1 AND "post_disapprovals"."reason" = $2  [["post_id", 52], ["reason", "breaks_rules"]]
    SELECT COUNT(*) FROM "post_disapprovals" WHERE "post_disapprovals"."post_id" = $1 AND "post_disapprovals"."reason" = $2  [["post_id", 52], ["reason", "poor_quality"]]
    SELECT COUNT(*) FROM "post_disapprovals" WHERE "post_disapprovals"."post_id" = $1 AND "post_disapprovals"."reason" IN ('disinterest', 'legacy')  [["post_id", 52]]
    SELECT COUNT(*) FROM "post_disapprovals" WHERE "post_disapprovals"."post_id" = $1 AND (message is not null and message <> '')  [["post_id", 52]]
    SELECT "post_disapprovals".* FROM "post_disapprovals" WHERE "post_disapprovals"."post_id" = $1 AND (message is not null and message <> '')  [["post_id", 52]]

This refactors to bring it down to one:

    SELECT "post_disapprovals".* FROM "post_disapprovals" WHERE "post_disapprovals"."post_id" = $1  [["post_id", 52]]
2017-02-24 21:03:14 -06:00
evazion
9b40016895 /posts/NNN, modqueue: allow dtext in disapproval reasons. 2017-02-24 21:03:14 -06:00
r888888888
fea20c84dc fixes #2541 (only for new uploads, flagged posts will still show disapprovals immediately) 2015-10-27 11:49:51 -07:00
r888888888
f66d5c3f02 fixes #2461: Mod queue comments 2015-08-05 13:11:32 -07:00
r888888888
40a9f3658c fixes #2447: Display disapproval counts in status bar to uploader and approvers 2015-07-24 14:24:51 -07:00
r888888888
43377e3a82 fixes #2447: Display disapproval counts in status bar to uploader and approvers 2015-07-23 14:29:18 -07:00