Commit Graph

1727 Commits

Author SHA1 Message Date
evazion
70a7f77a48 Post#approve!: signal errors with invalid object instead of exception. 2017-04-03 17:18:32 -05:00
evazion
765fbac11d /reports/upload_tags: show thumbnails instead of post ids. 2017-04-03 15:03:26 -07:00
evazion
fdd8ebb1b8 /users/1234: link to upload tag changes report. 2017-04-03 15:03:26 -07:00
r888888888
dd4a70c195 fixes #2935: Eliminate the og:description meta tag 2017-03-27 16:01:22 -07:00
Albert Yi
7f7f843763 Merge pull request #2933 from evazion/feat-doc-cosplay-autotags
Fix #2931: mention automated implications on *_(cosplay) wikis.
2017-03-23 10:46:20 -07:00
evazion
66b5dc641c /moderator/dashboard: use PostPresenter.preview for appeal thumbnails. 2017-03-23 04:05:06 -05:00
evazion
d1d0fe9bc5 /moderator/dashboard: optimize sql queries
* Converts queries to use active record instead of raw sql. This ensures
  that user objects are loaded by rails in the join, so that we
  don't have to issue `User.find` calls to load users one-by-one.

* Use `.includes` to preload associations used in the view, to avoid
  additional N+1 query problems (primarily, calls to link_to_user
  also causing users to be loaded one-by-one).
2017-03-23 04:05:05 -05:00
evazion
90cd029f6f wiki excerpts: show alias/implication lists even for tags without a wiki. 2017-03-23 03:54:42 -05:00
r888888888
b3e3012a9c link to upload advice thread for deleted posts 2017-03-22 16:33:14 -07:00
r888888888
c4b5998e64 fixes #2692: Rework bookmarklet preview 2017-03-21 15:41:20 -07:00
r888888888
022d9ede7f expose bulk revert interface 2017-03-21 14:40:46 -07:00
r888888888
c6fe1f7f54 remove tag check 2017-03-20 16:24:31 -07:00
r888888888
70d057f8f3 move saved search option to sidebar 2017-03-20 16:19:15 -07:00
r888888888
73895a1a27 make saved searches table sortable 2017-03-20 15:44:33 -07:00
Albert Yi
baa1760b3d Merge pull request #2928 from evazion/feat-flagger-commenter-ips
Make commenter/flagger/appealer IPs visible to mods
2017-03-20 13:46:08 -07:00
Albert Yi
3cfacec4bf Merge pull request #2924 from evazion/feat-hidden-notice
/posts: add notice when posts are hidden.
2017-03-20 12:30:15 -07:00
evazion
85d1f18ba5 comments: make commenter ip addresses visible to mods. 2017-03-19 23:41:25 -05:00
evazion
eda97dc1ff /posts: add notice when posts are hidden. 2017-03-17 00:08:48 -05:00
evazion
935cefd27e API: on error, include backtrace in json response.
Incidentally fixes issue with error responses inside /sources.json not
including the usual `{"success": false}`.
2017-03-16 18:11:43 -05:00
r888888888
da06bee0ab revamp saved search implementation 2017-03-15 15:36:48 -07:00
r888888888
97cc8b5931 ignore privacy mode settings for admins 2017-03-09 13:52:46 -08:00
r888888888
537a293761 add links for random samples of uploads and favs 2017-03-09 13:50:32 -08:00
r888888888
865a2ca165 count searches even for tag links 2017-03-08 17:25:01 -08:00
Albert Yi
34a26d71db Merge pull request #2912 from evazion/opt-post-archive
Fix N+1 queries issues on /post_versions
2017-03-03 14:40:12 -08:00
evazion
167d86d4ec Fix 'Posts Report "Reviewed by 0 Moderators"' (#2914). 2017-03-03 15:35:01 -06:00
evazion
3290f5550a post_versions/_listing.html.erb:40: fix N+1 queries in "Undo" link.
post_version.post.versions.first.id caused an extra query for each post version:

    SELECT "post_versions".* FROM "post_versions" WHERE "post_versions"."post_id" = $1 ORDER BY updated_at ASC, id asc LIMIT 1
2017-03-02 17:46:14 -06:00
evazion
f13f9e7163 post_versions/index.html.erb:5: avoid extraneous COUNT.
@post_versions.empty? caused this query:

    SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "post_versions" WHERE (true) LIMIT 20 OFFSET 0) subquery_for_count

