Commit Graph

8432 Commits

Author SHA1 Message Date
evazion
bf6bb94702 Add new IP address search page.
Add a new IP address search page at /ip_addresses. Replaces the old
search page at /moderator/ip_addrs.

On user profile pages, show the user's last known IP to mods. Also add
search links for finding other IPs or accounts associated with the user.

IP address search uses a big UNION ALL statement to merge IP addresses
across various tables into a single view. This makes searching easier,
but is known to timeout in certain cases.

Fixes #4207 (the new IP search page supports searching by subnet).
2019-11-11 21:03:07 -06:00
evazion
2aac42b112 Add show actions for note, artist, artist commentary versions.
Add these endpoints:

* /note_versions/1234
* /artist_versions/1234
* /artist_commentary_versions/1234

This is so the /ip_addresses listing can link to these endpoints.
2019-11-11 12:56:39 -06:00
evazion
9cf5b1f01c dtext: add dtext cheatsheet popup. 2019-11-10 14:48:17 -06:00
evazion
69f005a89c gems: remove cityhash gem.
This gem uses a native extension that requires a C++ compiler to build.
Removing this gem removes the need to have a C++ toolchain to install Danbooru.
2019-11-09 14:42:30 -06:00
evazion
76674597f1 Upgrade to Rails 6.0.1. 2019-11-06 21:57:32 -06:00
evazion
a92c24f093 wiki pages: add undelete link in navbar.
Also redirect back to the wiki page after deleting or undeleting it,
rather than redirecting to the index.
2019-11-06 21:57:32 -06:00
evazion
70b6525e69 wiki pages: fix error when force renaming wiki page.
Bug: force renaming a wiki page fails. Fix: use the wiki page id instead
of the title in the update action.
2019-11-06 21:56:21 -06:00
evazion
19549e2c12 css: fix overlong parent/child preview boxes on post show page.
Bug: if a post had a large number of child posts, the child post preview
box would expand beyond the width of the screen.

Setting `min-width: 0` makes the flexbox column shrink instead of
expand.
2019-11-05 20:58:07 -06:00
evazion
e031fb0400 users: use inline dtext for ban reason on profile page. 2019-11-05 19:15:44 -06:00
evazion
06d0ceb016 dmails: fix bug with parsing wiki links in email notifications.
Bug: sending a dmail containing a wiki link (ex: [[tagme]]) failed when
the recipient had email notifications turned on.

Cause: wiki links inside email notifications use absolute urls, which
the dtext postprocessor didn't parse correctly.
2019-11-05 19:10:41 -06:00
evazion
a653513e0a wiki pages: fix 404s for page titles containing dots.
Bug: links like these returned 404s:

* https://danbooru.donmai.us/wiki_pages/...
* https://danbooru.donmai.us/wiki_pages/.hack//
* https://danbooru.donmai.us/wiki_pages/ssss.gridman

Cause: by default, Rails uses dots in route segments to separate the id
from the format. For example, in /wiki_pages/ssss.gridman, the id is
parsed as "ssss" and the format is "gridman" (as if "gridman" were a
format like "json" or "xml").

We work around this by specifying the regex for the id param manually.
The trick here is to use a non-greedy match-all combined with a positive
lookahead to detect the extension but not include it in the match.
2019-11-05 15:14:08 -06:00
evazion
aeb5edaff6 Fix deadlocks while updating tags counts.
Sometimes uploads fail with this error:

    ActiveRecord::QueryCanceled - PG::QueryCanceled: ERROR: canceling
    statement due to statement timeout CONTEXT: while updating tuple
    (2808,110) in relation "tags"

This is caused by two uploads trying to update tag counts for the same
tags at the same time. The UPDATE statement doesn't guarantee the tags
will be updated in any particular order, which can cause deadlocks when
two UPDATEs try to update the same tags in a conflicting order. For
example, if one process tries to increment '1girl' and 'solo' (in that
order), while at the same time another process tries to increment 'solo'
and '1girl' (in that order), the result will be a deadlock.

