Commit Graph

3404 Commits

Author SHA1 Message Date
evazion
cf13ab1540 autocomplete: render html server-side.
Render the HTML for autocomplete results server-side instead of in
Javascript. This is cleaner than building HTML in Javascript, but it may
hurt caching because the HTTP responses are larger.

Fixes #4698: user autocomplete contains links to /posts

Also fixes a bug where tag counts in the autocomplete menu were different
from tag counts displayed elsewhere because of differences in rounding.
2022-08-30 01:26:02 -05:00
evazion
18c949ff34 Fix #5208: The posts version of create or update artist commentary endpoint does not work without the post ID parameter being passed in the body
Fix /posts/:post_id/artist_commentary/create_or_update not working
without passing `artist_commentary[post_id]` in the form body.
2022-08-25 21:50:33 -05:00
evazion
28ee901192 Fix #5211: Using tab to autocomplete tags in tag implication/alias search adds a space making it return no results.
Fix the alias and implication search forms not normalizing tags before search.
2022-08-24 22:01:03 -05:00
evazion
c2597ff299 Fix #5231: "Reason is too long" notice does not appear when editing an appeal 2022-08-24 14:29:19 -05:00
evazion
d01b3c0637 wiki pages: remove /wiki_pages/search page.
This page is unnecessary since you can already search wiki pages from the /wiki_pages listing.
2022-08-24 14:27:47 -05:00
evazion
bccd1bf8a3 wiki pages: add option to search for locked wiki pages. 2022-08-24 14:27:47 -05:00
evazion
2350362183 uploads: add ability to search your uploads by AI tags.
Add ability to search your unposted uploads using AI tags. Like with
media assets, only basic tags are supported (no metatags) and complex
multi-tag searches will probably be slow.

The default AI tag confidence threshold is 50%. There's a hidden
search[min_score] URL param that lets you change this.
2022-07-06 02:01:09 -05:00
evazion
d7e08d1313 media assets: add ability to search by AI tags.
Add ability to search the /media_assets index by AI tags. Multi-tag
searches are supported, including AND/OR/NOT operators, but metatags
aren't supported. Multi-tag searches will probably be slow.

The default AI tag confidence threshold is 50%. There's a hidden
search[min_score] URL param that lets you change this.
2022-07-06 01:38:41 -05:00
evazion
ba36e48bff jobs: fix no method error in /jobs.
Broken by the upgrade to good_job 3.0.
2022-07-05 00:54:38 -05:00
evazion
9000fa63bc related tags: fix AI tags not showing rating tags.
* Fix the suggested tags list in the related tags box not showing rating tags.
* Fix the suggested tags list showing tags that have been aliased to another tag.
2022-07-02 19:05:12 -05:00
evazion
0d953e2492 related tags: add AI tags to related tags section.
Add a Suggested tags list to the Related Tags box. The suggested tags
are just the AI tags for the post.

