Commit Graph

2778 Commits

Author SHA1 Message Date
evazion
ea96295940 autocomplete: fix autocomplete returning empty tags.
Fix regression caused by 57ba5c59. Autocomplete implicitly relied on
Tag.search filtering out nonempty tags by default.
2020-03-16 15:35:08 -05:00
evazion
0f0e7cedf3 dmails: fixup exceptions when verifying dmail keys.
Fix show action throwing exceptions when viewing a dmail without a dmail key.
2020-03-14 21:09:25 -05:00
evazion
dc1742321d dmails: send email notifications in background job. 2020-03-14 21:06:29 -05:00
evazion
3dbdce3ae3 mod reports: fix exception when reporting forum posts. 2020-03-12 21:23:57 -05:00
evazion
258f4a8b95 users: move emails to separate table.
* Move emails from users table to email_addresses table.
* Validate that addresses are formatted correctly and are unique across
  users. Existing invalid emails are grandfathered in.
* Add is_verified flag (the address has been confirmed by the user).
* Add is_deliverable flag (an undeliverable address is an address that bounces).
* Normalize addresses to prevent registering multiple accounts with the
  same email address (using tricks like Gmail's plus addressing).
2020-03-12 21:18:53 -05:00
evazion
cc2172a925 forum: fix exception in forum_topics/new.
Caused by including is_read? in html_data_attributes. updated_at is nil
for new topics.
2020-03-11 21:06:04 -05:00
evazion
1f20ac2665 tags: fix value_for regex. 2020-03-11 02:09:59 -05:00
evazion
e81161bca5 forum: adjust BUR status label colors (again).
* Indicate unread topics in bold instead of with a "NEW" label.
* Use pills for labels.
2020-03-11 00:01:56 -05:00
evazion
6fecf5db0e BURs: remove old single alias/implication pruning code.
* Rename TagChangeRequestPruner to BulkUpdateRequestPruner.
* Remove old code for pruning individual alias / implication requests.
2020-03-10 21:23:46 -05:00
evazion
be585060f4 BURs: don't add [APPROVED] / [REJECTED] tags to titles. 2020-03-10 21:02:12 -05:00
evazion
0e7632ed8a aliases/implications: remove forum topic updating code.
Remove code for updating forum topics when an alias or implication is
approved or rejected. This code was only used when approving single
alias or implication requests. This is no longer used now that all
alias/implication requests are done through BURs.
2020-03-10 20:55:20 -05:00
evazion
6504d44223 forum: change BUR counts to status labels.
Use pending / approved / rejected status labels in front of the topic
title instead of a BUR count column. This is to make the forum listing
easier to visually scan for resolved vs unresolved topics.

Labels are only added for topics in the Tags category. This is a hack to
avoid labels on megathreads that have had BURs mistakenly attached to them.

[APPROVED] and [REJECTED] labels are stripped from thread titles to make
the titles cleaner. This is a hack until these titles can be fixed.
2020-03-10 20:13:11 -05:00
evazion
cb11d818b1 artist versions: fixup is_active reference. 2020-03-09 14:40:22 -05:00
evazion
5625458f69 users: refactor password reset flow.
The old password reset flow:

* User requests a password reset.
* Danbooru generates a password reset nonce.
* Danbooru emails user a password reset confirmation link.
* User follows link to password reset confirmation page.
* The link contains a nonce authenticating the user.
* User confirms password reset.
* Danbooru resets user's password to a random string.
* Danbooru emails user their new password in plaintext.

The new password reset flow:

* User requests a password reset.
* Danbooru emails user a password reset link.
* User follows link to password edit page.
* The link contains a signed_user_id param authenticating the user.
* User changes their own password.
2020-03-08 23:18:15 -05:00
evazion
f2d7e42d89 Merge pull request #4301 from BrokenEagle/forum-topic-bur-indicators
Add BUR counters to forum topics index
2020-03-07 23:04:19 -06:00
evazion
a1ddba4929 Merge pull request #4325 from BrokenEagle/related-tag-enhancements
Related tag enhancements
2020-03-07 22:38:24 -06:00
evazion
1a2c082b86 search: support negated wildcards in post searches.
* Support negated wildcards in searches (e.g. "holding -holding_*")
* Raise wildcard limit to matching 25 tags regardless of user level.
* Fix wildcards potentially matching empty tags.
* Fix wildcard tags being sorted by post count only, and therefore not
  having a stable ordering when tags have equal post counts.
* Fix sidebar to calculate wildcards tags the same way the search does.
2020-03-06 23:23:38 -06:00
evazion
967d398c8e search: move query parsing code from tag model to post query builder. 2020-03-06 23:23:38 -06:00
evazion
ddffffb413 artists: factor out artist finder to separate module. 2020-03-06 23:23:38 -06:00
evazion
39ad0d2210 settings: rename "disable responsive mode" to "enable desktop mode"
Desktop mode is a better description. Most users don't know what responsive mode means.
2020-03-06 19:37:11 -06:00
evazion
57ba5c59a4 tag_aliases/index: fix tag category search options excluding empty tags.
Fix Tag.search to not filter out empty tags by default. Set the default
in the tags controller instead.

Fixes various search pages, namely aliases/implications/wiki pages, that
rely on Tag.search and that don't expect it to filter tags out by default.
2020-03-06 19:07:17 -06:00
evazion
6d2dd0303f tags/index: fix has_artist search option.
Fix references to artists.is_active. Note that we deliberately use joins
instead of subqueries here for performance reasons.
2020-03-06 18:55:02 -06:00
evazion
5bc0ab446b models: add deletable concern. 2020-03-06 17:06:29 -06:00
evazion
c936a9624c artists/index: fix incorrect page counts for has_tag param.
Bug: using the has_tag param caused the paginator to calculate the wrong
page count.

Caused by the join having a DISTINCT clause in the OFFSET/LIMIT query,
but not in the COUNT(*) query.
2020-03-06 15:10:19 -06:00
evazion
4c11e339bd artists: rename is_active flag to is_deleted.
Rename is_active to is_deleted. This is for better consistency with
other models, and to reduce confusion over what "active" means for
artists. Sometimes users think active is for whether the artist is
actively producing work.
2020-03-06 14:50:21 -06:00
BrokenEagle
a70433e78f Support numeric inputs for the category 2020-03-06 08:10:28 +00:00
evazion
b9939c6356 Fix #4315: Disapproval messages aren't striped of spaces.
Set blank disapproval messages to null to prevent them from showing up
in wildcard searches.
2020-03-03 04:26:39 -06:00
evazion
143bfdfb5b forum: fix mods not being able to lock forum topics. 2020-03-03 03:54:19 -06:00
evazion
04b69954eb modqueue: add order options; change default order to newest first.
* Add options for changing the order of the modqueue (newest first,
  oldest first, highest scoring first, lowest scoring first).

* Change the default order from oldest posts first to most recently
  flagged or uploaded posts first.

* Add an order:modqueue metatag to order by most recently flagged or
  uploaded in standard searches.
2020-03-03 03:25:51 -06:00
evazion
980103e443 modqueue: optimize sql queries.
* Include appeals and flags.
* Avoid an existence query for pools.
* Avoid a query checking if the user has previously approved the post.
  This is a rare condition and it will be prevented anyway if the user
  tries to reapprove the post.
2020-02-29 17:46:57 -06:00
evazion
b232470248 search: change behavior of disapproval:<reason> metatag.
* Change the `disapproval:<reason>` metatag to `disapproved:<reason>`.

* Change `disapproved:<reason>` to show all posts disapproved for a
  given reason, not just those disapproved by the current user.

* Allow searching for your own disapprovals with `disapproved:<my_name>`.

* Drop the `disapproved:<any|none>` metatags. `disapproved:any` is
  equivalent to `disapproved:<my_name>` and `disapproved:none` is
  equivalent to `-disapproved:<my_name>`.

These changes are so that you can search e.g. disapproved:poor_quality
to find all posts disapproved for poor quality.
2020-02-29 17:46:57 -06:00
evazion
8bc18ad461 aliases/implications: default listing to newest first.
Change alias and implication index pages from listing
aliases/implications by pending first to newest first.
2020-02-27 20:18:18 -06:00
evazion
a97f435342 aliases/implications: add » links to name fields.
Add » links to the antecedent and consequent name fields. These links
let you find all tags aliased or implied to or from a given tag. For
implications, this is a deep search (includes indirectly implied tags).
2020-02-27 20:07:59 -06:00
evazion
dd2faa0d35 users: don't count deleted feedbacks on profile. 2020-02-27 13:17:03 -06:00
evazion
b915f1c586 Revert "application model: move pagination extension to concern."
This reverts commit 7855e36d17.

Broke pagination due to incorrect memoization causing @paginator_count
to be shared between requests.
2020-02-25 01:07:09 -06:00
evazion
406bc5d87f Add /pixiv_ugoira_frame_data.json endpoint. 2020-02-24 22:43:03 -06:00
evazion
7c71311eef Add /favorites.json endpoint. 2020-02-24 22:42:59 -06:00
evazion
ce11485fe0 Remove super voters. 2020-02-23 17:52:38 -06:00
evazion
463b1b734e Add curated posts page.
Add a curated posts page at /explore/posts/curated. Curated posts are
the most favorited posts by contributor-level users (users with
unlimited upload permissions).

Also add an order:curated tag using for use in regular searches.
2020-02-23 17:52:38 -06:00
evazion
cc9298cf46 posts: fix newpool:<name> metatag. 2020-02-23 17:26:08 -06:00
evazion
e47d0e0d05 models: set more creator names explicitly.
Set creators explicitly for bans, BURs, comment votes, and posts.
2020-02-23 17:26:08 -06:00
evazion
3a018ee9f7 dmails: set sender name and ip address explicitly.
Set the sender name and IP addresses explicitly in the controller rather
than implicitly in the model.

Fixes cases where automated dmails from DanbooruBot had their IP
addresses set to the person who triggered the dmail, even though they
didn't actually send the dmail themselves.
2020-02-23 17:26:08 -06:00
evazion
7855e36d17 application model: move pagination extension to concern. 2020-02-23 17:26:04 -06:00
evazion
a181e6d0db Fix #1898: Include alias predicates in non-empty Tags search.
Make searches on the /tags index includes aliases too. Show matching
aliases like this:

   Name: gray*

   ? 75098 grey_hair <- gray_hair
   ? 35345 grey_eyes <- gray_eyes
2020-02-23 00:29:17 -06:00
evazion
a8e5412d9c implications: refactor calculation of implied tags.
Refactor to use a recursive CTE to calculate implied tags in SQL, rather
than storing them in a descendant_names field. This avoids the
complexity of keeping the stored field up to date. It's also more
flexible, since it allows us to find both descendant tags (tags that
imply a given tag) as well as ancestor tags (tags that are implied by a
given tag).
2020-02-22 22:37:36 -06:00
evazion
83a3ed85dd Fix #4308: pixiv_ugoira_frame_data not available through API anymore. 2020-02-22 19:07:35 -06:00
evazion
2d7f77ce03 implications: remove memoization of parents, descendants, forum_updater.
Not necessary for performance and flushing the cache at the right times
added some complexity.
2020-02-22 02:09:30 -06:00
evazion
c6de2ecd12 aliases: remove minimum post count requirement.
Remove the soft requirement that the destination tag must have 50 posts
in order to request an alias. This often gets in the way when trying to
rename a tag to a new name that doesn't already exist.
2020-02-22 01:42:01 -06:00
evazion
c1f7b76bdb dtext: refactor parsing of embedded BUR pseudo tags. 2020-02-22 01:37:12 -06:00
evazion
ca1492c8ca aliases/implications: don't retry if approving fails.
This was originally meant to deal with statement timeouts when updating
tags. This is no longer a problem.
2020-02-22 01:20:29 -06:00