The solution is to explicitly lock the tags in a consistent order before
the update statement.
2019-11-05 12:53:52 -06:00
evazion
a677c3ff1f /posts: fix link to wiki in wiki excerpt. 2019-11-04 18:53:08 -06:00
evazion
a418ed7281 post tooltips: use more compact timestamps.
* Use more compact timestamps in post tooltips ("39 minutes ago" -> "39m ago")
* Move timestamps to the right (after favcount + score).
* Switch favorite icon from star to heart.
2019-11-04 18:18:56 -06:00
evazion
c1939f78d6 artists: replace /artists/banned endpoint with simple search. 2019-11-04 17:15:02 -06:00
evazion
db01696e91 artist: fix /artists?name=<name> search. 2019-11-04 17:11:24 -06:00
evazion
d7233b3c39 implications: remove duplicate scopes.
These are already defined in tag_relationship.rb.
2019-11-04 16:50:52 -06:00
evazion
90fef76121 artists: reorganize index page.
* Make other names searchable.
* Add post count and update timestamp.
* Add edit / delete / undelete links.
2019-11-04 16:45:19 -06:00
evazion
75ca53a9a1 autocomplete: fix underscore-to-space conversion in usernames.
Didn't handle names with multiple underscores correctly.
2019-11-04 15:45:07 -06:00
evazion
623de37b09 views: remove current user <meta> elements from <head>.
Previously deprecated. Use the data attributes on the <body> tag
instead.
2019-11-04 15:42:19 -06:00
evazion
02b9acac9e wiki pages: replace show_or_new page with redirects.
* Redirect the show_or_new action to either the show page or the new
  page. Don't use show_or_new to render nonexistent wikis; do that in the
  regular show action instead.

* Make the show action return 404 for nonexistent wikis.
2019-11-04 15:35:47 -06:00
evazion
6e5e07022d Have single result searches go to the show pages for certain controllers #4204 2019-11-04 14:24:10 -06:00
evazion
953de62d70 Update dtext gem. 2019-10-31 22:23:50 -05:00
evazion
9b9afff8c8 wiki pages: remove unused noredirect=1 from /wiki_pages index. 2019-10-31 19:06:39 -05:00
evazion
3a908f84bb wiki pages: use names instead of ids in urls.
Switching to using wiki names in URLs instead of IDs:

* https://danbooru.donami.us/wiki_pages/vocaloid
* https://danbooru.donami.us/wiki_pages/hatsune_miku

ID numbers can still be used, but they redirect to the name instead:

* https://danbooru.donami.us/wiki_pages/11 (redirects to /wiki_pages/touhou).

Numeric tags are prefixed with '~' to distinguish them from IDs:

* https://danbooru.donami.us/wiki_pages/2019 (the wiki with id 2019)
* https://danbooru.donami.us/wiki_pages/~2019 (the wiki for the tag named 2019)

The tag names 'new' and 'search' are disallowed to prevent conflicts
with existing routes:

* https://danbooru.donami.us/wiki_pages/new
* https://danbooru.donami.us/wiki_pages/search
2019-10-31 19:04:18 -05:00
evazion
0ccfb3f5f6 wiki pages: fix error in new controller action. 2019-10-31 19:04:18 -05:00
evazion
9826776e66 Remove unused dtext/help template. 2019-10-31 19:04:18 -05:00
evazion
5422db1c3c Standardize links to wiki help pages.
* Fix inconsistencies in how wiki pages were linked.

* Link directly to the wiki instead of to a title search that is expected
  to redirect to the wiki.
2019-10-31 19:04:18 -05:00
evazion
a8fc2ba508 wiki pages: fix redirects to exact matches during search.
Change wiki page search to redirect to exact matches only when using the
quick search bar. Fixes searches sometimes unexpectedly redirecting when
doing a regular (non-quick) search that happens to return a single result.

