Commit Graph

68 Commits

Author SHA1 Message Date
evazion
fdf8e7d5d7 Fix mode menu 'approve' option.
* Fix routing error in respond_with (didn't use /moderator namespace).

* Fix /moderator/posts/approvals.json response to return full
  PostApproval object, not just a success/failure message.

* Simplify the javascript a bit (use $.post instead of $.ajax).
2017-06-04 12:14:35 -05:00
evazion
565945ab7b flags: move flagging inside Post#delete! 2017-05-17 23:48:37 -05:00
evazion
648cc9ecb7 Move post replacement create action to post replacements controller. 2017-05-14 21:31:01 -05:00
evazion
df7cd67a7d post replacement: add POST /moderator/post/posts/replace endpoint. 2017-05-02 20:41:18 -05:00
evazion
70a7f77a48 Post#approve!: signal errors with invalid object instead of exception. 2017-04-03 17:18:32 -05:00
r888888888
bd3dfc73c0 fix queue for bulk reverts 2017-03-21 17:13:51 -07:00
Albert Yi
3780645cb2 Merge pull request #2897 from evazion/fix-rescue_from
Remove redundant rescue_from calls.
2017-02-27 16:48:44 -08:00
evazion
40092f21ba Remove redundant rescue_from calls.
These are redundant because ApplicationController rescues these exceptions already.
2017-02-25 02:18:16 -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
b5bf9b8678 post.rb: remove assorted unused methods. 2017-02-06 19:07:03 -06:00
Albert Yi
0ab45ebc42 add postarchive model, fixes #2831: Replace Subscriptions Link With Search:All Link 2017-01-11 11:39:14 -08:00
Albert Yi
2af622e7a7 add ban to post mode menu 2016-12-09 11:56:25 -08:00
Albert Yi
a22a7c3302 bulk revert 2016-11-07 10:48:04 -08:00
Albert Yi
4e48e80e1f stub in preview for bulk revert 2016-11-02 13:53:01 -07:00
Albert Yi
86af580445 increase random post mod queue length to 12 2016-10-17 15:53:51 -07:00
evazion
bd6ebceda3 Refactor post_approvers_only to approver_only.
Don't duplicate code with post_approvers_only; use the approver_only?
method dynamically defined in `User::Roles.each do ... end`.
2016-10-14 05:04:40 +00:00
r888888888
62582cb994 remove false constraint 2016-09-13 01:14:32 -07:00
r888888888
76c1712989 account for nothing left to moderate 2016-09-12 16:20:08 -07:00
r888888888
5d1bc8726a make moderated cookie permanent 2016-09-12 13:06:09 -07:00
r888888888
2c80d7b82e more intelligent notice for mod queue 2016-09-09 15:08:23 -07:00
r888888888
1682196490 fix role 2016-09-08 16:02:51 -07:00
r888888888
de34c7fca3 fixes #2650: Add random mode to mod queue 2016-09-08 15:55:06 -07:00
r888888888
73d62bbc01 expose mod dashboard to all users 2016-08-30 15:14:46 -07:00
Toks
af22c2b7fa Display expunge errors #2556 2015-12-05 16:18:49 -05:00
r888888888
6480864718 fixes #2469 2015-10-15 15:24:24 -07:00
Toks
643ab7b2c6 ip search: add quick links & improve usability
#2530
2015-10-08 01:14:48 -04:00
Toks
2962cb80f1 #2495 move favorites
"Delete" already includes the ability to move favorites, this is just a
convenience function.
2015-08-20 21:06:27 -04:00
r888888888
767b11d4b5 fixes #2495: Post approvers can't delete/undelete/ban posts 2015-08-17 13:30:16 -07:00
Toks
fc34ea42d8 fixes #2453, Remember customized per page across browser sessions 2015-08-09 10:25:40 -04:00
r888888888
f66d5c3f02 fixes #2461: Mod queue comments 2015-08-05 13:11:32 -07:00
r888888888
dedca83e7f fixes #2453: Customize per page pagination limit for mod queue 2015-08-04 17:43:53 -07:00
r888888888
abb232d4e6 fixes #2448: Approvers can undelete posts they already approved/uploaded 2015-07-24 14:19:40 -07:00
r888888888
66fe24d8c5 fixes #2452: status: metatag doesnt work in mod queue search 2015-07-24 13:51:19 -07:00
r888888888
d361be4ccd fixes #2453: Customize per page pagination limit for mod queue 2015-07-24 13:47:24 -07:00
r888888888
74728ad992 fixes #2445: Paginate mod queue 2015-07-21 15:56:55 -07:00
r888888888
a39e390e24 fixes #2446 2015-07-21 15:26:07 -07:00
Toks
7c90fca006 Allow moving favorites for already deleted post 2015-07-07 11:08:32 -04:00
r888888888
1d9596d7f2 fixes #2417 2015-06-29 18:17:59 -07:00
Toks
095d02414c Exempt deletions from dupe flag checking 2014-10-31 20:01:42 -04:00
r888888888
dae7c615e9 fixes #2206 2014-06-24 11:07:39 -07:00
Toks
60b589ba70 Potential fix for #1985 2014-06-17 16:22:33 -04:00
r888888888
aab03422bc performance tweaks for rails 4.1 2014-04-24 22:24:42 -07:00
Toks
27c80ba621 #1326: Add checkbox to move favorites 2013-12-17 12:14:32 -05:00
Toks
59db60f35c fixes #1815 2013-06-29 11:44:33 -04:00
r888888888
a99f39718d fixes #1337 2013-04-16 20:28:42 -07:00
r888888888
2dfa616f33 fixes #1350, better db:seed script 2013-04-16 20:23:02 -07:00
albert
c540c4f891 Fixes #1121, rename Post#annihilate to Post#expunge 2013-04-08 13:44:43 -04:00
小太
cba839ba76 Kill trailing whitespace in ruby files 2013-03-19 23:10:10 +11:00
albert
2dbd7b180f fixes #652 2013-02-28 13:34:03 -08:00
albert
c7309bac73 catch blank deletion reason exception 2013-02-23 21:05:46 -05:00