Commit Graph

8686 Commits

Author SHA1 Message Date
evazion
8ddf7ee716 wiki pages: drop unused wiki page presenter. 2020-01-12 20:13:44 -06:00
evazion
f2269d39a7 wiki_pages/show: fix <meta> description tag.
Use an excerpt of the first paragraph rather than the entire page.
2020-01-12 20:13:44 -06:00
evazion
50c6840be3 wiki_pages/show: refactor post previews.
* Increase number of previews from 4 to 8.
* Eliminate wiki page post set classes.
2020-01-12 20:13:44 -06:00
evazion
40711e1d4f posts/show: refactor parent/child notices.
* Convert notices from helpers to partials.
* Eliminate PostSets::PostRelationship class in favor of post_sets/posts template.
* Eliminate COUNT(*) queries when calculating the number of child posts.
* Eliminate redundant parent load and parent exists queries.
2020-01-12 18:38:38 -06:00
evazion
ed5caba71c /wiki_page_versions: merge page and global listings. 2020-01-12 16:31:24 -06:00
evazion
90b94adee8 /wiki_page_versions/diff: use SetDiff to diff other_names.
Use SetDiff instead of DiffBuilder to generate diffs for wiki page other
names. SetDiff is what we use for artist other names.
2020-01-12 16:31:23 -06:00
evazion
95dd28fc52 /wiki_page_versions/diff: automatically fix comparison order.
Automatically fix it so that we always compare the newer version with
the wiki version, regardless of the order the pages are given in.
2020-01-12 15:28:07 -06:00
evazion
8dc69bef4b views: fix alias and implication list partial when tag is blank.
Fixup for abacc8ebb.
2020-01-12 13:54:29 -06:00
evazion
796efccbf4 Update ruby gems and yarn packages. 2020-01-12 13:13:03 -06:00
evazion
31e41b06ba pools: remove pool element destroy action.
This endpoint was for removing a single post from a pool. This wasn't
used anywhere within Danbooru.
2020-01-12 01:30:04 -06:00
evazion
1a9e4497da /pool_versions: fix is_deleted search option. 2020-01-12 01:23:35 -06:00
evazion
05da264d0d pools: remove pool list dropdown from add to pool dialog.
Autocomplete works better than trying to select the pool from a gigantic
dropdown.
2020-01-12 01:23:35 -06:00
evazion
bebc4694dd pools: remove is_active flag.
Remove uses of the is_active flag. Keep column in database (for now).

The only purpose of this flag was to filter out pools from the pool list
in the Add to Pool dialog. This hasn't had much use since autocomplete
was added. Most pools didn't set the flag correctly anyway.
2020-01-12 01:23:35 -06:00
evazion
3fce17d8ae upload tags report: fix incorrect column name. 2020-01-12 00:42:23 -06:00
evazion
1e3c97e43b pools: remove recent pools from 'add to pool' dialog. 2020-01-11 20:11:35 -06:00
evazion
abacc8ebb1 views: convert helpers to partials. 2020-01-11 20:01:14 -06:00
evazion
153a8339ab Inherit errors from StandardError instead of Exception. 2020-01-11 19:07:28 -06:00
evazion
aff3d3b18f Fix various rubocop issues. 2020-01-11 19:01:40 -06:00
evazion
bab656a873 config: remove more obsolete or unneeded config options.
Remove more config options that were either unused or that shouldn't
need to be configured by downstream users.
2020-01-11 01:31:29 -06:00
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