Commit Graph

8667 Commits

Author SHA1 Message Date
evazion
07a0b0b175 config: eliminate hostnames config option.
Eliminate the Danbooru.config.hostnames option. It was only used for
rewriting links in notes. Just using the main hostname is good enough,
there aren't any notes still using any of Danbooru's alternate domain
names.
2020-01-11 00:59:25 -06:00
evazion
9afce59790 Merge pull request #4253 from BrokenEagle/missing-post-attributes
Fix missing post HTML attributes
2020-01-10 20:24:51 -06:00
evazion
56faf701f3 Merge pull request #4254 from BrokenEagle/copyable-note-number
Move note number to the body so that it can be copied
2020-01-10 20:22:07 -06:00
evazion
793d3414b0 Merge pull request #4255 from BrokenEagle/additional-twitter-hashtag
Add additional Twitter hashtag
2020-01-10 20:06:51 -06:00
evazion
133547781c /pool_versions: fix N+1 query problems. 2020-01-10 19:30:47 -06:00
evazion
afa4a2c985 js: fixup issues with @rails/ujs.
Fix a couple regressions caused by the migration from jquery-ujs to
@rails/ujs in 9f4ac4c96:

* Add authenticity tokens to all remote forms. By default, Rails doesn't
  doesn't include authenticity tokens in remote forms because it can cause
  problems with fragment caching. This was fine with jquery-ujs because it
  would insert the authenticity token when the remote form was
  submitted, but apparently @rails/ujs doesn't do this. This broke
  certain remote forms nested inside of jquery UI dialogs.

* Fix dialogs to trigger remote form submissions through @rails/ujs
  instead of through jquery. This fixes a problem where remote forms that
  returned a javascript response displayed the response as plaintext
  instead of executing the returned javascript.
2020-01-10 19:16:27 -06:00
evazion
c50f3da4be Fix #4179: Checkboxes remaining checked after submit on Add Commentary.
Change add commentary to use edit_form_for, which adds
autocomplete="off" to disable autofill in Firefox.
2020-01-10 19:14:11 -06:00
evazion
c86c61c9a4 Fix #4162: Remove browser autocomplete from most inputs. 2020-01-10 16:08:34 -06:00
evazion
cde8ee64e1 Fix #4241: Approving a post then editing tags returns 404.
This is what happens:

* The post is approved.
* The approval action reloads the page by calling `location.reload()`.
* After the page is reloaded, the value of the hidden `_method` param in
  the post edit form is mysteriously overwritten with the value of the
  authenticity_token param from the previous page load.
* The post edit form is submitted, but the _method param isn't set to
  `patch`, so the form submission is treated as a POST request instead of
  a PUT request.
* The POST endpoint doesn't exist, so the form submission returns 404.

The cause appears to be buggy form autofill in Firefox 72. This only
happens in Firefox 72, not in Firefox 68 or in other browsers.
2020-01-10 12:54:12 -06:00
evazion
3ca4f4f32c posts: convert post edit form to simple form. 2020-01-10 12:08:28 -06:00
BrokenEagle
114637f594 Use more efficient use of regexes for Twitter hashtag normalization 2020-01-10 15:30:54 +00:00
BrokenEagle
2eef73e8fe Add additional Twitter hashtag
- It was mentioned on issue #4047 but was forgotten to be included
2020-01-10 14:52:49 +00:00
evazion
9f4ac4c96a js: replace jquery-ujs with @rails/ujs. 2020-01-09 22:15:18 -06:00
evazion
fc06a2a0f7 posts: fix members not being able to tag posts.
Fix regression caused by 3d3f61559. This is what happened:

* The posts controller calls post.visible? before post.update.
* post.visible? calls post.tag_array.
* The call to tag_array causes the current value of tag_string to be
  cached in @tag_array.
* post.update calls post.merge_old_changes.
* post.merge_old_changes accesses tag_array, which contains the old
  cached version of tag_string rather than the new version from the
  update.
* post.merge_old_changes detects no changes, so the update does nothing.
* This only happens for Members because for Gold+ users the call to
  post.visible? short circuits before accessing tag_array.

Moral of the story: cache invalidation is hard. Don't cache unless you have to.
2020-01-09 18:54:03 -06:00
evazion
2cf0e7dcb5 table builder: add default html ids and css classes.
* Add default IDs for <table> tags (ex: <table id="artists-table">).
* Add default CSS classes for <th> and <td> tags (ex: <td class="name-column">).
2020-01-09 17:32:40 -06:00
evazion
d0d3da08e5 views: remove IP addresses from most pages.
Removed IP addresses from comments and from most other listing pages.
IPs take up a lot of space in many places (especially IPv6 addresses),
and in most of these pages they're rarely useful for catching
sockpuppets.
2020-01-09 16:55:09 -06:00
BrokenEagle
4a873626c8 Moved note title to the body so that it can be copied
- Adjusted the title text for new notes
- Adjusted the starting dialog sizes to fit the new text
2020-01-09 22:14:01 +00:00
BrokenEagle
6127492361 Fix missing post HTML attributes 2020-01-09 21:15:31 +00:00
evazion
6acff3334e forum: fix exception when searching forum posts by title.
ex: https://danbooru.donmai.us/forum_posts?search[topic_title_matches]=test

