Commit Graph

8936 Commits

Author SHA1 Message Date
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
c53e4e7155 Merge pull request #4300 from BrokenEagle/fix-note-version-dimension-columns
Only show dimension transitions on relevant changes
2020-02-23 01:02:03 -06:00
evazion
1ce01df3db Merge pull request #4302 from BrokenEagle/fix-nonembedded-note-resizing
Restrict note container resizing to embedded notes
2020-02-23 01:01:44 -06:00
evazion
b31409a586 Merge pull request #4306 from BrokenEagle/fix-commentary-version-post-search
Fix searching artist commentaries by post ID
2020-02-23 01:01:26 -06:00
evazion
81532fdbac wiki_pages/search: fix title field. 2020-02-23 00:30: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
evazion
d915009407 aliases/implications: remove dead approving/updating code.
Remove the edit, update, and approve endpoints for tag aliases and
implications. These have been useless since individual alias and
implication requests were removed. Aliases and implications could only
be edited or approved if they were in the pending state, which is no
longer possible.

Also remove unused new alias/implication request forms.
2020-02-22 01:20:23 -06:00
BrokenEagle
2dca001e12 Fix searching artist commentaries by post ID 2020-02-21 21:58:29 +00:00
BrokenEagle
2b0d52b5bb Restrict note container resizing to embedded notes 2020-02-21 20:07:19 +00:00
evazion
2f5255f6b7 user presenter: fix syntax error in previous names.
Fixup for 0ad42d23c.
2020-02-21 00:20:18 -06:00
evazion
9b58cb7b42 mode menu: remove approve option.
Remove the approve option from the post mode menu. Mass approving posts
is rarely needed. The javascript was also buggy (it didn't update the
data attributes correctly when undeleting a post).

The replacement for this feature is to use a tagscript with the
status:active tag.
2020-02-20 17:43:33 -06:00
evazion
d7e0b5aa90 posts: add metatags for approving and banning posts.
* Allow approvers to approve a post by tagging it with status:active.
* Allow approvers to ban a post by tagging it with status:banned.
* Allow approvers to unban a post by tagging it with -status:banned.
2020-02-20 17:42:32 -06:00
evazion
faf852d18e approvals: remove post undelete endpoint.
Remove `POST /moderator/post/undelete` endpoint. Replace it with
`POST /post_approvals` instead.

Fixes it so that undeleting a post has the same behavior as approving a
post. Namely, it reloads the page instead of just flashing a "Post was
undeleted" message.
2020-02-20 15:49:31 -06:00
evazion
f47c56d976 approvals: move post approval endpoint to /post_approvals.
Move the post approval endpoint from `POST /moderator/post/approval` to
`POST /post_approvals`.
2020-02-20 15:49:18 -06:00
BrokenEagle
878a3badd1 Only show dimension transitions on relevent changes 2020-02-20 19:27:38 +00:00
evazion
610ad9e119 mode menu: refactor favorite and vote options. 2020-02-20 03:42:07 -06:00
evazion
c89c7ccc63 mode menu: remove post ban, rating lock, note lock options. 2020-02-20 03:42:07 -06:00
evazion
0ad42d23c9 models: refactor search visibility methods.
Refactor how model visibility works in index actions:

* Call `visible` in the controller instead of in model `search`
  methods. This decouples model visibility from model searching.

* Explicitly pass CurrentUser when calling `visible`. This reduces
  hidden dependencies on the current user inside models.

* Standardize on calling the method `visible`. In some places it was
  called `permitted` instead.

