Commit Graph

1013 Commits

Author SHA1 Message Date
Albert Yi
72f319ccf3 rename lambda references to use shorthand syntax 2018-05-10 11:18:02 -07:00
Albert Yi
320f1a426e fixes #3704 2018-05-10 10:20:51 -07:00
Albert Yi
519769d951 fixes #3706 2018-05-10 10:09:52 -07:00
Albert Yi
99012ff342 fix tests 2018-05-09 11:59:51 -07:00
evazion
7c1d5e25fb post approvals: add index page + search options (fix #3579). 2018-05-05 14:00:49 -05:00
evazion
7e99a1b38b artist commentary form: add partial_commentary checkbox.
Add a checkbox for adding/removing the partial_commentary tag in the
artist commentary form.

ref: https://danbooru.donmai.us/forum_topics/15101.
2018-04-29 22:05:59 -05:00
evazion
a6499b5169 post tooltips: add disable option (#3689).
* Add "disable post tooltips" account setting.
* Add back title attribute for when fancy tooltips are disabled.
2018-04-28 23:50:51 -05:00
evazion
6b4a345378 rails 5: replace redirect_to :back with redirect_back
ref: https://blog.bigbinary.com/2016/02/29/rails-5-improves-redirect_to_back-with-redirect-back.html
2018-04-28 12:24:36 -05:00
evazion
c9f35cbacc tag alias corrections: fix ActionView::Template::Error exception (#3668). 2018-04-27 00:17:14 -05:00
evazion
f7a44ae8dd Fix redirect in "disable responsive mode" link. 2018-04-26 21:31:53 -05:00
Albert Yi
f2b525a6d2 Implement forum topic voting and tag change pruning (#3580) 2018-04-26 15:31:06 -07:00
Albert Yi
eddc789df2 fix js bugs 2018-04-26 15:01:57 -07:00
Albert Yi
990d625ae3 reset unread dmail count when using mark all as read (#3574) 2018-04-26 11:47:07 -07:00
Albert Yi
9aafc344fa Merge pull request #3666 from evazion/fix-3664
Fix #3664: Highlight non-gentags in post tooltip
2018-04-26 11:40:59 -07:00
Albert Yi
4b6019d6ad fixes #3668 2018-04-26 10:25:24 -07:00
evazion
e772de40a7 posts: add /posts/{id}.html?variant=tooltip template. 2018-04-25 22:12:26 -05:00
Albert Yi
f3e62f43ba Merge pull request #3658 from evazion/fix-3657
Fix #3657: Add improvements to the uploads interface
2018-04-20 16:03:39 -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
d70a0a64bd Remove controller-level force_ssl checks.
Obsoleted by force_ssl being globally enabled by default.
2018-04-19 00:49:50 -05:00
evazion
909c9aad5a Fix user id cache expiration.
Use a delayed job instead of a HTTP request to invalidate the user id
cache on both servers.
2018-04-19 00:45:51 -05:00
evazion
83b96b4f3f Fix #3652: URL addons stripped when comments are created/edited. 2018-04-18 23:58:35 -05:00
evazion
9b6136fb55 Fix missing parameter exception in /user_feedbacks/new.
ref: https://danbooru.donmai.us/forum_topics/9127?page=233#forum_post_145227
2018-04-17 10:23:55 -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
evazion
af02113e3c /wiki_pages/new: fix "param is missing or the value is empty: wiki_page" 2018-04-12 21:31:34 -05:00
Albert Yi
19cc8ebf9e fixes #3630 2018-04-12 16:02:41 -07:00
Albert Yi
5546d9e98b fixes #3627 2018-04-12 14:20:02 -07:00
Albert Yi
9975b2dd35 don't require saved_search params when creating a new saved search 2018-04-12 13:56:02 -07:00
Albert Yi
d9d98f05c2 Merge branch 'rails-5.1' 2018-04-11 11:40:36 -07:00
Albert Yi
23fef71346 Merge pull request #3609 from evazion/fix-3603
Fix #3603: Unable to view images on Hijiribe/Sonohara when Danbooru is blocked
2018-04-09 10:56:00 -07:00
evazion
d8142a6c21 iqdb_queries_controller.rb: simplify show / check actions.
* Combine create_by_post + create_by_url. Rename to find_similar.
* Move iqdb enabled check to find_similar.
2018-04-07 18:03:01 -05:00
evazion
1b14545d0d Fix #3603: Unable to view images on Hijiribe/Sonohara when Danbooru domain is blocked. 2018-04-06 21:25:14 -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
41a4ff15cd posts: remove unused file path / url methods.
* Remove file_path_for, cropped_file_url (dead code)
* Remove complete_preview_file_url (preview_file_url now returns absolute links)
* Remove `file_name` (only used for Download link in sidebar)
2018-03-20 19:49:55 -05: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
8a012d4c91 Remove unused mobile mode code (#3206).
Mobile mode was removed in 31e36cf.
2018-03-20 02:29:06 -05:00
Albert Yi
448ec81e97 Merge pull request #3541 from evazion/fix-3539
Fix #3539: Open redirect vulnerabilities
2018-03-08 16:02:02 -08:00
evazion
4bc5cc8ccd bulk update requests: allow admins to edit forum topic/post ids (#3554). 2018-02-18 13:08:53 -06:00
evazion
f07aa1b170 bulk update requests: convert to strong params. 2018-02-18 12:12:12 -06:00
evazion
84a0a89f4b Fix #3539: Open redirect vulnerabilities. 2018-02-07 19:52:52 -06:00
r888888888
308e3670df gracefully handle unavailable pg connection errors 2018-02-05 12:38:01 -08:00
evazion
f2a7d3c41a /janitor_trials, /ip_bans: fix default ordering. 2018-02-04 16:48:35 -06:00
r888888888
e0ec9ed518 fix ordering of forum posts in topics 2018-02-01 16:35:47 -08: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
Albert Yi
dfd343f70e Merge pull request #3496 from BrokenEagle/feat-mod-action-event-ids
Add categories to mod actions
2018-01-15 11:09:38 -08:00
evazion
7a0fb0f5d3 Fix #3500: Redirect API endpoints with md5 query param to correct format. 2018-01-14 20:36:57 -06:00
BrokenEagle
85f04a826a Added additional mod actions 2018-01-14 00:07:20 -08:00
Albert Yi
99c0c4ade6 Merge pull request #3479 from BrokenEagle/feat-add-iqdb-page
Initial add of IQDB standalone page
2018-01-02 10:29:27 -08:00
BrokenEagle
36ef8b4db3 Initial add of IQDB standalone page 2017-12-30 00:11:08 -08:00