Commit Graph

1707 Commits

Author SHA1 Message Date
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
r888888888
f374eec4a1 fixes #2869: Add way to differentiate Pool Descriptions from Pool History 2017-02-14 16:03:19 -08:00
r888888888
651dad473d fixes #2884: Comment unvoting is broken 2017-02-14 10:35:27 -08:00
Type-kun
1e8eceeba9 Implement basic upload tags change report 2017-01-27 18:28:15 +05:00
r888888888
8a93fdf18f additional saved search fixes 2017-01-25 12:48:47 -08:00
r888888888
1207faa600 fix tests 2017-01-24 16:05:06 -08:00
r888888888
98b305b4db add link to mod+ topics 2017-01-24 13:13:13 -08:00
r888888888
16e7043477 remove reference to danbooru version in footer 2017-01-24 13:13:13 -08:00
Albert Yi
1d4413bdf9 Merge pull request #2858 from evazion/feat-update-hotkeys
Add additional hotkeys
2017-01-24 13:03:55 -08:00
evazion
8d65ae840b hotkeys: document new bindings. 2017-01-24 02:46:01 -06:00
evazion
7571cda640 hotkeys: add E to edit, shift+D to delete to artists, pools, wiki, forum. 2017-01-24 02:46:00 -06:00
evazion
ecf22adc7d /comments/search: add more search params; style as inline form. 2017-01-23 22:13:00 -06:00
r888888888
c7b5a4e229 add references to user statistics page about saved searches 2017-01-23 10:56:39 -08:00
evazion
c6966268a2 Remove 'reason' from name change request form; update copy. 2017-01-19 23:42:39 +00:00
r888888888
a919da4dd6 add id attributes to secondary links for posts 2017-01-17 17:59:37 -08:00
Albert Yi
bdac591266 fixes #2838 2017-01-16 12:57:43 -08:00
Albert Yi
a49394e6cd Merge pull request #2842 from evazion/fix-user-name-changes
Minor user name changes improvements.
2017-01-16 11:50:51 -08:00
Type-kun
15b711e423 Fixes #2694: hide "revert all" when user has over 1000 post changes 2017-01-16 18:43:36 +05:00
evazion
f0bdf565fe Name changes: add listing/new/help links to subnav. 2017-01-15 05:03:09 +00:00
evazion
9e9fdcb55d Name changes: make /user_name_change_requests member+; add reason/status/date. 2017-01-15 05:03:09 +00:00
evazion
047d3675e9 Name changes: don't show user feedback/stats for processed requests. 2017-01-15 05:03:09 +00:00