which is unnecessary since @post_versions can be counted directly.
2017-03-02 17:45:20 -06:00
r888888888
5676978096 require membership to see post history 2017-03-01 16:29:00 -08:00
evazion
2bb134f08d modqueue: highlight uploads containing "bad" tags. 2017-03-01 15:31:16 -06:00
r888888888
7f22baa1bc refactor upload tags report 2017-02-28 15:34:40 -08:00
Albert Yi
458a9692d6 Merge pull request #2864 from r888888888/upload_tags_report
Implement #2863: basic upload tags change report
2017-02-28 15:28:40 -08:00
Albert Yi
27a85cd066 Merge pull request #2895 from evazion/fix-modqueue-dtext
modqueue: link tags, optimize sql, use dtext in disapproval reasons.
2017-02-27 16:47:19 -08:00
evazion
b80976bce7 modqueue: link tags, like they are in /comments. 2017-02-24 21:03:14 -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
8a57d38f38 remove statement about responding in automated messages 2017-02-24 10:36:45 -08:00
evazion
b1af644f67 dmails: send automated dmails from Danbooru.config.system_user.
Sends automated dmails from `Danbooru.config.system_user`, rather than
whichever user is performing the action happens to be (usually User.admins.first).

Also adds a notice in the view that the dmail was automated.
2017-02-23 22:51:17 -06:00
evazion
865211b0b5 dmails: remove unused edit template and update route. 2017-02-23 22:51:17 -06:00
evazion
2d8a7ed93b /dmails: add help:dmail link to subnavbar. 2017-02-23 22:51:17 -06:00
evazion
d852f98e4f /dmails: remove unused search[owner_id] param.
/dmails is restricted to viewing dmails for CurrentUser only (due to
Dmail.visible in the index action). Remove owner_id from subnavbar links
in /dmails, and don't support it in /dmails?search[owner_id], since it
doesn't actually do anything.

Also removes related dead methods and fixes tests that didn't test owner_id properly.
2017-02-23 22:51:17 -06:00
r888888888
851872f104 fix site map 2017-02-21 16:41:35 -08:00
r888888888
6c9d5e4f9a remove advertisement code 2017-02-21 13:35:22 -08:00
r888888888
f4d9f76646 remove contributors report 2017-02-21 13:12:43 -08:00
r888888888
ce20a5b36a remove janitor trial report 2017-02-21 13:10:38 -08:00
r888888888
359f48d871 remove user promotions report 2017-02-21 13:09:43 -08:00
r888888888
6ca83a2f3c fixes #2890: Danbooru account upgrades reset permissions 2017-02-21 12:39:45 -08:00
r888888888
176510909a fixes #2891: Banned artists still show up in search listings 2017-02-21 11:34:01 -08:00
Albert Yi
8f49300187 Merge pull request #2889 from evazion/fix-dmail-indexes
Dmails: add indexes on is_read and is_deleted (fix #2886)
2017-02-21 11:31:20 -08:00
evazion
abae71c060 layouts/default.html.erb: optimize dmail notice sql.
* CurrentUser.dmail_count caused an unnecessary COUNT(*).
* CurrentUser.dmails.unread.present? caused *all* unread dmails to be
  loaded. We want to only load the first one.
2017-02-18 05:54:46 -06:00
evazion
17d4feaf15 dmail_notice.html.erb: use absolute urls in dtext links. 2017-02-18 03:11:35 -06:00