Commit Graph

8215 Commits

Author SHA1 Message Date
evazion
5db11a0b5f Merge branch 'master' into attribute-searching 2020-08-17 14:23:00 -05:00
evazion
d9f0a1c5e3 Merge pull request #4585 from nonamethanks/fix_tumblr
Tumblr: support highest res for new image urls
2020-08-17 14:11:48 -05:00
evazion
c6a3b11fb6 Merge pull request #4592 from nonamethanks/show_appeals
Users: show appeal link and count to everyone
2020-08-17 13:59:20 -05:00
nonamethanks
04c8a9ebba Users: show appeal link and count to everyone 2020-08-17 13:55:52 +02:00
evazion
366eff4169 posts: show only last successful flag on deleted posts.
In the "This post was deleted" notice, show only the last successful
flag, instead of all previous flags (which may include rejected flags).
2020-08-16 17:19:29 -05:00
evazion
8f1276b013 appeals: crosspost appeals to deletion appeal thread.
Crosspost pending appeals to the deletion appeal thread. We do this once
per hour so we can batch together multiple appeals into one post.
2020-08-16 17:19:04 -05:00
evazion
df19cbfd55 modqueue: show appealed posts in sidebar. 2020-08-16 15:41:30 -05:00
evazion
d072ef98ba css: don't use monospace font for textareas.
This changes the font in text input boxes (including the tag edit box)
from monospace to Verdana.
2020-08-16 15:17:40 -05:00
evazion
44cbce9855 css: factor out fonts to css variables. 2020-08-16 15:01:28 -05:00
evazion
f337902c57 modqueue: fix performance regression from including appeals.
* Add index on posts.is_deleted. The modqueue was slow because we the
 appeal condition wasn't constrained to deleted posts, so it degraded to
 a full table scan.

* Avoid extra queries for calculating the page count and disapproval counts.
2020-08-16 14:31:47 -05:00
evazion
16cfdb8321 bans: don't allow users to be double banned. 2020-08-16 14:31:47 -05:00
evazion
317cfe19b4 flags: only show current flag on flagged posts.
* Only show the current pending flag on flagged posts. Don't show old flags.

* Don't show both the "This post was flagged for review" and the "This
  post was flagged and is pending" notices.
2020-08-16 14:31:47 -05:00
evazion
7eb9f0b75e appeals: only show current appeal on appealed posts.
* Only show the current pending appeal in the "This post was appealed"
  notice. Don't show old appeals.

* Don't show both the "This post was deleted" and the "This post was
  appealed" notice on appealed posts. Only show the "This post was
  appealed" notice.

* Show "no reason" if no appeal reason was given.
2020-08-16 14:31:47 -05:00
evazion
d4d1088c30 appeals: make appeal reasons optional. 2020-08-16 14:31:47 -05:00
evazion
a1be6d35d1 mod dashboard: don't show appeals.
Don't show appeals in the /moderator/dashboard page. Appeals are already
available in the modqueue.
2020-08-16 14:31:42 -05:00
evazion
c002166801 Fix #4584: Disable deleted post filter when searching for status:appealed. 2020-08-14 22:05:19 -05:00
evazion
f53fa2adb4 Fix #4587: "Max 5 flags per 3 days" should account for reapproved flags. 2020-08-14 21:57:08 -05:00
nonamethanks
5615719218 Tumblr: support highest res for new image urls 2020-08-14 01:23:27 +02:00
evazion
cbadfb3817 post versions: remove dead check_for_retry method. 2020-08-13 02:24:13 -05:00
evazion
70f345fd7b post versions: add back support for changed_tags param.
Fix broken links on various pages:

* The 'History' link in the sidebar on the post index page.
* The 'History' links on the tags index page.
* The 'Tag History' link in the sidebar on the wiki show page.
2020-08-13 02:21:38 -05:00
evazion
06564b25ca autocomplete: add status:appealed to autocomplete. 2020-08-12 22:40:17 -05:00
evazion
fbac2cd167 uploads: make early deletions cost more upload slots.
If a pending post is manually deleted before the 3 day moderation period
is up, then make it cost 5 upload slots until the 3 day period is up.
This means that if a new user uploads 3 bad posts that get manually
deleted, then all of their upload slots will be used and they won't be
able to upload again until 3 days have passed.
2020-08-12 21:31:30 -05:00
evazion
78b9613498 Fix #4554: Searches with "-status:active" not showing deleted posts.
Also fixes #4542: Quoted search metatag status:"deleted" yields no results.
2020-08-12 20:53:14 -05:00
evazion
d884cb6642 search: fix parsing of quoted metatag values.
* Fix #4552: Multiple quoted search terms not parsed correctly.
* Allow quotes to be escaped in quoted metatags.
* Allow spaces to be escaped in unquoted metatags.
* Allow the empty string to be used in metatags.