Also remove the logic that tries to expand the search when no results
are found. This will eventually be replaced with a smarter "did you mean?"
search.
2019-10-31 19:04:18 -05:00
evazion
91fd5e1bff js: add "ctrl+enter to submit form" shortcut.
Press Ctrl+Enter inside any text box to submit the form.
2019-10-31 00:27:43 -05:00
evazion
9cfb753c1b post tooltips: fix null deref when tooltips are disabled.
Fix an exception that is triggered by mousing out of a thumbnail when
tooltips are disabled. Caused by trying to access `qtip.cache` when
`qtip` is null.
2019-10-30 23:43:52 -05:00
evazion
bf841dcd44 gems: update gems. 2019-10-30 23:34:52 -05:00
evazion
2821559221 gems: drop term-ansicolor gem. 2019-10-30 23:32:28 -05:00
evazion
55a2c6de2b user feedbacks: reorganize index page.
* Move search form to index page instead of a separate page.
* Merge creator + timestamp into one column.
* Add category column.
* Fix N+1 query issue.
2019-10-30 23:29:24 -05:00
evazion
1f191d2cdf bans: list long bans as 'forever'. 2019-10-30 23:29:24 -05:00
evazion
64881d8840 bans: merge banner name + timestamp into one column. 2019-10-30 23:29:19 -05:00
evazion
f4b3d4e075 mod actions: reorganize index page.
* Add category column. Allow filtering by category.
* Merge user + timestamp into one column.
2019-10-30 23:29:13 -05:00
evazion
f865cd8aeb modqueue: bump "You haven't moderated any posts..." notice to 72 hours. 2019-10-30 10:49:14 -05:00
evazion
4f858384bb dark mode: make header elements brighter. 2019-10-28 21:57:49 -05:00
evazion
b19d2d3934 Add dependabot config. 2019-10-28 21:37:34 -05:00
evazion
f075e63573 Merge pull request #4200 from r888888888/dependabot/npm_and_yarn/jquery-3.4.1
build(deps): bump jquery from 3.3.1 to 3.4.1
2019-10-28 21:28:09 -05:00
evazion
e4787229fd Merge pull request #4202 from r888888888/dependabot/npm_and_yarn/fstream-1.0.12
build(deps): bump fstream from 1.0.11 to 1.0.12
2019-10-28 21:27:50 -05:00
evazion
18201948ea Merge pull request #4201 from r888888888/dependabot/npm_and_yarn/eslint-utils-1.4.3
build(deps): bump eslint-utils from 1.4.0 to 1.4.3
2019-10-28 21:27:03 -05:00
dependabot[bot]
2cfcd96639 build(deps): bump fstream from 1.0.11 to 1.0.12
Bumps [fstream](https://github.com/npm/fstream) from 1.0.11 to 1.0.12.
- [Release notes](https://github.com/npm/fstream/releases)
- [Commits](https://github.com/npm/fstream/compare/v1.0.11...v1.0.12)

Signed-off-by: dependabot[bot] <support@github.com>
2019-10-29 01:15:07 +00:00
dependabot[bot]
32d39dc248 build(deps): bump eslint-utils from 1.4.0 to 1.4.3
Bumps [eslint-utils](https://github.com/mysticatea/eslint-utils) from 1.4.0 to 1.4.3.
- [Release notes](https://github.com/mysticatea/eslint-utils/releases)
- [Commits](https://github.com/mysticatea/eslint-utils/compare/v1.4.0...v1.4.3)

Signed-off-by: dependabot[bot] <support@github.com>
2019-10-29 01:15:04 +00:00
dependabot[bot]
df8abeeef0 build(deps): bump jquery from 3.3.1 to 3.4.1
Bumps [jquery](https://github.com/jquery/jquery) from 3.3.1 to 3.4.1.
- [Release notes](https://github.com/jquery/jquery/releases)
- [Commits](https://github.com/jquery/jquery/compare/3.3.1...3.4.1)

Signed-off-by: dependabot[bot] <support@github.com>
2019-10-29 01:15:00 +00:00
evazion
ee96a696f0 bulk update requests: fix attaching bur to existing topic.
ref: https://danbooru.donmai.us/forum_topics/16411
2019-10-28 20:13:12 -05:00
evazion
e3dea024ae dtext: bump version (fix case sensitivity in [expand] tags). 2019-10-28 19:59:15 -05:00
evazion
68c74ed9d8 tests: fixup post votes, comment votes controller tests. 2019-10-28 16:52:02 -05:00
evazion
4bb1bdbe10 dtext: handle [bur:<id>] tags in main parser.
Move the parsing for the [bur:<id>], [ta:<id>], [ti:<id>] pseudo tags to
the main parser in `DText.format_text`. This fixes a bug where wiki
links inside bulk update requests on the forum weren't properly
colorized because the text of the BUR was embedded after we scanned for
wiki links, not before.

This also ensures that tags inside bulk update requests will be recorded
in the dtext_links table, meaning that forum posts can be properly
searched by tags.

This incidentally means that these request pseudo tags can now be used
outside the forum.
2019-10-28 16:40:38 -05:00