Suggested tags are currently hidden in CSS for beta testing. Use custom
CSS to unhide them.
2022-07-02 05:29:59 -05:00
evazion
c0c435da21 commentaries: remove unused search page template.
Remove file forgotten in 907194fc6.
2022-06-27 19:40:09 -05:00
evazion
2c45eb0aad ai tags: don't show add/remove tag buttons on unposted assets.
It's not possible to add or remove tags on unposted media assets, so
don't show the buttons in this case.
2022-06-27 19:37:03 -05:00
evazion
6a08c57cec ai tags: fix N+1 query issue. 2022-06-27 02:37:49 -05:00
evazion
c199c7eab7 ai tags: adjust thumbnail layout. 2022-06-26 20:37:35 -05:00
evazion
efe0e8a6bd ai tags: default to showing only posts, not media assets.
Change the /ai_tags page to show only posts by default, not both posts
and unposted media assets mixed together. Showing media assets tended to
confuse users about why they couldn't add tags to these images. It also
distracted from the page's primary use case, which is gardening posts.
2022-06-26 20:37:35 -05:00
evazion
8f2774075a ai tags: disable "Add" button if user doesn't have permission to edit the post.
Disable the "Add" button on the /ai_tags page when the current user doesn't have
permission to edit the post, for example if they're not logged in.
2022-06-26 20:37:35 -05:00
evazion
e5879f0def ai tags: add buttons for quickly adding and removing tags on the /ai_tags page.
Add "Add" and "Remove" buttons beneath thumbnails on the /ai_tags page.
These let you add the tag to the post if it's correct, or remove it if
it's wrong.
2022-06-26 00:43:57 -05:00
evazion
97ba21e615 ai tags: add ability to order /ai_tags page by confidence. 2022-06-25 21:51:14 -05:00
evazion
d3267a5ffa user upgrades: fix button when upgrades are disabled. 2022-06-24 15:14:18 -05:00
evazion
bec9e5a5d9 ai tags: fix broken "Unposted" link on /ai_tags page. 2022-06-24 08:42:40 -05:00
evazion
de261bc321 ai tags: enable filtering by unposted media assets.
Enabled filtering by posted media assets on the /ai_tags page. This was
disabled in development because it was too slow, but seems to be fine in
production.
2022-06-24 08:35:39 -05:00
evazion
2adffb4f92 ai tags: fix broken links to unposted media assets.
Fix thumbnails on the /ai_tags page not linking to media assets correctly.
2022-06-24 08:33:07 -05:00
evazion
1aeb52186e Add AI tag model and UI.
Add a database model for storing AI-predicted tags, and add a UI for browsing and searching these tags.

