Commit Graph

8418 Commits

Author SHA1 Message Date
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
evazion
6424a4de74 Do full page counts on small index pages.
Normally we skip doing page counts on index pages when there aren't any
search filters. This is on the assumption that most index pages have
more than 1000 pages (20,000 results), so it's not worth counting them
exactly. This isn't always true, so here we turn on full counts on
certain index pages known to be small.
2019-10-28 15:18:54 -05:00
evazion
fd4a9d4d30 post/comment/forum votes: add vote counts to profile pages.
* Add post/comment/forum vote counts to user profiles.
* Show uploaders on post votes index and allow searching by uploader.
* Show forum posters on forum votes index and allow searching by poster.
* Add unvote link to forum votes index.
* Only show unvote links to current user.
2019-10-28 14:46:16 -05:00
evazion
d3165f78aa comment votes: add index page. 2019-10-28 14:12:40 -05:00
evazion
93b03c04ad post votes: let gold users use upvote:self, downvote:self metatags.
* Let gold users use upvote:self, downvote:self metatags to search for
  their own votes.
* Don't let mods use upvote:<user>, downvote:<user> metatags to see
  votes by other users. Only let admins see other users' votes.
* Add vote count to profile page.
2019-10-28 03:45:26 -05:00
evazion
f4376fc7a3 post votes: add index page. 2019-10-28 03:21:18 -05:00
evazion
754e3a2ee2 tests: fix forum post votes & wiki page updater tests.
* Move forum post vote tests from test/controllers to test/functional.
* Fix forum post vote tests to work with new routes.
* Fix obsolete wiki page tests dealing with updater_id.
2019-10-28 02:13:10 -05:00
evazion
dfbf4f3f0a Remove single alias/implication requests.
* Remove the single alias and implication request forms. From now
  on, bulk update requests are the only way to request aliases or
  implications.

* Remove the forum topic ID field from the bulk update request form.
  Instead, to attach a BUR to an existing topic you go to the topic then
  you click "Request alias/implication" at the top of the page.

* Update the bulk update request form to give better examples for the
  script format and to explain the difference between aliases and
  implications.
2019-10-28 01:36:28 -05:00
evazion
b5a40aa233 bulk update requests: list upvotes/downvotes on index page. 2019-10-28 01:06:23 -05:00
evazion
0e159960a2 forum post votes: add index page. 2019-10-28 01:06:23 -05:00
evazion
d617b20b49 dtext links: allow searching for forum posts linking to specific tag. 2019-10-27 01:05:54 -05:00
evazion
d946a84480 iqdb: download files inside danbooru, not inside iqdb.
Instead of sending IQDB the image url and letting it download the file,
download the file on Danbooru's end and send IQDB the downloaded file.

This fixes several issues:

* Some sites need the referer header set to avoid hotlink protection
  when downloading the file. Danbooru knows how to deal with this but
  IQDB doesn't.

* We need to enforce certain restrictions when downloading files,
  including setting max filesize limits, setting max timeouts, and not
  allowing downloads from forbidden IPs (to avoid SSRF attacks).
  Danbooru knows how to handle these things but IQDB doesn't.
2019-10-26 15:02:07 -05:00
evazion
a6efaa54a1 Downloads::File: fix following 302 redirects during download.
Fixes downloading yande.re preview images for iqdb. Yande.re previews
return a 302 redirect to the actual file. Before the html in the body of
the 302 response would get prepended to the image file.

https://files.yande.re/data/preview/12/8f/128fb480d8589be26d1dce7e1d841bcb.jpg
=> https://assets.yande.re/data/preview/12/8f/128fb480d8589be26d1dce7e1d841bcb.jpg
2019-10-26 14:04:19 -05:00
evazion
a15bbe4264 moebooru: fix preview_urls to fallback to image_urls.
Fix the moebooru strategy to fallback to returning the image url if we
can't find the preview url. Fixes iqdb lookups failing in some cases
because the strategy didn't return a valid url for preview_url.
2019-10-26 13:51:58 -05:00
evazion
ecfeaca7d4 iqdb: fix handling of error responses.
Handle JSON error responses returned by IQDB: `{ "error": <message> }`.
2019-10-26 13:01:08 -05:00