Commit Graph

40 Commits

Author SHA1 Message Date
evazion
f1f489c40b pundit: convert favorites to pundit. 2020-03-20 18:03:01 -05:00
evazion
7c71311eef Add /favorites.json endpoint. 2020-02-24 22:42:59 -06:00
evazion
99a1a408cd /artists/banned, /favorites: fix redirects for non-html requests.
ref: https://danbooru.donmai.us/forum_topics/9127?page=287#forum_post_161549
2019-12-11 02:27:41 -06:00
evazion
b77eebf136 /favorites: replace favorites view with ordfav: search.
Make /favorites redirect to a ordfav:<user> search instead of having a
separate view just for favorites. This duplicated a lot of code for no
good reason.
2019-08-31 19:58:38 -05:00
evazion
00239c4901 favorites: fix error handling.
* Return HTTP 422 instead of HTTP 500 on "You have already favorited
  this post" errors.

* Log unexpected errors in Ajax requests to the console.
2019-08-13 21:30:20 -05:00
evazion
eef8b9c323 posts/show: fix flash message when faving/unfaving posts.
Bug: if you faved a post, then opened another page in a separate tab,
then the "You have favorited this post" flash message would appear in
the separate tab.

Fixes regression in bcaee199.
2018-08-15 20:14:51 -05:00
evazion
bcaee199f5 favorites: unify create.js.erb & destory.js.erb code paths. 2018-08-12 15:51:18 -05:00
evazion
fb91bbc6c5 Fix #3813: Favorite limit can be bypassed. 2018-08-12 14:22:08 -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
r888888888
31e36cf9eb remove unused mobile layouts 2017-11-17 13:59:14 -08:00
r888888888
d48ed95191 favoritescontroller#destroy should work even if the post doesn't exist, remove from favorites on expunge (fixes #3222) 2017-07-19 13:39:24 -07:00
evazion
f5209c7fb9 /favorites: make available to anonymous users. 2017-07-06 19:22:57 -05:00
Albert Yi
f2a5d45db0 implement token bucket rate limiting 2017-01-09 17:31:14 -08:00
r888888888
caf4a28b02 enable user privacy mode for displaying favorites 2016-02-22 12:18:19 -08:00
r888888888
ed3bbbe177 fixes #1412: When creating or deleting favorites through the API, return some form of response 2015-07-29 17:50:59 -07:00
r888888888
dec92a67c4 fix favoriting 2014-09-05 16:50:34 -07:00
r888888888
0e203c5cda add favorite/unfavorite links to mobile page 2014-09-05 16:46:22 -07:00
Toks
03aee0f664 Fix document title when viewing other users' favorites 2013-07-14 19:44:35 -04:00
Toks
acfbf260aa fixes #1410; fix user argument for favorite post set 2013-05-05 07:36:07 -04:00
Toks
6ab405c142 fixes #1403 2013-05-03 19:54:01 -04:00
Toks
222bc8786b fixes #1430 2013-04-24 11:21:53 -04:00
Toks
c9400e404d fixes #449 2013-04-14 12:56:35 -04:00
albert
fd9ca8d2fc fixes #987 2013-03-22 09:58:31 -07:00
小太
cba839ba76 Kill trailing whitespace in ruby files 2013-03-19 23:10:10 +11:00
albert
caacd3f86f fixes #733 2013-03-03 15:37:20 -05:00
albert
6a1db1197b fixes #670 2013-03-01 07:33:19 -08:00
albert
66fc05e30b change privileged accounts to gold accounts, add platinum accounts, add favorite and tag query limiting based on level 2013-02-20 00:02:43 -05:00
albert
779ff94944 fixes #208 2012-01-06 18:58:01 -05:00
albert
c8afd34d15 added ip addr search 2011-07-29 18:04:50 -04:00
albert
5d05769c2c fix tests 2011-07-22 19:02:53 -04:00
albert
4e19d98047 changes 2011-06-26 01:52:42 -04:00
albert
739e28919a refactoring 2011-06-25 19:31:39 -04:00
albert
9c0a961ab2 major refactoring of javascripts 2011-03-10 17:59:42 -05:00
albert
76a7594a97 implemented favorites on post/show page 2011-02-07 18:57:33 -05:00
albert
46164eab4f finished dmails and favorites functional tests 2010-12-05 22:27:45 -05:00
albert
39dd2e277a * Refactored PostSet, splitting it into PostSets::Post and PostSets::Favorite
* Additional functional tests
2010-12-01 17:21:05 -05:00
albert
f8ab736677 fixed tests 2010-11-19 17:20:13 -05:00
albert
f051e04550 sync 2010-10-08 18:42:26 -04:00
albert
5610731b35 sync 2010-08-18 18:42:33 -04:00
albert
ac98d7db37 stubbed in blank controllers/helpers/functional tests 2010-03-10 18:21:43 -05:00