Commit Graph

64 Commits

Author SHA1 Message Date
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
762dc3da24 Refactor sources 2018-08-24 12:10:51 -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
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
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
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
c76463f34d uploads: use storage manager to distribute files.
Refactors the upload process to pass around temp files, rather than
passing around file paths and directly writing output to the local
filesystem. This way we can pass the storage manager the preview /
sample / original temp files, so it can deal with storage itself.

* Change Download::File#download! to return a temp file.

* Change DanbooruImageResizer and PixivUgoiraConverter to accept/return
  temp files instead of file paths.

* Change Upload#generate_resizes to return temp files for previews and samples.

* Change Upload#generate_resizes to generate ugoira .webm samples
  synchronously instead of asynchronously.
2018-03-20 19:49:06 -05:00
evazion
d4298ea493 Fix #3527: Bookmarklet timeouts for Members. 2018-02-01 17:35:20 -06: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
857fa24697 Fix #3473: Validation warnings for no artist/copyright are still shown on upload failure. 2017-12-28 18:19:28 -06:00
evazion
07a4bdcb21 posts: display validation warnings in flash notice. 2017-11-25 17:03:32 -06:00
evazion
8125d8e796 Set the default User-Agent sent for outgoing http requests.
* Add a `Danbooru.config.http_headers` config option.

* Refactor various places to use this option instead of setting the user
  agent manually.
2017-07-19 20:25:27 -05:00
evazion
ecf5040160 /uploads: make available to anonymous users. 2017-07-06 19:14:17 -05:00
evazion
b2f62482a1 Remove artist commentary handling from download rewrite strategies. 2017-05-10 18:01:51 -05:00
evazion
40092f21ba Remove redundant rescue_from calls.
These are redundant because ApplicationController rescues these exceptions already.
2017-02-25 02:18:16 -06:00
evazion
5909e8501c Pull upload notice, bookmarklet notice from help:upload_notice wiki page. 2016-11-21 01:17:15 -06:00
Toks
8473cfa109 Remove nils from recent tags 2015-11-20 19:55:21 -05:00
Toks
7c7f92d1b2 Fix errors saving recent tags not displaying correctly 2015-11-08 15:07:01 -05:00
r888888888
d7b0d2a7e5 fixes #2509: &#13; in artist commentary 2015-09-03 13:41:21 -07:00
r888888888
d5cadebd88 fixes #2507: uninitialized constant UploadsController::HTML 2015-08-24 17:35:46 -07:00
r888888888
a10f30077b fixes #2433: Automatic commentary copier doesn't account for html 2015-07-15 13:30:42 -07:00
Toks
0a5f1b53ba #2426 refactor to use predetermined referer 2015-07-05 11:02:01 -04:00
Toks
b1b31d7387 fixes #2426 2015-07-04 16:31:34 -04:00
r888888888
fd74f860ee potential fix for #2404 2015-06-10 17:28:51 -07:00
r888888888
2ddc93723c fixes #2327 2015-06-02 19:20:09 -07:00
Toks
069648556b #2366 double check that normalized_url is not nil 2015-04-06 18:39:24 -04:00
r888888888
2d266fc0b6 uploads/batch now supports pixiv 2015-03-15 13:56:16 -07:00
r888888888
f12fb40e3e implements #2350 2015-02-20 20:04:23 -08:00
r888888888
e57cad7b0a add new uploads/batch endpoint for handling twitter galleries 2015-02-09 16:29:00 -08:00
r888888888
48b4d027f6 #2328 fix source lookup on twitter uploads 2014-12-17 14:21:00 -08:00
evazion
c0a803e3a6 Allow ugoira to be uploaded directly from the zip URL.
This refactors things such that

* Fetching the ugoira frame data happens at the end of rewrite, not
  rewrite_html_pages. This way uploading zip URLs should work.
* The source data is cached in an instance variable in case it
  was indeed fetched during rewrite_html_pages. This way it doesn't get
  fetched a second time.
2014-10-19 02:30:03 -07:00
evazion
484224cee6 Fix rename forgotten in d253057. 2014-10-19 02:30:03 -07:00
evazion
58f0ec3dec Use the normalized source in the upload form.
This makes it so you can use the bookmarklet to upload from any of these Pixiv pages:

* http://www.pixiv.net/member_illust.php?mode=medium&illust_id=45792845
* http://www.pixiv.net/member_illust.php?mode=big&illust_id=45792845
* http://www.pixiv.net/member_illust.php?mode=manga&illust_id=45792845
* http://www.pixiv.net/member_illust.php?mode=manga_big&illust_id=45792845&page=0

and the source field in the upload form will be filled in with the
actual image URL (e.g. http://i2.pixiv.net/img18/img/ringo78/45792845_big_p0.jpg),
and it will also be used for the "This post was already uploaded" check.
2014-10-04 12:45:37 -05:00
Toks
931559aa6b fixes #2167 2014-05-30 03:04:07 -04:00
Toks
cc3c6d989f Upload preview: use normalized image url
This means that the preview will work even when the user doesn't use the
direct image link. e.g. The user can use the bookmarklet on Pixiv
mode=medium pages.
2014-04-28 15:29:31 -04:00
Toks
b16980be51 fixes #2138 2014-04-28 14:33:13 -04:00
r888888888
d4007e8093 potential fix for #1769, add missing jquery ui icons 2013-06-19 12:56:21 -07:00
r888888888
af25507480 fixes #813 2013-06-10 16:33:26 -07:00
Toks
9ccf1e0f8f add limit parameter to everything 2013-05-15 01:01:19 -04:00
albert
541dabaaf6 fixes #1108 2013-03-29 15:37:28 -04:00
albert
eae5280091 fixes #1029 2013-03-22 09:11:24 -07:00
小太
cba839ba76 Kill trailing whitespace in ruby files 2013-03-19 23:10:10 +11:00
albert
1ae21d51bc fixes #843 2013-03-11 13:50:35 -04:00
albert
3a262d0d50 fixes #693 2013-03-02 21:23:37 -05:00
albert
bbb8767b29 make forum post quoting regexp nongreedy 2013-02-22 12:24:10 -05:00
albert
94683cc82e redirect upload to post page on success 2013-02-21 14:03:22 -05:00
albert
04d6f25e22 switch to synchronous uploads 2013-02-20 11:23:40 -05:00
albert
8fb20c6b3a fixed nico seiga sources 2013-02-19 23:09:07 -05:00