Examples:

* `source:""` and `source:''` (same as `source:none`)
* `source:foo\ bar\ baz` (same as `source:"foo bar baz"`)
* `source:"don't say \"lazy\""` (use \" to write a literal ")
* `source:'don\'t say "lazy"'` (use \' to write a literal ')
* `source:"C:\\Windows"` (use \\ to write a literal \)
2020-08-12 18:12:16 -05:00
evazion
dd8c3fad2c flags: adjust limit to 5 flags at once. 2020-08-12 13:11:33 -05:00
evazion
5917587fd5 http: add logger for debugging purposes.
Usage: Danbooru::Http.new.use(:logger).get(url).
2020-08-12 13:11:33 -05:00
evazion
0297b631fb moderation: extract 3 day modqueue length to config. 2020-08-12 13:11:22 -05:00
evazion
3d3b5262cc uploads: don't show translated commentary in tag edit dialog. 2020-08-12 11:02:11 -05:00
evazion
4f57d0924f flags: fix deleting unapproved posts.
Don't trigger the "can't be flagged more than once in 3 days" rule when
generating the "Unapproved in three days" flag.
2020-08-12 11:00:17 -05:00
evazion
7d2050428e Merge pull request #4580 from nonamethanks/copy_note_annotations
Copy annotation tags when copying notes
2020-08-12 09:47:15 -05:00
evazion
58179fce00 Merge pull request #4579 from nonamethanks/fix_4564
Upload limit: don't display progress in tooltip when maxed out
2020-08-12 09:46:44 -05:00
evazion
a70c4a72e6 Merge pull request #4570 from nonamethanks/fix_4543
Nijie: fix login
2020-08-12 09:46:09 -05:00
nonamethanks
7c03f0d6c9 Copy annotation tags when copying notes 2020-08-12 06:21:50 +02:00
nonamethanks
bc8fc1839f Upload limit: don't display progress when maxed out 2020-08-11 04:24:16 +02:00
evazion
0e41fef011 users: mention needing a non-disposable email to verify account. 2020-08-08 15:23:49 -05:00
evazion
3210da1a23 flags: raise flag limits.
The old flag limits were:

* 1 flag per day for regular members.
* 10 flags per day for Gold users.
* Unlimited flags for approvers.

The new flag limits are:

* 10 flags in the modqueue at once for regular users.
* Unlimited flags for approvers.
* Unlimited flags for users with a high enough flag success rate. If you
  have at least 30 flags in the last 3 months, and you have at least a
  70% flag success rate, then you get unlimited flags.