AI tags are generated by the Danbooru Autotagger (https://github.com/danbooru/autotagger). See that
repo for details about the model.

The database schema is `ai_tags (media_asset_id integer, tag_id integer, score smallint)`. This is
designed to be as space-efficient as possible, since in production we have over 300 million
AI-generated tags (6 million images and 50 tags per post). This amounts to over 10GB in size, plus
indexes.

You can search for AI tags using e.g. `ai:scenery`. You can do `ai:scenery -scenery` to find posts
where the scenery tag is potentially missing, or `scenery -ai:scenery` to find posts that are
potentially mistagged (or more likely where the AI missed the tag).

You can browse AI tags at https://danbooru.donmai.us/ai_tags. On this page you can filter by
confidence level. You can also search unposted media assets by AI tag.

To generate tags, use the `autotag` script from the Autotagger repo, something like this:

  docker run --rm -v ~/danbooru/public/data/360x360:/images ghcr.io/danbooru/autotagger ./autotag -c -f /images | gzip > tags.csv.gz

To import tags, use the fix script in script/fixes/. Expect a Danbooru-size dataset to take
hours to days to generate tags, then 20-30 minutes to import. Currently this all has to be done by hand.
2022-06-24 04:54:26 -05:00
evazion
06f75c39a1 footer: remove app name and 2257 link. 2022-06-06 01:00:02 -05:00
evazion
ca289d869c Merge pull request #5199 from NamelessContributor/patch-1
Add back social icons to site footer.
2022-06-05 15:56:53 -05:00
evazion
907194fc6f commentaries: move search form to /artist_commentaries page.
* Move the commentary search form to the /artist_commentaries page.
* Add Order field for changing the sort order.
2022-06-05 14:28:44 -05:00
NamelessContributor
6e8b43bd69 Add back social icons to site footer.
Revert 1720246cb9 and f668cfdbac
2022-06-03 16:30:38 +02:00
evazion
ea92cbff4e user upgrades: update upgrade page text. 2022-06-02 14:40:42 -05:00
evazion
434e44ba8b Merge pull request #5197 from nonamethanks/fix-bur-links
BURs: don't allow edits to approved scripts
2022-06-01 18:37:09 -05:00
evazion
173e43b192 user upgrades: add upgrade code system.
Add a system for upgrading accounts using upgrade codes. Users purchase
an upgrade code off-site then redeem it on-site to upgrade their account
to Gold. Upgrade codes are randomly pre-generated and are one time use
only. Codes have enough randomness that guessing a code is infeasible.
2022-06-01 18:31:46 -05:00
nonamethanks
5932d8d3a3 BURs: don't allow edits to approved scripts
Also fix bad formatting for non-admins in BUR index
2022-06-01 14:07:30 +02:00
evazion
81bd86d202 posts: add "general" rating; rename "safe" rating to "sensitive".
* Add "general" rating.
* Rename "safe" rating to "sensitive".
* Change safe mode to include both rating:s and rating:g.
* Treat rating:safe as a synonym for rating:sensitive.
* Link "howto:rate" in the post edit form.
2022-05-22 13:38:45 -05:00
evazion
c6b5be1c9f Update Danbooru logo. 2022-05-22 02:53:22 -05:00
evazion
276850d2b1 Update Danbooru logo. 2022-05-21 21:39:44 -05:00
evazion
e7c507b7fc css: adjust spacing around header on mobile. 2022-05-21 14:57:49 -05:00
evazion
d89db73c2f Add site logo to header. 2022-05-21 13:30:21 -05:00
evazion
1e78b97eb8 Add config options to disable comments and the forum.
Add options to disable comments, the forum, and autocomplete. This is
for personal boorus and potentially for safe mode. Note that disabling
the forum may cause difficulties with creating and approving BURs.

Disabling comments and the forum merely hides them from most areas,
rather than completely removing them.
2022-05-18 14:45:40 -05:00
evazion
141044d352 posts: refactor hardcoded ratings.
Refactor ratings to not be hardcoded in various places. Make it so
all ratings are defined in Post::RATINGS.

Also make it so that you can search multiple ratings at once with `rating:q,e`.
2022-05-18 13:04:15 -05:00
evazion
8239a1b551 upgrades: fix Danbooru.config.user_upgrades_enabled? setting
* Fix it so that if upgrades are disabled, only the payment button is disabled instead of the whole page.
* Fix it so that disabling upgrades with DANBOORU_USER_UPGRADES_ENABLED="false" works.
2022-05-17 01:24:38 -05:00
evazion
1ea76624c8 Merge pull request #5172 from nonamethanks/sort-relationships
Tags: sort list of relationships alphabetically
2022-05-16 15:11:58 -05:00
nonamethanks
c97dd8958f Tags: sort list of relationships alphabetically 2022-05-16 13:08:11 +02:00
evazion
1eb15da7c5 upgrades: add authorize.net integration.
Add integration for accepting payments with Authorize.net.

https://developer.authorize.net/hello_world.html
2022-05-15 01:47:45 -05:00
evazion
6de527f064 upgrades: show login and create account links for anon users. 2022-05-15 01:05:21 -05:00
evazion
39a9c7efa0 Merge pull request #5164 from nonamethanks/tag-deprecation-edit-form
Tags: show better message in edit form if tag lacks wiki
2022-05-11 21:00:26 -05:00
nonamethanks
4eb579ebe4 Tags: show better message in edit form if tag lacks wiki 2022-05-11 20:52:55 +02:00
NamelessContributor
f668cfdbac Add back current commit hash to site footer.
The commit hash is shown when hovering over the app name in the footer.
2022-05-11 14:56:13 +02:00
evazion
7573c6dfc9 Merge pull request #5160 from NamelessContributor/feat-data-is-deprecated
Add data-is-deprecated attribute to tags
2022-05-11 00:10:13 -05:00
evazion
4360573af0 upgrades: update text. 2022-05-10 12:20:11 -05:00
NamelessContributor
c762e3ddbc Add data-is-deprecated attribute to tags
Allows using custom CSS to highlight deprecated tags, fixes #5110
2022-05-10 17:17:15 +02:00