Commit Graph
10169 Commits
Author SHA1 Message Date
evazion 327deb9cbb tests: fix regression in 6d867de20.
6d867de20 caused an exception in the ApiKeysController, which calls
respond_with with two arguments: `respond_with(CurrentUser.user, @api_key)`.
`options[0]` referred to the second argument, which was incorrect.
2021-02-05 03:33:07 -06:00
evazion 620c9e9ac9 Fix #4697: Better UX for disabling tooltips. 2021-02-05 02:37:02 -06:00
evazion 1f637867a4 tags: refactor tag lists to use ViewComponent. 2021-02-05 02:37:02 -06:00
evazion 9d60046f1d tests: fixup typo in 520b72948. 2021-02-04 00:41:14 -06:00
evazion 891aa8b458 Merge pull request #4671 from BrokenEagle/fix-note-nudge
Fix the note nudge on rotated notes
2021-02-04 00:38:14 -06:00
evazion 19db959894 Merge pull request #4674 from BrokenEagle/add-missing-associated-attributes
Add missing associated attributes
2021-02-04 00:37:32 -06:00
evazion 96ed242dea Merge pull request #4673 from BrokenEagle/fix-new-twitter-artist
Add the Twitter name to the list of other names for new artists
2021-02-04 00:35:53 -06:00
evazion 3e9184ff1e Merge pull request #4693 from nonamethanks/fix-4692
Post sidebar: ignore metatags for the tag history link
2021-02-04 00:34:16 -06:00
evazion 7da2651074 Merge pull request #4684 from AkiaCode/patch-1
Update LICENSE
2021-02-04 00:33:44 -06:00
evazion 061ce15a0a Merge pull request #4694 from bipface/fix-docker-config
fix docker config
2021-02-04 00:33:32 -06:00
evazion 410a37ec80 tests: fix ip geolocation test. 2021-02-04 00:20:52 -06:00
evazion 4c0c3360e7 Fix #4689: Remove 7 day waiting period for new uploaders. 2021-02-04 00:20:52 -06:00
evazion b8dbc7f68a Fix #4667: Ordering IP bans by last seen puts unknown first. 2021-02-04 00:09:54 -06:00
evazion 520b72948f Fix #4695: Raise max video length to match Twitter's (2:20). 2021-02-04 00:01:03 -06:00
evazion 3f16fe3d80 Fix #4680: @-ing yourself sends you a DMail.
Don't send a dmail when the user @-mentions themselves, whether in an
edit or in the original message.
2021-02-03 23:46:59 -06:00
evazion 50864c7147 Fix #4685: Tagging "aliased_tag -aliased_tag" adds aliased_tag. 2021-02-03 23:24:12 -06:00
evazion e28c28c03b BURs: when moving artists, add old tag to other names.
When aliasing or renaming an artist, add their old tag name to their
other names.
2021-02-03 23:17:13 -06:00
evazion b03d8e728d Fix #4683: Automove _(style) tags when artists are processed via BUR. 2021-02-03 21:27:35 -06:00
evazion 19974d3ab1 Fix #4688: Malformed SQL when searching -status:any.
Negating `Post.all` produced the invalid SQL fragment `WHERE NOT ()`.
Use `Post.where("TRUE")` instead to produce `WHERE NOT (TRUE)`.
2021-02-03 21:15:58 -06:00
evazion e90f792e20 Update ruby gems and yarn packages. 2021-02-03 21:12:33 -06:00
bipface 7546198fcc fix Dockerfile.danbooru
bundle path was getting lost when switching user
2021-02-03 00:25:59 +11:00
bipface 5c0a49c815 fix filename in docker-compose command 2021-02-03 00:21:08 +11:00
nonamethanks efa20d8e53 Post sidebar: ignore metatags for the tag history link 2021-02-01 19:02:54 +01:00
evazion 896e5cb763 Add BetterErrors gem. 2021-01-30 14:19:37 -06:00
evazion c0f27d6e3b posts: refactor next/prev keyboard shortcuts.
On the post show page, define the next page / previous page keyboard
shortcuts in html using data-shortcut attributes instead of in
Javascript. This is consistent with how these shortcuts are defined on
the post index page.
2021-01-30 01:16:00 -06:00
evazion 27cac98516 posts: eliminate pool_id, favgroup_id url params.
Replace the `pool_id` and `favgroup_id` url params:

    https://danbooru.donmai.us/posts/123?pool_id=456
    https://danbooru.donmai.us/posts/123?favgroup_id=456

with the `q` param:

    https://danbooru.donmai.us/posts/123?q=pool:456
    https://danbooru.donmai.us/posts/123?q=favgroup:456
2021-01-29 23:01:44 -06:00
evazion 1e778dbbf6 posts: factor out post navbar into component.
* Factor out the post navbar into a component. The post navbar is the
  part of the post containing the current search, the list of pools, and
  the list of favgroups, along with next/prev navigation links.

* Change navbar markup: remove various unused CSS classes/IDs, change
  pools to use same markup as favgroups, replace nested <div>'s with
  flat <ul>/<li> list.

* Use CSS to truncate long searches/pool names/favgroup names if they're
  too wide for the screen (especially on mobile).
2021-01-29 21:46:21 -06:00
evazion 151a9b026e js: remove jquery-ui effect-shake plugin. 2021-01-29 15:06:35 -06:00
evazion d0c9f6e0b8 posts: allow toggling between upvotes and downvotes.
Like 9efb374ae, allow users to toggle between upvoting and downvoting a
post without raising an error or having to manually remove the vote
first. If you upvote a post, then downvote it, the upvote is
automatically removed and replaced by the downvote.

Other changes:

* Tagging a post with `upvote:self` or `downvote:self` is now silently
  ignored when the user doesn't have permission to vote, instead of
  raising an error.
