Commit Graph

9531 Commits

Author SHA1 Message Date
evazion
9a62bb673f Merge pull request #5130 from nonamethanks/readd-approve-button
Readd approval button to the sidebar
2022-04-19 06:34:34 -05:00
evazion
14c8146a5d stripe: notify site owner when a chargeback is created.
Send a notification Dmail to the site owner when a chargeback is
created, or when an impending chargeback warning is received.
2022-04-18 19:46:44 -05:00
nonamethanks
7486836b0f Readd approval button to the sidebar
The quick mod buttons are also used in the modqueue so it's not
possible to bind the shift-o shortcut to them, hence the need
for this button.
2022-04-18 19:50:35 +02:00
evazion
a45b18ed36 views: inline notes partial into posts show page. 2022-04-18 04:30:01 -05:00
evazion
dff0b0e48b posts: add back option to undelete posts in sidebar.
This was removed in 1a990d5ab, but that left no way to undelete posts
that haven't been appealed since the quickmod bar isn't shown in that
case.
2022-04-18 04:28:54 -05:00
evazion
089adc085b Fix #5119: /counts/posts ignores aliased tags on betabooru 2022-04-18 00:52:08 -05:00
evazion
cd22c8eb1a posts: eliminate unnecessary favgroup query on posts show page.
Eliminate a SQL query loading the post's favgroups if the current user
is anonymous (and therefore can't have favgroups).
2022-04-18 00:18:54 -05:00
evazion
5050ca527d posts: eager load uploader and media asset on posts show page.
Eliminate a couple SQL queries by loading the uploader and media asset
in the same query as the post.
2022-04-18 00:18:54 -05:00
evazion
436f3eaf5d posts: eliminate redundant tag load on posts show page.
Eliminate an unnecessary `SELECT name, post_count, category FROM tags WHERE name IN (?)`
query on the post show page. This query was used by `humanized_essential_tag_string`
when generating the page title. This query was redundant because we already use
another query to load the tag list with `SELECT * FROM tags WHERE name IN (?)`.
2022-04-18 00:18:50 -05:00
evazion
219a0959a5 saved searches: fix to use new PostQuery class. 2022-04-17 23:20:22 -05:00
evazion
ca5dd61728 post queries: optimize zero tag and single tag searches.
Avoid going through the full post query parser for empty searches or
simple single-tag searches.
2022-04-17 23:20:22 -05:00
evazion
652db0cd9f post queries: show full error message on error page. 2022-04-17 23:20:22 -05:00
evazion
eca0ab04f7 post queries: raise error on invalid searches.
Raise an error if the search is invalid for one of the following reasons:

* It contains multiple conflicting order: metatags (e.g. `order:score order:favcount` or `ordfav:a ordfav:b`).
* It contains a metatag that can't be used more than once: (e.g. `limit:5 limit:10`, `random:5 random:10`).
* It contains a metatag that can't be negated (e.g. `-order:score`, `-limit:20`, or `-random:20`).
* It contains a metatag that can't be used in an OR clause (e.g. ` touhou or order:score`, `touhou or limit:20`, `touhou or random:20`).
2022-04-17 23:20:22 -05:00
evazion
c45d1d42c2 post queries: fix parsing of trailing parentheses.
Fix queries like `(fate_(series) saber)` being parsed as `fate_(series` + `saber)`
instead of `fate_(series)` + `saber`.

This is pretty hacky. We assume that parentheses in tags are balanced.
So the rule is that trailing parentheses are part of the tag as long as
they're balanced, and not part of the tag if they're unbalanced.
2022-04-17 23:20:22 -05:00
evazion
5f1c296011 tags: don't allow tags with unbalanced parentheses.
Don't allow tags to have unbalanced parentheses, except for a few
emoticon tags as special exceptions to the rule.
2022-04-17 23:20:22 -05:00
evazion
3e8e33e663 post queries: fix handling of '~' operator.
Fix queries like `(~a ~b) (~c ~d)` being handled like `~a ~b ~c ~d`.
Caused by trimming AND nodes from the tree before rewriting the '~'
operator, which caused `~a` terms to be incorrectly lifted out of
subexpressions.
2022-04-17 23:20:22 -05:00
evazion
c4e1f5bf3d posts: fix post search count logging. 2022-04-17 23:20:22 -05:00
evazion
7584578166 posts: fix post query logging. 2022-04-17 23:20:22 -05:00
evazion
af183467b6 post queries: switch to new post search engine.
Switch to the post search engine using the new PostQuery parser. The new
engine fully supports AND, OR, and NOT operators and grouping expressions
with parentheses.

Highlights:

New OR operator:

* `skirt or dress` (same as `~skirt ~dress`)

Tags can be grouped with parentheses:

* `1girl (skirt or dress)`
* `(blonde_hair blue_eyes) or (red_hair green_eyes)`
* `~(blonde_hair blue_eyes) ~(red_hair green_eyes)` (same as above)
* `(pantyhose or thighhighs) (black_legwear or brown_legwear)`
* `(~pantyhose ~thighhighs) (~black_legwear ~brown_legwear)` (same as above)

Metatags can be OR'd together:

* `user:evazion or fav:evazion`
* `~user:evazion ~fav:evazion`

Wildcard tags can combined with either AND or OR:

* `black_* white_*` (find posts with at least one black_* tag AND one white_* tag)
* `black_* or white_*` (find posts with at least one black_* tag OR one white_* tag)
* `~black_* ~white_*` (same as above)

See 4c7cfc73 for more syntax examples.

Fixes #4949: And+or search?
Fixes #5056: Wildcard searches return unexpected results when combined with OR searches
2022-04-17 23:20:22 -05:00
evazion
703fd05025 favgroups: don't allow favgroups to be named 'any' or 'none'.
'any' and 'none' are now reserved keywords for the favgroup: metatag.

Also add a fix script to rename existing favgroups.
2022-04-17 23:17:18 -05:00
evazion
db49a4fbff views: inline partials in posts/show layout.
Reduce the number of spans reported to the APM.
2022-04-17 23:03:00 -05:00
evazion
604b6ce547 views: inline partials into default layout.
Inline the page footer, news updates, the ban notice, and the user
verification notice into the default layout. This is a micro
optimization to reduce the number of spans reported to the APM.
2022-04-17 23:00:31 -05:00
evazion
d19e307e69 Merge pull request #5125 from nonamethanks/booth-support
Add Booth support
2022-04-17 23:00:14 -05:00
evazion
adbef1b869 Merge pull request #5113 from nonamethanks/prune-disapprovals-on-queue-enter
Posts: prune disapprovals on new appeal or flag
2022-04-17 22:57:49 -05:00
evazion
e35bbb8bc8 Merge pull request #5120 from nottalulah/favgroup-any
favgroups: allow favgroup:any/none searches
2022-04-17 22:55:55 -05:00
evazion
4f684044e3 Merge pull request #5114 from nonamethanks/editable-post-disapprovals
Allow post disapprovals to be edited
2022-04-17 22:54:57 -05:00
nonamethanks
9612578fcb Add Booth support 2022-04-16 17:52:18 +02:00
evazion
dce98286db Revert "posts: remove tag limit from searches."
This reverts commit 2543a2b05b.
2022-04-13 03:13:50 -05:00
evazion
15a0fd604b tags: exclude deprecated tags from related tags list.
Don't show deprecated tags in the related tags or translated tags lists
when editing a post. It doesn't make sense to recommended adding tags
that can't be added to the post.
2022-04-13 03:07:09 -05:00
evazion
e1c9a7d525 BURs: fix not being able to approve deprecation when tag is already deprecated.
Fix a bug where you couldn't approve a BUR deprecating a tag if that tag
was already deprecated by a separate BUR.
2022-04-13 02:32:16 -05:00
evazion
363cf2014b views: fix deprecated calls to ViewComponent#with_variant. 2022-04-13 00:18:53 -05:00
Talulah
c1996e4f06 favgroups: allow favgroup:any/none searches 2022-04-12 23:01:19 -03:00
evazion
f69847fc59 Add Elastic APM integration.
https://www.elastic.co/guide/en/apm/agent/ruby/4.x/introduction.html
2022-04-12 20:49:10 -05:00
nonamethanks
1a990d5ab9 Allow post disapprovals to be edited 2022-04-11 21:05:44 +02:00
nonamethanks
63bd5daa3b Posts: prune disapprovals on new appeal or flag 2022-04-11 15:54:28 +02:00
evazion
98b313f8de Remove NewRelic integration.
Remove the NewRelic integration in preparation for migrating to Elastic APM instead.
2022-04-11 01:46:30 -05:00
evazion
05261bf6d7 tags: fix backwards deprecate tag links on tag edit page.
Fix the tag edit page getting the `deprecate tag` and `undeprecate tag` BUR links backwards.
2022-04-10 00:13:26 -05:00
nonamethanks
11281d6f58 Tags: don't allow deprecation of tags without wiki 2022-04-09 20:16:55 +02:00
evazion
a4659b4d09 Merge pull request #5099 from nonamethanks/deprecated-tags
Add ability to mark tags as deprecated
2022-04-09 04:56:43 -05:00
evazion
f27a85e879 Merge pull request #5092 from NamelessContributor/issue-5084
Add auto theme preference (fix #5084)
2022-04-09 03:48:39 -05:00
nonamethanks
ea76a889db Add ability to mark tags as deprecated
* Deprecated tags can't be added to posts, but existing deprecated tags
  in a post won't be removed
* Only empty tags can be marked as deprecated manually
* No tags can be manually undeprecated
** These limits don't apply to admins
* Deprecating or undeprecating a tag will create a new mod action to
  prevent people from going rogue
* Added deprecate/undeprecate commands for BURs
* Deprecating a tag via BUR removes all implications to and from it as well
2022-04-08 09:07:14 +02:00
NamelessContributor
91a9153764 css: prevent acidentally opening spoilered links
A small delay on the pointer-events property prevents accidentally
opening a link inside a spoiler when tapping to reveal the spoiler on
mobile.
2022-04-07 11:43:17 +02:00
evazion
98a9b2484b post queries: parse order:*_count synonyms. 2022-04-06 23:57:55 -05:00
evazion
86de5cb5d2 posts: fixup flagger: metatag.
Fix regression in 01a22930e.
2022-04-06 23:57:50 -05:00
evazion
01a22930e7 posts: move attribute search methods from PostQueryBuilder to Post.
Move `status_matches` etc methods from PostQueryBuilder to Post. This is
to make refactoring to use the new query parser easier.
2022-04-06 20:25:09 -05:00
evazion
c707190bc1 posts: refactor modules to use concerning. 2022-04-06 20:25:00 -05:00
evazion
a4d43ae72a post queries: track whether metatag values are quoted.
This is necessary for the `commentary:` metatag, which has different
behavior depending on whether the metatag value is quoted. For example,
`commentary:translated` finds translated commentaries, while
`commentary:"translated"` finds commentaries containing the literal word
"translated".
2022-04-06 17:20:27 -05:00
evazion
2adc530ba0 post queries: parse count metatag synonyms. 2022-04-06 17:20:27 -05:00
evazion
f15f365375 Merge pull request #4952 from thayol/fix-negated-ord
Search: "Fix" negated ordered metatags
2022-04-06 04:43:24 -05:00
evazion
783419bcd7 post queries: support single-quoted strings in metatags. 2022-04-06 00:18:38 -05:00