Commit Graph

9647 Commits

Author SHA1 Message Date
evazion
bfc31acbed artists: fix accidental gentag category changes.
Bug: if you created an artist with the name of an existing general tag,
then the gentag would be changed to an artist tag, no matter how big the
gentag was.

Now we only allow creating artist entries for non-artist tags if the tag
is empty.

Ref: https://danbooru.donmai.us/forum_topics/17095
2020-07-07 12:47:18 -05:00
evazion
1cef3bf805 tests: fix artstation download tests.
ArtStation is apparently returning images with smaller filesizes for
/4k/ images now. It doesn't look like we can get the old images, so just
update the tests.
2020-07-06 17:23:53 -05:00
evazion
7dfc783f2c Fix #4537: Forum quoting broken in topics where user has a reply. 2020-07-06 16:02:19 -05:00
evazion
40a114c99c posts: restrict banned paid rewards for non-approvers. 2020-07-06 13:52:57 -05:00
evazion
0c7d48d890 posts: autoban uploads tagged paid_reward. 2020-07-06 13:52:46 -05:00
evazion
722bb6deae Merge pull request #4486 from danbooru/feat-privacy-policy
Add new privacy policy
2020-07-06 02:56:30 -05:00
evazion
e18c258be5 Rewrite Terms of Service (fix #4415). 2020-07-06 02:55:57 -05:00
evazion
b5fc8fff6e Add privacy policy (#4415). 2020-07-06 02:53:01 -05:00
evazion
f0a573e1e5 /comments.atom: fix restricted posts being leaked.
Fix thumbnail URLs of loli/shota/banned posts being leaked in
/comments.atom. Restricted posts are now entirely hidden in
/comments.atom.

Example: https://danbooru.donmai.us/comments.atom?search[post_id]=2.
2020-07-06 02:51:30 -05:00
evazion
d9b7879a4c html: add <meta name="theme-color"> tag.
Make the address bar blue on mobile.

* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name/theme-color
* https://developers.google.com/web/fundamentals/design-and-ux/browser-customization#meta_theme_color_for_chrome_and_opera
2020-07-05 11:26:26 -05:00
evazion
89c1c927ee html: add <meta charset="utf-8"> tag.
ref: https://webhint.io/docs/user-guide/hints/hint-meta-charset-utf-8/
2020-07-04 22:31:18 -05:00
evazion
9a03582513 Add OpenSearch suggestion support.
Add autocomplete support when searching Danbooru from the Chrome address
bar. If you type "danb<tab>" in the address bar then search for a tag,
then autocomplete results from Danbooru will appear as search
suggestions in Chrome.

Note that the "Autocomplete searches and URLs" Chrome setting must be
enabled for this to work.

Ref:

* http://dev.chromium.org/tab-to-search
* https://developer.mozilla.org/en-US/docs/Archive/Add-ons/Supporting_search_suggestions_in_search_plugins
* https://github.com/dewitt/opensearch/blob/master/mediawiki/Specifications/OpenSearch/Extensions/Suggestions/1.1/Draft%201.wiki
2020-07-04 17:52:53 -05:00
evazion
aa1a21aece Add OpenSearch support (/opensearch.xml).
Add https://danbooru.donmai.us/opensearch.xml. This file tells browsers
how to perform searches on Danbooru.

In Chrome, this lets you type "danb<tab>" in the address bar to perform
a search on Danbooru.

In Firefox, you have to click the "..." icon next to the address bar,
then choose "Add Search Engine". After that, you can search Danbooru
from the address bar.

Ref:

* http://dev.chromium.org/tab-to-search
* https://developer.mozilla.org/en-US/docs/Web/OpenSearch
* https://github.com/dewitt/opensearch/blob/master/opensearch-1-1-draft-6.md
* https://en.wikipedia.org/wiki/OpenSearch
2020-07-04 17:52:49 -05:00
evazion
b6b0218e1d seo: update JSON-LD site metadata.
* Add the Danbooru logo and social media links to the Organization data.
  This is to make Danbooru eligible for Google's knowledge panel ([1], [2]).
* Only include this metadata on the frontpage as per Google's recommendations ([3]).

[1]: https://support.google.com/knowledgepanel/answer/9163198
[2], https://developers.google.com/search/docs/data-types/logo
[3]: https://developers.google.com/search/docs/data-types/sitelinks-searchbox
2020-07-03 18:18:35 -05:00
evazion
a0ee4c67a8 Add lang="en" to <html> tag. 2020-07-03 15:59:45 -05:00
evazion
99e88b3dae seo: add rel=nofollow to various internal search links.
Add rel=nofollow to various internal search links to prevent Google from
attempting to crawl things like `<tag> status:deleted` or `approver:<name>`
searches.
2020-07-03 15:58:59 -05:00
evazion
629a634b22 seo: don't block css in robots.txt.
/packs was blocked by robots.txt, which prevented Googlebot from
fetching CSS when indexing pages, which made Google penalize pages for
being mobile unfriendly because it couldn't load the CSS and it thought
the layout was broken.
2020-07-03 15:58:59 -05:00
evazion
f97c62c71d search: fix search timeout error page not appearing.
Bug: when a search timed out we got the generic failbooru page instead
of the search timeout error page.

Cause: when rendering the <link rel="next"> / <link rel="prev"> tags in
the header, we may need to evaluate the search to determine the next or
previous page, but if the searches times out then this fails, which
caused Rails to throw a ActionView::Template::Error because an exception
was thrown while rendering the template.

Likewise, rendering the attributes for the <body> tag could fail with an
ActionView::Template::Error because the call to `current_item.present?`
forced evaluation of the search.
2020-07-03 13:08:49 -05:00
evazion
e822d5f16e tests: fix invalid artist url test. 2020-07-03 12:06:12 -05:00
evazion
57dcd9ee1a Remove unused gems and yarn packages. 2020-06-30 23:44:03 -05:00
evazion
1760d1fc73 js: upgrade jquery to 3.5.1.
Changelog:

* https://blog.jquery.com/2020/05/04/jquery-3-5-1-released-fixing-a-regression/
* https://blog.jquery.com/2020/04/10/jquery-3-5-0-released/
2020-06-30 23:42:37 -05:00
evazion
efe5111a9e js: bundle jQuery with Webpack.
Include jQuery in our Webpack bundle instead of loading it from CDNJS.
This means we no longer load any Javascript libraries from third party
sites.
2020-06-30 23:41:47 -05:00
evazion
94490eb57f Fix #4492: Switch from qtip2 to tippy.js. 2020-06-30 22:40:40 -05:00
evazion
5f05a41fbc Fix #4468: Tag edit mode on posts view applies taglist to wrong post. 2020-06-30 15:20:59 -05:00
evazion
1a8729e0d9 Fix #4462: "You have already favorited this post" on upload.
Make adding the fav:self metatag ignore all errors, including when the
post was already favorited before editing the post.
2020-06-30 14:29:25 -05:00
evazion
048bc7faf5 Revert "simple form: enable HTML5 maxlength validations."
This incorrectly added maxlength=4 to parent id fields.

This reverts commit 5e23861bea.
2020-06-30 13:03:51 -05:00
evazion
fde6e39213 Update ruby gems and yarn packages. 2020-06-29 17:46:28 -05:00
evazion
3d90414e06 Merge pull request #4487 from BrokenEagle/fix-invalid-url
Fix invalid artist URLs being allowed
2020-06-29 17:46:13 -05:00
evazion
f5c9a78797 danbooru::http: fix SSLError exceptions not being caught.
Bug: The frontpage failed due to a SSL error. We couldn't fetch the
popular tag list from Reportbooru because Reportbooru's SSL certificate
had expired and HTTP.rb raised an SSLError exception that we didn't
catch.

Fix: Convert the SSLError to a 5xx HTTP error to prevent SSL exceptions
from leaking through HTTP.rb.
2020-06-29 14:49:59 -05:00
evazion
b85b4b190a pagination: remove switch_to_sequential option. 2020-06-28 02:59:32 -05:00
evazion
ad02b26f3d pagination: fix exception on empty pages in seq. pagination.
Fix exception when the page is empty during sequential pagination.
Caused because the paginator can't figure out the next or previous page
when the current page is empty.

* https://danbooru.donmai.us/posts?page=b0
* https://danbooru.donmai.us/posts?page=a10000000
2020-06-28 02:57:48 -05:00
evazion
cc73f2468b disapprovals: don't dmail uploaders about disapprovals.
Remove sending dmail notifications to uploaders when an upload is
disapproved. These messages are usually confusing and frustrating to
uploaders. They don't know who is sending them and they usually feel
insulted when they get negative messages from anonymous users.
2020-06-28 01:51:41 -05:00
evazion
136bb9d8ae ci: fix codecov.io uploader not working.
We need to check out the full repo so the codecov.io uploader can detect
the branch and commit hash.
2020-06-27 20:26:48 -05:00
evazion
580211ee64 seo: fix canonical tags on post index and show page.
* Fix incorrect canonical tags. Before we were using
  `<meta name="canonical" content="...">`. This is wrong, it should have been
  `<link rel="canonical" href="...">`.

* Add a default canonical tag on all pages. Fixes Google treating the
  same content on different subdomains (safebooru, shima, kagamihara, etc)
  as duplicate content. Also fixes Google sometimes treating similar but
  distinct content on the same domain as duplicate content.
2020-06-27 19:54:11 -05:00
evazion
c739e2b226 seo: allow crawling /posts up to page 50. 2020-06-27 18:10:14 -05:00
evazion
e2ec015603 seo: index frontpage, images, and legacy redirects. 2020-06-27 18:09:02 -05:00
evazion
63ca421f3e comments: fix exception in /comments/new page.
Fix regression from 804a2ef9a.
2020-06-27 13:05:36 -05:00
evazion
6020277608 Update simplecov gem. 2020-06-27 13:03:04 -05:00
evazion
09dff5b929 ci: track coverage with codecov.io instead of codeclimate.com.
Comparison:

* Codecov has a simpler integration and a better UI.
* Codeclimate tracks both linter warnings (Rubocop, ESLint) and code
  coverage, but its UI for code coverage is worse than Codecov's.
* Codeclimate doesn't support Simplecov 0.18 because Codeclimate doesn't
  support 0.18's new coverage format yet.
2020-06-27 13:01:35 -05:00
evazion
da40a1cb73 Fix #4463: Missing link to recent changes in pools' topbar. 2020-06-27 02:18:33 -05:00
evazion
24e299cf93 api: add /explore/posts/searches.json, /explore/posts/missed_searches.json. 2020-06-27 02:09:51 -05:00
evazion
dd857c6695 popular searches: fix blank search counts on /explore/posts/searches. 2020-06-27 02:09:09 -05:00
evazion
ff096b8adc Fix #4508: Specific tag not showing a wiki.
Fix the wiki excerpt not appearing when searching for a tag that doesn't
exist in the tag list. This could happen if someone created a wiki for a
tag that has never been used on a post.
2020-06-27 02:01:34 -05:00
evazion
f06e322dc0 Fix #4507: Clicking "View wiki" on Artists with no wiki redirects to the posts page. 2020-06-27 01:20:05 -05:00
evazion
3a6e4732bf Fix #4511: Remove delete/undelete controls from the artist index.
* Only show the delete artist button on the artist edit page.
* Only show the delete pool button on the pool edit page.
* Only show the delete wiki button on the wiki edit page.
2020-06-27 00:45:29 -05:00
evazion
f7f72e29b5 Fix #4458: Duplicate HTML IDs on post show page. 2020-06-26 14:59:30 -05:00
evazion
804a2ef9a5 Fix #4535: Comment edit forms contain duplicate IDs.
Prefix comment form IDs with `post_<id>_comment_<id>` to ensure
uniqueness.
2020-06-26 14:57:19 -05:00
evazion
5e23861bea simple form: enable HTML5 maxlength validations.
Makes it so that models that have maximum length validations will add
maxlength attributes to form fields. This includes flag reasons, appeal
reasons, and forum topic titles.

Partially fixes #4519 (Add "n/m characters remaining" character counter to the appeal reason).

https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/maxlength
2020-06-25 16:28:18 -05:00
evazion
883856d4af simple form: refactor DText form fields to use SimpleForm.
* Refactors DText form fields to use a custom SimpleForm input instead
  of manually generated html. This fixes it so that DText fields use the
  same markup as normal SimpleForm fields, which lets us apply browser
  maxlength validations to DText input fields.

* Fixes autocomplete for @-mentions only working in comments and forum posts.
  Now @-mention autocomplete works in all DText fields, including dmails.
  Known bug: it applies in artist commentary fields when it shouldn't.
2020-06-25 16:28:09 -05:00
evazion
fccdcbe7cc simple form: regenerate config with new defaults.
Regenerated with `bin/rails generate simple_form:install`.
2020-06-25 16:28:09 -05:00