Commit Graph

99 Commits

Author SHA1 Message Date
evazion
17aabaca29 modqueue: move quality warning tags into config file. 2018-04-17 17:15:06 -05:00
evazion
e4096460eb Fix #3622: Approval links on mod queue have same ID attribute. 2018-04-12 21:48:09 -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
evazion
f15f2cbb81 Fix #3581: Mod Dashboard: exclude or mark deleted comments. 2018-03-31 13:14:41 -05: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
r888888888
c757cdeb12 fix text on mod random queue 2017-12-27 10:52:25 -08:00
r888888888
f11c731e32 fixes #3461 2017-12-27 10:51:17 -08:00
evazion
1b310dcc0b Post#expunge!: fix remove_from_all_pools to clear deleted pools.
* Change Post#pools to return all pools, including deleted pools. This
  fixes remove_all_from_pools to remove the post from deleted pools too.

* Change other users of Post#pools to explicitly select undeleted pools.
2017-07-21 00:13:20 -05:00
evazion
7cb7c2fbab Remove ruby DText implementation (#3206). 2017-07-19 16:48:42 -05:00
evazion
c25ca4c45c {approvals,disapprovals}/create.js.erb: fix indentation. 2017-06-25 11:09:07 -05:00
evazion
791cbbf23b Fix #3186: Mod queue: hide item even if approve/reject fails. 2017-06-25 11:08:05 -05:00
Albert Yi
f44f5d1fdb Merge pull request #3126 from evazion/feat-queue-pools
Fix #3125: Show pools in mod queue
2017-06-08 14:13:44 -07:00
evazion
5c9b5cd21e blacklists: add missing blacklist controls on several pages (fix #3121). 2017-06-07 23:30:35 -05:00
evazion
151b276fb9 modqueue: display pools for each post (fix #3125). 2017-06-07 22:45:01 -05:00
evazion
12fffc3760 modqueue: factor out modqueue posts into partial. 2017-06-07 22:44:46 -05:00
evazion
fdf8e7d5d7 Fix mode menu 'approve' option.
* Fix routing error in respond_with (didn't use /moderator namespace).

* Fix /moderator/posts/approvals.json response to return full
  PostApproval object, not just a success/failure message.

* Simplify the javascript a bit (use $.post instead of $.ajax).
2017-06-04 12:14:35 -05:00
evazion
4fe97a8218 Hide the flags and appeals notices after approving post. 2017-06-04 10:07:42 -05:00
evazion
5ff4f12329 /moderator/ip_addrs: add #p-ip-listing, #p-user-listing ids. 2017-05-22 13:25:36 -05:00
evazion
648cc9ecb7 Move post replacement create action to post replacements controller. 2017-05-14 21:31:01 -05:00
evazion
4e841c4ea5 post replacement: add "Replace Image" dialog to post sidebar. 2017-05-02 20:41:19 -05:00
evazion
4631262374 Fix broken tag autocomplete on multiple pages.
Mark all tag <input>s with a `data-autocomplete` attribute, instead of
hardcoding a list of html IDs to autocomplete in javascript.

This way should be less error prone. It fixes autocomplete in several places:

* Autocomplete for the search box on /posts didn't work in the
  responsive layout. This was because /posts has two search boxes that
  both have the id `tags`: one in the normal sidebar, and one in the
  responsive tag list. $("#tags") only initialized autocomplete on the
  first one.

* Autocomplete didn't work on the aliases or implications pages. This
  was due to selecting the wrong html ids.
2017-04-22 15:24:03 -05:00
evazion
70a7f77a48 Post#approve!: signal errors with invalid object instead of exception. 2017-04-03 17:18:32 -05:00
evazion
66b5dc641c /moderator/dashboard: use PostPresenter.preview for appeal thumbnails. 2017-03-23 04:05:06 -05:00
evazion
d1d0fe9bc5 /moderator/dashboard: optimize sql queries
* Converts queries to use active record instead of raw sql. This ensures
  that user objects are loaded by rails in the join, so that we
  don't have to issue `User.find` calls to load users one-by-one.

* Use `.includes` to preload associations used in the view, to avoid
  additional N+1 query problems (primarily, calls to link_to_user
  also causing users to be loaded one-by-one).
2017-03-23 04:05:05 -05:00
r888888888
022d9ede7f expose bulk revert interface 2017-03-21 14:40:46 -07:00
evazion
2bb134f08d modqueue: highlight uploads containing "bad" tags. 2017-03-01 15:31:16 -06:00
evazion
b80976bce7 modqueue: link tags, like they are in /comments. 2017-02-24 21:03:14 -06:00
evazion
4848f18455 IpAddrSearch: fix pool_versions exception.
Fix pool_versions exception if PoolArchive db isn't set up. Prefer
ActiveRecord over raw sql so we can get real user objects so that the
view can use link_to_user.
2017-01-12 09:28:21 +00:00
evazion
bdf3366bcf Link IP addresses to IP searches. 2017-01-12 09:15:14 +00:00
Albert Yi
63d5c7900d enable bulk reverts, fixes to postarchive 2017-01-11 16:20:04 -08:00
Type-kun
49a72e4bf6 Include user profile link in IP search results 2017-01-09 16:21:27 +05:00
Albert Yi
2af622e7a7 add ban to post mode menu 2016-12-09 11:56:25 -08:00
Albert Yi
a22a7c3302 bulk revert 2016-11-07 10:48:04 -08:00
Albert Yi
4e48e80e1f stub in preview for bulk revert 2016-11-02 13:53:01 -07:00
r888888888
5555151ddd add source to mod queue info 2016-09-13 11:43:17 -07:00
r888888888
2c80d7b82e more intelligent notice for mod queue 2016-09-09 15:08:23 -07:00
r888888888
de34c7fca3 fixes #2650: Add random mode to mod queue 2016-09-08 15:55:06 -07:00
Type-kun
a7d553038f Add "disable-with" to most edit forms (should fix #2264) 2016-08-30 22:54:38 +05:00
r888888888
4cd6dfe884 enable ragel parser in more places 2016-07-25 13:42:04 -07:00
Toks
af22c2b7fa Display expunge errors #2556 2015-12-05 16:18:49 -05:00
r888888888
fea20c84dc fixes #2541 (only for new uploads, flagged posts will still show disapprovals immediately) 2015-10-27 11:49:51 -07:00
Toks
8789aeb9d8 Exclude 127.0.0.1 from ip search link 2015-10-15 23:08:22 -04:00
r888888888
6480864718 fixes #2469 2015-10-15 15:24:24 -07:00
r888888888
8a09151c14 fix typo 2015-10-15 13:28:38 -07:00
r888888888
5eb08210b7 improve links in ip addr search #2530 2015-10-15 12:20:34 -07:00
r888888888
d8e84a90dc Revert "fixes #2530: improved ip addr search"
This reverts commit 1eb2d515fd.

Conflicts:
	app/views/moderator/ip_addrs/index.html.erb
2015-10-15 12:12:21 -07:00
r888888888
2fc5a28a8b fix link 2015-10-08 17:38:04 -07:00
r888888888
1eb2d515fd fixes #2530: improved ip addr search 2015-10-08 17:28:50 -07:00