The is_deleted field wasn't qualified so it caused an ambiguous column
error when the forum_posts table was joined with the forum_topics table.
2020-01-09 00:15:05 -06:00
evazion
e119524f20 Merge pull request #4247 from BrokenEagle/pool-version-enhancements
Add pool version enhancements
2020-01-08 19:34:25 -06:00
evazion
5a4b24f6a0 pixiv: normalize new profile urls.
ref: https://danbooru.donmai.us/forum_topics/9127?page=290#forum_post_162222
2020-01-08 17:33:55 -06:00
evazion
ba2744ad42 /mod_actions: add missing .prose wrapper around dtext. 2020-01-08 14:15:17 -06:00
evazion
e72c10bc23 dtext: don't link non-artist tags to artist entries.
* Don't link non-artist tags to artist pages, even when the tag has an
  artist entry. These artist entries are usually old deleted entries
  that happen to have the same name as a gentag, or leftover entries
  that need to be deleted.

* URL escape the artist name in /artists/show_or_new?name={name}
2020-01-08 12:33:55 -06:00
evazion
0c92a5af4d /artist_versions: fix stray <td> tag. 2020-01-08 11:53:28 -06:00
evazion
0b31a6f491 Merge pull request #4249 from BrokenEagle/artist-wiki-links
Have artist wiki links go to artist page
2020-01-08 11:27:37 -06:00
evazion
11411ab778 Merge pull request #4251 from BrokenEagle/tag-script-storage
Change tag script storage
2020-01-08 11:21:08 -06:00
evazion
ee8a8e5d33 Merge pull request #4250 from BrokenEagle/fix-fetch-commentary
Fix the error from missing jQuery-ui effects
2020-01-08 11:20:07 -06:00
evazion
c32f9fbdb8 approver prune: don't prune recently promoted approvers.
Don't prune people who were just promoted in the last 45 days. Also fix
bug where approvers with zero approvals weren't pruned.
2020-01-07 20:24:17 -06:00
evazion
e28a955535 config: remove unneeded config options. 2020-01-07 19:35:57 -06:00
evazion
3d3f615591 config: refactor restricted tag settings. 2020-01-07 19:19:22 -06:00
BrokenEagle
ef29ede448 Fix issue where numeric keypad was setting bad values 2020-01-08 00:22:28 +00:00
BrokenEagle
6f698ec104 Convert tag script storage to local storage 2020-01-08 00:22:28 +00:00
BrokenEagle
57befe894d Fix the error from missing jQuery-ui effects 2020-01-07 22:32:01 +00:00
BrokenEagle
ad1e22af0b Add search page
- Fix issue with updater_name erroring out
- Add search options is_new and name_changed
2020-01-07 18:48:52 +00:00
BrokenEagle
9182a4f556 Highlight carriage return changes 2020-01-07 18:48:51 +00:00
BrokenEagle
34542fdf5c Pool versions diff: Use diff builder to highlight description changes
- Add highlights for name changes
- Separate and name the sections
2020-01-07 18:48:51 +00:00
BrokenEagle
4ab90e5d6e Move diff logic out of helper 2020-01-07 18:48:50 +00:00
BrokenEagle
8531636330 Change Desc Chg column to status column
- Add a diff column
- Reword post column name for better clarity
2020-01-07 18:48:50 +00:00
evazion
ca015a6685 /post_votes: fix the uploader column showing the voter instead. 2020-01-07 12:06:53 -06:00
evazion
e8efe1107f Remove targeted down voting report.
Remove the targeted down voting report. This report hasn't been working
for a while. The /post_votes page is a better way to investigate
downvoting activity anyway.
2020-01-07 11:58:45 -06:00
evazion
d00308c43d Delegate HSTS to nginx.
Remove the ssl_options config option. Let nginx handle HSTS and
http->https redirects instead. At the rails level, all we need to do is
set the secure cookie flag when https is enabled (which we assume it's
enabled in production).
2020-01-07 11:49:46 -06:00
evazion
a4419b1e3d main menu: remove aliases and implications pages.
Remove links to the aliases and implications pages from the main menu.
Put them in the submenu on the /tags page instead.

These pages are too rarely used to deserve being in the toplevel menu.
They also weren't easy to find for non-Builders. The toplevel menu
shouldn't be dependent on user level.
2020-01-07 11:28:52 -06:00
evazion
e9b99408f7 /reports/upload_tags: convert to table builder. 2020-01-07 11:21:15 -06:00
evazion
1ab6a353ca Remove /meta_searches/tags page.
This was a search page that let you search for tags, aliases, and
implications at the same time. It never got much use and it's been
broken for a while now (the search form passed the wrong param to the
controller).
2020-01-07 11:10:56 -06:00
evazion
2aa3ced372 related tags: fix tags rendering as #<Tag:0x0000...>.
Fixup for ab4af3c41.
2020-01-07 10:37:07 -06:00
evazion
ba7c38cfe0 forum: fix .forum-topic-row selector.
The .forum-topic-row class was removed. Use different selector instead.

This rule ensures the timestamp doesn't wrap on small screens.
2020-01-07 02:51:19 -06:00
evazion
5c913d8ad1 table builder: fix various incorrect css classes.
Change calling convention to explicitly indicate whether the attributes
are for the <th> element or the <td> element. Fixes various cases where
the two were mixed up.

* Fix .col-expand classes not being set correctly on the /post_versions,
  /pool_versions, and /notes pages.

* Fix .updater and .updated-at classes not being set correctly on the
  /forum_topics page.

* Fix the name param being ignored (noticeable in the post count field
  on the /tags page).

* Don't pass empty string when column has no name.
2020-01-07 02:40:59 -06:00
evazion
cdb42aad66 /post_events: convert to table builder.
Also fix TableBuilder#all_row_attributes to work with objects that don't
inherit from ApplicationRecord (and therefore don't have an id or model name).
2020-01-07 01:16:37 -06:00
evazion
ab4af3c410 /related_tag: convert to table builder. 2020-01-07 00:57:58 -06:00
evazion
ef89e7321f /artist_urls: convert to table builder. 2020-01-07 00:44:06 -06:00