Commit Graph

269 Commits

Author SHA1 Message Date
evazion
84d311f366 autocomplete: add username autocomplete to /uploads search page. 2019-08-12 21:33:07 -05:00
Albert Yi
4fe7f5eff9 restyling 2019-01-23 17:40:58 -08:00
evazion
b24ccb0595 tag edit dialog: fix clicking button before handler is bound.
https://danbooru.donmai.us/forum_topics/9127?page=265#forum_post_153180:

> I'm not sure how to reproduce this, but sometimes on the upload page
> when I click the button to pop out the tag box, the screen scrolls up to
> the picture but the box doesn't pop out, and I have to scroll back down
> and click it again

https://danbooru.donmai.us/forum_topics/9127?page=266#forum_post_153183:

> Yes, this was brought up by Unbreakable on Discord a while back. It's
> due to the fact that the event handler that pops out the dialog box has
> not yet been bound by the time you click it. Since that clickable
> control has an empty anchor link of "#" which goes nowhere, it therefore
> redirects the user to the top of the page.
2018-12-18 19:10:23 -06:00
evazion
d52d5ff260 Fix #4018: Drag and drop upload errors
Disable upload timeout. This timeout caused uploads to silently fail when
the timeout was exceeded (ref: https://gitlab.com/meno/dropzone/issues/23).
2018-12-16 17:45:26 -06:00
Albert Yi
3893926048 add dynamic tag counts on upload form 2018-12-10 17:51:28 -08:00
Albert Yi
a57d4a9558 fixes #2680 2018-11-12 16:29:44 -08:00
evazion
6a7cd6ce8e Fix #3984: Twitter: undefined method `first' for nil:NilClass.
Fix Sources::Strategies::Twitter#image_urls to return an empty array
instead of nil when the tweet doesn't contain any images.
2018-11-11 17:41:32 -06:00
Albert Yi
a55730bfbc switch to use sparkmd5 for calculating md5 hash of file uploads 2018-10-25 17:22:35 -07:00
evazion
6d293dfde2 related tags: fix style issues. 2018-10-16 13:09:22 -05:00
evazion
6223f89a99 related tags: refactor /related_tags.js to avoid updating unchanged columns.
Refactor the /related_tags.js call so that when the "Related tags"
button is clicked, it only replaces the columns that actually changed,
not the entire related tags section.

This avoids rebuilding the Recent / Frequent / Translated Tags / Artist
columns every time the "Related tags" button is clicked.
2018-10-15 18:41:32 -05:00
evazion
5a05961bde related tags: factor partials out from post, upload edit forms. 2018-10-12 21:18:15 -05:00
evazion
99632d5e8a TagSetPresenter: refactor to pass options explicitly.
Refactor tag_list_html, split_tag_list_html, and inline_tag_list_html to
take the `show_extra_links` and `current_query` options explicitly,
rather than implicitly relying on CurrentUser or taking `params[:tags]`
from the template.
2018-09-30 21:52:24 -05:00
evazion
b4cf423058 Clean backtraces in uploads/show, static/error.json. 2018-09-23 20:08:13 -05:00
Albert Yi
f487b2a2c6 Merge pull request #3889 from evazion/fix-replace-artist-finder
Cleanup artist finder
2018-09-12 11:44:42 -07:00
evazion
0df5937d33 /uploads/batch: use preview_url for non-proxied images (#3891). 2018-09-12 00:08:28 -05:00
evazion
10ca4dd3ad artists: replace artist finder with fetch source data.
* On posts, automatically trigger "Fetch source data" when clicking the
  Edit tab, instead of triggering the artist finder button. This way we
  find both the artist and the translated tags in one ajax call.

* Remove the "Artist" finder button next to the source field. This isn't
  necessary given that "Fetch source data" finds the artist itself.

* Remove the /artists/finder.json API endpoint. This is no longer used
  after removing the "Artist" finder button.
2018-09-11 20:09:25 -05:00
Albert Yi
4972c998f8 rely on preview urls if available for gallery 2018-09-11 15:06:12 -07:00
evazion
950fcdb7b2 uploads: add new source:<url> dupe check (fix #3873)
* On the /uploads/new page, instead of just showing a "This post has
probably already been uploaded" message, show the actual thumbnails of
posts having the same source as what the user is trying to upload.

* Move the iqdb results section up top, beside the related posts section.
2018-09-06 20:43:20 -05:00
evazion
07c0695ac1 uploads: remove "this post was probably already uploaded" dupe check.
Also makes it so that using the bookmarklet always triggers async upload
preprocessing. Before it was only triggered when the source passed a
dupe check, but that check was inaccurate (#3873).
2018-09-06 20:43:04 -05:00
evazion
1bfe763182 related tags: remove dead #artist-tags-container code.
Dead since 78900c4d3.
2018-09-03 19:13:09 -05:00
Albert Yi
64c3bc18a7 rename ref and url fields to upload_source and upload_referer_url 2018-08-29 16:46:04 -07:00
Albert Yi
68c30961ac Merge pull request #3805 from r888888888/refactor-sources
Refactor sources
2018-08-28 12:13:15 -07:00
evazion
47e26419d3 nav menu: add html ids to secondary nav menu links (#3844). 2018-08-27 20:57:59 -05:00
evazion
e10df5bdf7 Fix #3839: Allow prepopulating upload form with url params. 2018-08-24 17:39:26 -05:00
Albert Yi
762dc3da24 Refactor sources 2018-08-24 12:10:51 -07:00
evazion
a6162246f4 Fix #3830: JS Upload ignores set Max-Filesize bigger than 265 MB. 2018-08-22 20:24:52 -05:00
evazion
3ae913a707 html: convert html comments to erb comments.
Avoid emitting useless comments in the html.
2018-08-17 18:55:21 -05:00
evazion
bbaadda1e3 Convert keyboard shortcuts to use data-shortcut. 2018-08-12 12:09:58 -05:00
Albert Yi
b56681a609 refactor solution for #3804 2018-08-07 13:31:45 -07:00
Albert Yi
d053e135ab fix leaked ip addresses in upload status (#3804) 2018-08-07 13:18:31 -07:00
r888888888
334d8b7c6f Add alt_source field on uploads to deal with twitter galleries 2018-08-04 16:32:15 -07:00
Albert Yi
099654b2da truncate sources on upload listing 2018-07-06 11:02:26 -07:00
lllusion3469
0502f3ece1 Make dropzone accept mp4, webm, and swf files
to match the rest of the code base

For flash files I've used the file extension because the mime type is browser
specific and I've found at least 2 different variations for .swf:
1. `application/vnd.adobe.flash-movie`: wikipedia
2. `application/vnd.adobe.flash.movie`: mailcap, firefox
some other browser may not even know the .swf extension in the first place
2018-07-03 18:53:34 +02:00
Albert Yi
9510dead9f refactor iqdb query support 2018-06-19 14:16:12 -07:00
Albert Yi
2ec97bc8ba display more info in upload page 2018-06-19 12:46:17 -07:00
Albert Yi
9f33b14fa8 adjust styling 2018-06-14 17:52:41 -07:00
Albert Yi
b0c2ddba8b update tests 2018-06-14 17:52:41 -07:00
Albert Yi
0e6c358701 add drag and drop file uploads w/async processing
[skip ci]
2018-06-14 17:52:41 -07:00
Albert Yi
fdd7582fb0 add support for upload preprocessing 2018-06-14 17:52:41 -07:00
evazion
442964b0eb tag_set_presenter: refactor split_tag_list_html.
* Make category headers optional.
* Make category order configurable.
* Clean up code.
2018-04-25 22:12:10 -05:00
evazion
c9acbbdf9e uploads: revamp /uploads listing UI (#3657).
* Add thumbnails.
* Colorize tags.
* Rearrange columns.
* Add rating/source/size/dimensions info.
* Add "»" search drilldown links.
2018-04-20 15:52:09 -05:00
evazion
e6ce05eb29 uploads: add more search options for /uploads listing (#3657). 2018-04-20 15:51:56 -05:00
evazion
ff4616e7b2 uploads: add upload-specific secondary links. 2018-04-20 15:51:56 -05:00
evazion
8083c7daae uploads: fix batch upload page to work without bookmarklet.
* Add a form to the /uploads/batch page so that it can be used without
  the bookmarklet.

* Fix an exception when no url is given.
2018-04-20 15:51:56 -05:00
evazion
bca483cefd Fix #3628: Retry button is displayed for failed uploads that cannot succeed even if retried 2018-04-12 22:14:06 -05:00
Albert Yi
cd88a8df9f fixes #3620 2018-04-12 13:00:48 -07: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
r888888888
a8c4179083 fix html class in uploads/new 2018-01-02 15:34:43 -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