* Add a `visible` base method to ApplicationModel.
2020-02-19 17:08:59 -06:00
evazion
bd6d896ee0 models: factor out concerns to app/logical/concerns. 2020-02-19 16:37:24 -06:00
evazion
f54470ddfb post disapprovals: fix tests and API create action.
* Fix tests.
* Fix create action in API (couldn't redirect to show action).
* Clean up user initialization.
2020-02-19 15:20:39 -06:00
evazion
0aa05a116f burs/index: add back forum post link.
Add back forum post link removed in ff8bfee9e.
2020-02-18 19:22:57 -06:00
evazion
72e56d8856 PostPresenter.preview: standardize on show_deleted: true.
Standardize on using `show_deleted: true` instead of `tags: "status:any"`
when rendering thumbnails and we want to show deleted thumbnails.

Also fixes it so that deleted thumbnails are shown when reordering pools
and favorite groups.
2020-02-18 19:22:57 -06:00
evazion
1244e02fe2 pixiv: handle new https://i-f.pximg.net urls. 2020-02-18 19:22:57 -06:00
evazion
3104a78100 Merge pull request #4297 from BrokenEagle/add-cosplay-related-tags
Add cosplay related tags for other wikis
2020-02-18 15:58:39 -06:00
evazion
fcf5dadc2b Merge pull request #4298 from lllusion3469/patch-5
fix leftover reference to Artist.notes
2020-02-18 15:55:39 -06:00
evazion
9f12a4052d Merge pull request #4294 from BrokenEagle/use-model-counts
User: Use model counts instead of SQL queries
2020-02-18 14:48:58 -06:00
lllusion3469
090671cedf fix leftover reference to Artist.notes 2020-02-18 21:42:52 +01:00
evazion
187565125c Merge pull request #4296 from BrokenEagle/fix-autocomplete-insert-completion
Fix autocomplete insert completion
2020-02-18 14:41:24 -06:00
BrokenEagle
818426cda3 Add cosplay related tags for other wikis
- Queries on *_(cosplay) tags will now also display the base tag.
- Also fixes an issue with list_of_* related wikis.
-- The request errors out if the list_of_* wiki doesn't actually exist.
2020-02-18 02:41:35 +00:00
BrokenEagle
e4ff641c9a Fix autocomplete insert completion
It was removing line returns, even when line returns are important,
such as in the blacklist and frequent tags input fields. Besides those,
it was also causing confusion when editing tags on a post, as those
are divided into categories, but adding an additional tag for a category
at the end of a group causes groups of tags to be combined.
2020-02-18 00:00:58 +00:00
evazion
9c6ef424ef post_flags/index: remove banned and duplicate search options.
Remove options for searching for "Artist requested removal" and
"duplicate" flag reasons. These were legacy flag reasons that haven't
been used for a long time.
2020-02-17 02:13:34 -06:00
evazion
83a0cb0a71 models: refactor class methods into scopes. 2020-02-17 02:10:08 -06:00
evazion
9a8aa1990d notes: clean up note-locked validation. 2020-02-16 23:19:49 -06:00
evazion
7723597675 notes: drop unused undo_changes_by_user method. 2020-02-16 23:10:24 -06:00
evazion
2dab9aa075 models: remove creator_id from artists, notes, and pools.
Remove the creator_id field from artists, notes, and pools. The
creator_id wasn't otherwise used and was inconsistent with the
artist/note/pool history in some cases, especially for old artists.
2020-02-16 23:09:00 -06:00
evazion
207861fd40 api: remove available_includes dependent on current user.
This is to avoid specifying permissions in multiple disjoint places and
because most API users shouldn't need these fields.
2020-02-16 23:07:06 -06:00
evazion
9ef80d7344 post_disapprovals/index: don't show usernames to other users.
* Don't show who disapproved the post to other users. Only show the
  creator to mods or to the disapprover themselves.
* Let unprivileged users see the /post_disapprovals index.
2020-02-16 21:32:06 -06:00
evazion
ff8bfee9eb burs/index: link to forum topic instead of specific post.
Linking to the last post in the thread triggers a COUNT(*) to calculate
the last page.
2020-02-16 19:52:14 -06:00
evazion
5817af4014 burs/show: remove BUR update count estimate.
Remove the post update count estimate from BUR show pages. This was
complex, slow, and usually inaccurate since it assumed that requests in
a BUR had no overlap with each other, which usually wasn't the case.
2020-02-16 19:21:56 -06:00
evazion
c4521acb54 burs/index: format update scripts as dtext, same as forum.
Format scripts on the BUR index page as dtext, the same way they're
formatted in forum posts. This means that tags have colors and underlines,
but they don't have post counts. Gathering post counts was too slow.
2020-02-16 19:20:48 -06:00
evazion
ef3188a7fe artists/edit: refactor editing nested wiki pages.
Refactor to use accepts_nested_attributes_for instead of the notes
attribute to facilitate editing wikis on the artist edit page.

This fixes the notes attribute unintentionally showing up in the API.

This also changes it so that renaming an artist entry doesn't
automatically rename the corresponding wiki page. This had bad behavior
when there was a conflict between wiki pages (the wikis would be
silently merged, which usually isn't what you want). It also didn't warn
about wiki links being broken by renames.
2020-02-16 18:48:41 -06:00
evazion
6f3d0b542c wiki_pages/search: fix title search not allowing wildcards. 2020-02-16 18:48:41 -06:00
evazion
ed702b8854 Fix deprecated keyword argument warnings in Ruby 2.7.
Fix this warning:

    warning: Using the last argument as keyword parameters is
    deprecated; maybe ** should be added to the call.

ref: https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/#delegation
2020-02-16 18:48:41 -06:00