Commit Graph

821 Commits

Author SHA1 Message Date
evazion
d66df41b58 Revert "common.js: show error on ajax failures." (#3640)
This reverts commit ad66b8abc9.
2018-04-13 22:50:03 -05:00
evazion
e4096460eb Fix #3622: Approval links on mod queue have same ID attribute. 2018-04-12 21:48:09 -05:00
evazion
611dacfd22 modqueue: remove dead "approve all" / "hide all" code (disabled since #2446). 2018-04-12 21:43:42 -05:00
evazion
bc0488df26 Fix #3631: Can no longer edit existing notes. 2018-04-12 18:31:07 -05:00
evazion
af9a09c2cb Fix #3626: Artist creation page doesn't autocomplete the name anymore. 2018-04-12 16:23:59 -05:00
Albert Yi
b99600bbbe fixes #3625 2018-04-12 14:12:27 -07:00
Albert Yi
c785d00eb6 remove window.console.log 2018-04-12 13:58:28 -07:00
Albert Yi
26a2e60d04 fixes #3623 2018-04-12 13:36:56 -07:00
Albert Yi
883b36ac2e fixes #3620 2018-04-12 13:00:48 -07:00
evazion
ad1ed5a510 Fix #3623: Changes to existing notes aren't being saved. 2018-04-12 14:52:50 -05:00
Albert Yi
d9d98f05c2 Merge branch 'rails-5.1' 2018-04-11 11:40:36 -07:00
Albert Yi
485c3b01c7 add uploader-id and top-tagger-id data attrs to post previews 2018-04-09 11:12:07 -07:00
evazion
ad66b8abc9 common.js: show error on ajax failures.
Make `link_to ..., remote: true` ajax requests display an error notice on failure.
2018-04-07 18:04:43 -05:00
r888888888
abce4d2551 Raise error on unpermitted params.
Fail loudly if we forget to whitelist a param instead of silently
ignoring it.

misc models: convert to strong params.

artist commentaries: convert to strong params.

* Disallow changing or setting post_id to a nonexistent post.

artists: convert to strong params.

* Disallow setting `is_banned` in create/update actions. Changing it
  this way instead of with the ban/unban actions would leave the artist in
  a partially banned state.

bans: convert to strong params.

* Disallow changing the user_id after the ban has been created.

comments: convert to strong params.

favorite groups: convert to strong params.

news updates: convert to strong params.

post appeals: convert to strong params.

post flags: convert to strong params.

* Disallow users from setting the `is_deleted` / `is_resolved` flags.

ip bans: convert to strong params.

user feedbacks: convert to strong params.

* Disallow users from setting `disable_dmail_notification` when creating feedbacks.
* Disallow changing the user_id after the feedback has been created.

notes: convert to strong params.

wiki pages: convert to strong params.

* Also fix non-Builders being able to delete wiki pages.

saved searches: convert to strong params.

pools: convert to strong params.

* Disallow setting `post_count` or `is_deleted` in create/update actions.

janitor trials: convert to strong params.

post disapprovals: convert to strong params.

* Factor out quick-mod bar to shared partial.
* Fix quick-mod bar to use `Post#is_approvable?` to determine visibility
  of Approve button.

dmail filters: convert to strong params.

password resets: convert to strong params.

user name change requests: convert to strong params.

posts: convert to strong params.

users: convert to strong params.

* Disallow setting password_hash, last_logged_in_at, last_forum_read_at,
  has_mail, and dmail_filter_attributes[user_id].

* Remove initialize_default_image_size (dead code).

uploads: convert to strong params.

* Remove `initialize_status` because status already defaults to pending
  in the database.

tag aliases/implications: convert to strong params.

tags: convert to strong params.

forum posts: convert to strong params.

* Disallow changing the topic_id after creating the post.
* Disallow setting is_deleted (destroy/undelete actions should be used instead).
* Remove is_sticky / is_locked (nonexistent attributes).

forum topics: convert to strong params.

* merges https://github.com/evazion/danbooru/tree/wip-rails-5.1
* lock pg gem to 0.21 (1.0.0 is incompatible with rails 5.1.4)
* switch to factorybot and change all references

Co-authored-by: r888888888 <r888888888@gmail.com>
Co-authored-by: evazion <noizave@gmail.com>

add diffs
2018-04-06 18:09:57 -07:00
evazion
8e457c7331 Disable user:<name> blacklists (temp fix for #3596). 2018-04-05 14:38:44 -05:00
evazion
c19a1b83a9 Fix #3573: commentary: add source citation when fetching cross-site. 2018-03-31 17:20:20 -05:00
Albert Yi
6c790c61d3 replace uploader information post previews and comment listing, rename tagger to top tagger 2018-03-27 10:49:41 -07:00
evazion
7157251657 Upgrade to jquery-2.2.4 (#3548). 2018-02-24 10:43:12 -06:00
r888888888
916a57b2fd update deprecated jquery 2018-02-22 11:46:11 -08:00
Albert Yi
ceecc62aa8 Merge pull request #3557 from evazion/fix-autocomplete-consistency
Fix inconsistencies in autocomplete behavior
2018-02-21 14:51:50 -08:00
evazion
c482175050 Fix #3558: Autocomplete: negated metatags aren't completed.
Fix Danbooru.Autocomplete.parse_query to strip prefixes off of
metatags.
2018-02-19 23:57:46 -06:00
evazion
d8e195d168 autocomplete: unify autocomplete options.
Use a single set of default options so that autocomplete behaves
the same way everywhere.
2018-02-18 19:22:46 -06:00
evazion
4754daf594 autocomplete: unify menu item rendering.
* Use `Danbooru.Autocomplete.render_item` for all menu item rendering.
  Fixes usernames not being colorized when completing mentions, and post
  counts not being shown when completing pools on the /pools page.

* Make the /pools page autocomplete pool names the same way that the
  pool:<name> metatag does. Previously autocomplete on the /pools page
  listed most recently updated pools first; now it lists largest pools first.
2018-02-18 19:22:46 -06:00
evazion
962842815d autocomplete: move artist/pool/wiki autocompletion to autocomplete.js.
* Move all autocomplete code to autocomplete.js.

* Mark autocompleted fields with `data-autocomplete="<type>"` attributes,
  instead of hardcoding input field IDs in the javascript.
2018-02-18 19:22:17 -06:00
evazion
9aa0af82ba Upgrade to jquery-1.12.4; add jquery-migrate plugin (#3548). 2018-02-15 21:38:16 -06:00
evazion
0e259bd4f6 autocomplete: fix issues with Enter key.
* Disable autoFocus. This means that the first item in the autocomplete
  menu isn't automatically selected.

* Add Tab keybinding, to make the Tab key work as normal with autoFocus disabled.

* Fix the Enter key to 1) insert the selected tag when inside the
  autocomplete menu, and 2) submit the search as normal when not inside
  the autocomplete menu.
2018-02-14 22:09:14 -06:00
evazion
b877c037b2 autocomplete: factor out insert_completion function. 2018-02-14 20:23:37 -06:00
evazion
f0754c21f5 autocomplete: make enter key submit on exact match. 2018-02-13 10:52:43 -06:00
evazion
ab86c2049f autocomplete: factor out parse_query function. 2018-02-13 10:36:20 -06:00
Albert Yi
4e10913e31 Merge pull request #3544 from BrokenEagle/fix-autocomplete-nosource
Clear results when a non-autocomplete metatag is used
2018-02-13 00:30:31 -08:00
BrokenEagle
30401591fb Set blank results when a non-autocomplete metatag is used
-Otherwise, the last valid autocomplete result will remain
--Causes incorrect results on Tab/Enter completion
-This clears the autocomplete results instead
2018-02-12 17:20:12 -08:00
evazion
cf27de2ec9 Fix #3532: Make Enter key accept current tag during autocomplete.
Previously we patched the jqueryui-autocomplete library in order to
customize how the Tab and Enter keys behaved. Specifically, we wanted to
prevent the Tab key from moving the focus out of the tag input box, and
we wanted to prevent the Enter key from submitting the page when editing tags.

These things can achieved without patching the library by using
`event.preventDefault` and `event.stopImmediatePropagation` to prevent
other event handlers from running after these keys trigger the
`autocompleteselect` event.
2018-02-06 19:11:01 -06:00
Albert Yi
b03c8084a5 Merge pull request #3536 from BrokenEagle/fix-resize-with-user-setting
Fix the auto resize in desktop mode (ref: a95af95e)
2018-02-05 15:11:26 -08:00
BrokenEagle
31114b716a Fix the auto resize in desktop mode (ref: a95af95e) 2018-02-05 10:20:24 -08:00
BrokenEagle
d829ab3a00 Move all order logic to models
- Have a default order for each model
-- The overall default is ID DESC
- Allow for custom orderings
-- When comma-separated IDs are used
2018-01-29 11:42:53 -08:00
evazion
2833239fa0 Fix #3513: Missing rating error causes weird behavior in tag list on upload page.
Fix bug in the double submit prevention from #2789. Rather than
unbinding the enter key on submit, have the enter key click the submit
button instead. This avoids form submission when the submit button is disabled.
2018-01-21 11:55:24 -06:00
BrokenEagle
8f0e4398eb Fix metatags being treated as normal tags
- Add parent metatag defaults any and none
- Add missing user-based metatags to user source
- Remove all negative metatags since the prior code strips the '-'
2018-01-02 19:52:13 -08:00
Albert Yi
b315ee25bc Merge pull request #3471 from BrokenEagle/fix-controller-views
Various fixes for controller views
2017-12-28 11:18:44 -08:00
BrokenEagle
31d3215dad Fix page controller and action IDs
- Also fix affected CSS and JS files
2017-12-28 10:20:12 -08:00
Albert Yi
2e0e8e1365 Merge pull request #3456 from BrokenEagle/fix-3455
Fix 3455: Convert tag category Javascript/CSS assets to ERB
2017-12-25 13:22:04 -08:00
BrokenEagle
d54b26c61d Convert tag category Javascript/CSS assets to ERB 2017-12-24 17:01:17 -08:00
BrokenEagle
7af1391902 Add autocomplete to wiki page versions 2017-12-21 10:25:16 -08:00
Albert Yi
b973e97648 Merge pull request #3434 from BrokenEagle/feat-copyright-other-wikis
Add character list wikis to copyright related tag response
2017-12-19 11:37:46 -08:00
BrokenEagle
118fd3baf4 Added list_of_* wikis to copyright related tag response 2017-12-18 15:36:08 -08:00
r888888888
a95af95eae move desktop mode to user pref 2017-12-15 13:52:25 -08:00
evazion
44f4befa5a autocomplete: add automatic typo correction.
If normal autocomplete fails to find any results, try doing a
fuzzy name search instead. This will correct simple typos.
2017-11-27 15:21:19 -06:00
evazion
8a0f600ac2 uploads: fix rating:S not being recognized by rating validator. 2017-11-26 11:54:13 -06:00
Albert Yi
4d6dc895d6 Merge pull request #3362 from BrokenEagle/feat-client-input-validation
Moved input existence validations to client (#3352)
2017-11-21 10:56:14 -08:00
Albert Yi
18c8892a74 Merge pull request #3373 from evazion/fix-3368
Fix #3368: "Fetch source data" on /uploads/new doesn't fetch artist tag
2017-11-15 10:58:52 -08:00
evazion
514d4f9c2e /uploads/new: trigger Fetch source data automatically on source change.
On the uploads page, trigger `Fetch source data` automatically when the
user pastes an URL into the source field. Silently ignore invalid URLs
so that we don't trigger spurious errors when the user types in a source
manually.
2017-11-15 10:47:17 -06:00