* Undoing a vote that doesn't exist now does nothing instead of
  returning an error. This can happen if you open the same post in two
  tabs, undo the vote in tab 1, then try to undo the vote again in tab 2.

Changes to the /post_votes API:

* `POST /post_votes` and `DELETE /post_votes` now return a post vote
  instead of a post.
* The `score` param in `POST /post_votes` is now 1 or -1, not `up` or
  `down`.
2021-01-29 02:22:23 -06:00
evazion ffdd5e6128 posts: make post votes work the same way as comment votes.
Change post votes to work the same way as comment votes:

* Make the upvote arrow blue if you've upvoted the post, or grey if you
  haven't. Likewise for the downvote arrow.
* Make it so you can click the upvote or downvote arrows to undo the vote.
* Don't show any notices when you vote on a post.

Also fix it so that votes work the same way on the posts page, the
comments page, and in the modqueue. Before it wasn't possible to undo
votes on the comments page or in the modqueue.
2021-01-29 02:21:08 -06:00
evazion 0a8fe506b4 posts: add script to remove duplicate votes.
There were 67 duplicate votes in the production database.
2021-01-29 02:09:30 -06:00
evazion af84386d77 webpack: fix hot reloading not working.
Upgrade to webpacker-6.0.0.beta.4 to fix a bug where bin/webpack-dev-server
didn't respect the host/port config options in config/webpacker.yml,
which made it listen on the wrong port, breaking hot reloading.
2021-01-29 02:09:30 -06:00
Aki 4b0bbaa15c Update LICENSE 2021-01-28 16:20:56 +09:00
evazion 90cd3293eb Upgrade to Webpacker 6.0. 2021-01-28 00:22:49 -06:00
evazion 2eeee446a5 js: upgrade to MobX 6.0. 2021-01-27 17:46:17 -06:00
evazion 0713751e3c tests: fix user upgrades not being tested in CI. 2021-01-27 16:55:46 -06:00
evazion 716cdb0126 tests: fix broken tests.
* Fix a broken Twitter profile image upload test.
* Skip a broken DeviantArt flash file upload test (flash no longer
  supported by DeviantArt?)
* Skip user upgrade tests when Stripe is not configured.
2021-01-27 00:40:53 -06:00
evazion 3137284292 Update ruby gems and yarn packages. 2021-01-27 00:02:35 -06:00
evazion 0919acb861 unicorn: increase workers, reduce timeout. 2021-01-26 19:52:43 -06:00
evazion 78892e6239 posts: add index on rating column.
Should improve performance for rating:e and rating:q searches. Rating:s
isn't isn't indexed because Postgres is unlikely to use the index for
rating:s searches (the selectivity is too low, ~77% of all posts are
rating:s).
2021-01-26 19:24:18 -06:00
evazion f7ea4917e5 db: sync production schema with declared schema.
Fix various minor inconsistencies between the production database schema
and the declared schema in db/structure.sql.

* tags.category was a smallint instead of an integer in production.
* The unique_schema_migrations index didn't exist outside production.
* The index_posts_on_tag_index index was called index_posts_on_tags_index
  outside production.
* The posts.tag_index column didn't have a statistics target defined
  outside production.
* ID sequences didn't have `AS integer` defined in production.
2021-01-26 19:19:20 -06:00
evazion dca53fb0ee /login: fix missing </section> tag. 2021-01-24 21:01:54 -06:00
evazion 019bcc4ed2 uploads: direct anon users to login page.
When an anonymous users tries to go to the new upload page, direct them
to the login page instead of showing them an "Access Denied" error.
Fixes complaints from SEO tools about linking to pages that return a 403
error.
2021-01-24 20:46:01 -06:00
evazion 2c06766c9e gems: workaround meta_request failure in Rails 6.1.
meta_request fails in Rails 6.1 with a `SystemStackError: stack level
too deep` error. Switch to a patched fork until the mainline gem is
fixed.

* hxxps://www.github.com/dejan/rails_panel/pull/177
* hxxps://www.github.com/dejan/rails_panel/issues/178
2021-01-24 19:26:25 -06:00
evazion 7ed4523152 Update ruby gems and yarn packages. 2021-01-24 19:18:04 -06:00
evazion ab0df8b042 Update CHANGELOG.md 2021-01-23 18:31:48 -06:00
evazion 9a9fbcc398 sessions: fix error when an anonymous user tried to logout.
Fix an exception when a user who was already logged out tried to logout
again.
2021-01-23 18:22:43 -06:00
evazion b6e06ee6fc Fix #4676: Series pool shown as blue unless hovered.
Broken in 49bc2364 by the use of @extend.

Here's what happened. There are two CSS rules that both apply to pool links:

* a:link { color: var(--link-color); }
* .pool-category-series a { color: var(--series-pool-color); }

These rules have equal specificity (0-1-1). This means the rule that is
defined last takes priority. This means the order in which CSS files are
included matters. 49bc2364 used the @extend directive in a rule for
popup menus, which required an @import, which changed the order of the
CSS files, which made the a:link rule suddenly take priority over the
series pool rule.

The proper fix would be to use Sass's new @use directive instead of
@import, but that requires the latest version of Sass, which requires
the latest version of Webpacker, which we can't upgrade to yet because
of breaking changes.

The real moral of the story is: our CSS is very fragile because of
specificity rules. It's very important that rules are defined in a
certain order, otherwise our CSS will break.

* https://sass-lang.com/documentation/at-rules/use
* https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity
2021-01-23 16:01:08 -06:00
evazion b689c9cbed comments: add uniqueness constraint on votes. 2021-01-23 14:44:11 -06:00
evazion 5061b0a013 comments: change 'Shortlink' to 'Copy ID'. 2021-01-23 14:34:53 -06:00