10 flags at once means you can have up to 10 flagged posts in the
modqueue at the same time. Because flags stay in the modqueue for 3
days, this means you can flag on average 10 posts every 3 days, or just
over 3 posts per day.
2020-08-08 15:22:13 -05:00
evazion
e8dcc9c56e appeals: raise appeal limits.
The old limit was one appeal per day. The new limit is based on your
upload limit. Each appeal costs 3 upload slots. If you have 15 upload
slots, then you can appeal up to 5 posts at once, but you won't be able
to appeal or upload more until your appeals are approved or rejected. If
you have unlimited uploads, then you have unlimited appeals.
2020-08-08 12:39:20 -05:00
evazion
3a17b5a13e flags/appeals: replace is_resolved flag with statuses.
Replace references to the `is_resolved` field with the `status` field.
Post flags were marked as resolved when a post was approved (but not
when the post was deleted because it went unapproved). The status field
supercedes the resolved field.
2020-08-07 19:24:57 -05:00
evazion
2b0cd3c90b searchable: add support for searching enum fields.
Allow searching enum fields by string, by id, or by array of
comma-separated values. The category field in modactions is an example
of an enum field that can be searched this way.
2020-08-07 19:24:57 -05:00
evazion
afc07d8adf css: fix padding beneath buttons in dialog boxes.
Fix not having any space between the Submit / Cancel buttons and the
bottom of the dialog box. For some reason this only happens in
production, not development.
2020-08-07 10:35:13 -05:00
evazion
ec352d6a63 Merge pull request #4563 from BrokenEagle/add-postver-search
Add search for a list of any changed tags
2020-08-07 10:03:24 -05:00
evazion
ad2ad295af Merge pull request #4560 from BrokenEagle/fix-tooltip-initialize
Fix tooltips to allow for reinitialization
2020-08-07 10:02:32 -05:00
evazion
f2e262d5fd Merge pull request #4556 from nonamethanks/fix_unban
Post unbans: fix typo
2020-08-07 09:59:44 -05:00
evazion
85b04887d2 maintenance: fix tag counts hourly instead of daily (#4572). 2020-08-07 09:14:31 -05:00
evazion
8917cc3035 maintenance: prune posts hourly instead of daily. 2020-08-07 09:10:00 -05:00
evazion
3b73861d05 maintenance: fix undefined current user exception.
Possible fix for this exception that happens in production for unclear
reasons:

    NoMethodError: undefined method `is_admin?' for nil:NilClass
    …oru/releases/20200805193154/app/policies/tag_policy.rb:    3:in `can_change_category?'
    …www/danbooru/releases/20200805193154/app/models/tag.rb:  216:in `find_or_create_by_name'
    …www/danbooru/releases/20200805193154/app/models/tag.rb:  193:in `block in create_for_list'
    …www/danbooru/releases/20200805193154/app/models/tag.rb:  193:in `map'
    …www/danbooru/releases/20200805193154/app/models/tag.rb:  193:in `create_for_list'
    …ww/danbooru/releases/20200805193154/app/models/post.rb:  463:in `normalize_tags'
2020-08-07 09:06:23 -05:00
evazion
56ba6c2c58 maintenance: fix post pruning test.
Test mistakenly passed because we used `assert(a, b)` instead of
`assert_equal(a, b)`.
2020-08-07 08:53:38 -05:00
evazion
dd44dce597 posts: fix exception when viewing invalid .zip file.
Fix exception when viewing post #23077 (a .zip that is not a ugoira).
Caused by including large_image_width in the image's data-* attributes.
The image_width was nil, which caused a comparison to fail.
2020-08-07 08:22:23 -05:00
evazion
797d8ed617 flags: remove the rule that you can't flag in your first week. 2020-08-06 20:56:11 -05:00
evazion
0a0a85ee70 Fix #4568: Send appealed posts back to the mod queue
* Include appealed posts in the modqueue.

* Add `status` field to appeals. Appeals start out as `pending`, then
  become `rejected` if the post isn't approved within three days. If the
  post is approved, the appeal's status becomes `succeeded`.

* Add `status` field to flags. Flags start out as `pending` then become
  `rejected` if the post is approved within three days. If the post
  isn't approved, the flag's status becomes `succeeded`.

* Leave behind a "Unapproved in three days" dummy flag when an appeal
  goes unapproved, just like when a pending post is unapproved.

* Only allow deleted posts to be appealed. Don't allow flagged posts to be appealed.

* Add `status:appealed` metatag. `status:appealed` is separate from `status:pending`.

* Include appealed posts in `status:modqueue`. Search `status:modqueue order:modqueue`
  to view the modqueue as a normal search.

* Retroactively set old flags and appeals as succeeded or rejected. This
  may not be correct for posts that were appealed or flagged multiple
  times. This is difficult to set correctly because we don't have
  approval records for old posts, so we can't tell the actual outcome of
  old flags and appeals.

* Deprecate the `is_resolved` field on post flags. A resolved flag is a
  flag that isn't pending.

* Known bug: appealed posts have a black border instead of a blue
  border. Checking whether a post has been appealed would require either
  an extra query on the posts/index page, or an is_appealed flag on
  posts, neither of which are very desirable.

* Known bug: you can't use `status:appealed` in blacklists, for the same
  reason as above.
2020-08-06 20:55:45 -05:00