Commit Graph

35 Commits

Author SHA1 Message Date
Cinder
4883912e93
[Security] Implement read only mode (#821) 2024-12-08 19:28:31 -08:00
Tarrgon
1425332c0b [Replacements] Allow janitor+ to auto approve submitted replacements (#650) 2024-07-28 18:12:41 -07:00
Donovan Daniels
d9f6653e02
[Posts] Overhaul destroyed posts (#672) 2024-07-13 17:05:50 -07:00
Earlopain
fc7d84affd
[RuboCop] Enable Style/FrozenStringLiteralComment
This reduces allocations on the posts page by about 5%, from basic testing
2024-02-25 18:15:55 +01:00
Earlopain
952792a6b8
[Users] Don't allow moderators to destroy replacements
The check is already correct in the view
2023-03-23 20:17:12 +01:00
Earlopain
2dc9cac520
[PostReplacements] Check approval permission instead of level
Closes #490
2023-03-23 19:20:44 +01:00
Earlopain
462c0359ce
[Replacements] Respect the danger zone upload restriction
Closes #460
2022-12-27 22:28:06 +01:00
Earlopain
77fe1ef42b
[Replacements] Fully use vue for creating new replacement 2022-08-20 17:13:36 +02:00
Earlopain
d867ffcded
[Replacements] Use the normal uploader
This automatically adds:
* Video previews
* Thumbnail url warnings
* Prevent selecting both file and url

And probably a bit more
2022-05-22 22:18:03 +02:00
Earlopain
21043eb540
[Uploader] Fix preview for large local files on firefox
Firefox implemented a size check for those, breaking previews for large
files. This is also a significant performance improvement for all browser
2022-04-20 21:21:11 +02:00
Earlopain
f23e31db1b
[Replacements] Allow specific user to replace images
This option is only temporary, once it is rolled out for eveyone
this can be reverted, and simply  use is_member in the access check
2022-01-30 13:33:14 +01:00
Earlopain
bcccec6778
[Replacements] Add test for upload limit changes 2021-06-27 00:21:01 +02:00
Earlopain
5d430e8210
[Replacements] Use ajax for approve/reject/toggle/promote actions 2021-06-26 18:25:25 +02:00
Earlopain
08150d7cca
[Replacements] Limit actions that can be taken for certain stati 2021-06-26 15:05:44 +02:00
Earlopain
f54e5d7f84
[Replacements] Allow toggling user penalize 2021-06-26 14:01:07 +02:00
Earlopain
da96e16fd6
[Replacements] Record original uploader
Add a link to users profile to search for their replaced posts and give
janitors the option to penalize the user when appropriate
2021-06-26 13:01:26 +02:00
Earlopain
851c0b281c
[Replacements] Hide thumbnails on deleted posts
loginblocked/safeblocked and the blacklist still don't apply but for
that to work it'll have to be redone in a different way
2021-06-25 17:34:16 +02:00
Kira
ea8298fbaf [Replacements] Small UI tweaks 2021-04-25 19:36:38 -07:00
Kira
e70de34d2e [Replacements] Add upload preview to replacement uploader 2021-04-07 10:33:19 -07:00
Kira
a7ceea717d [Replacements] Allow janitors to approve/reject/promote 2021-04-07 10:33:19 -07:00
Kira
2298beaa6c [Tests] Fix post replacement controller tests 2021-04-07 10:33:19 -07:00
Kira
2c7c0e3dd4 [Replacements] Make janitor+ for testing purposes 2021-04-07 10:33:19 -07:00
Kira
a28466bdaf [Replacements] Continued progress
[Replacements] Fix exceptions when processing replacements

[Replacements] Fix handling of invalid file types

[Replacements] Fix error reporting and promote dupe checking

[Replacements] Prevent duplicate replacements from cropping up
2021-04-07 10:33:19 -07:00
Kira
3855d64228 Post replacement system 2021-04-07 10:33:18 -07:00
Kira
ac34b6fe26 Fix bad post_replacement column names 2020-12-20 11:11:35 -08:00
Kira
cc71812fda Remove xml respond_to 2020-01-02 10:16:54 -08:00
evazion
f886f2fdb3 posts/show: load flag/appeal/replacement dialogs via ajax (#3922). 2018-09-26 20:01: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
fa941e9480 /post_replacements: allow updating image metadata in past replacements. 2017-12-18 18:03:03 -06:00
Type-kun
af7c109912 Restrict post replacements to mod+ (issue #3348) 2017-11-01 13:19:52 +05:00
evazion
9c50b24306 post replacements: add "Tags" field to dialog box.
* Adds a "Tags" field to the post replacement dialog box. The given tags
  are added to the post after replacement.

* Prefills the Tags field with certain tags that usually need to be
  removed after replacement: replaceme, image_sample, jpeg_artifacts, etc.
2017-06-26 18:17:16 -05:00
evazion
d3e8937716 post replacements: allow replacing with an uploaded file. 2017-06-22 16:52:55 -05:00
evazion
c27668d2ef post replacements: add option to fix source after replacement.
Adds a "Final Source" field to the post replacement dialog. If
specified, the post's source field will be changed to this value after
replacement.

This makes fixing the source back to the HTML page after
replacement easier.
2017-06-22 16:51:55 -05:00
evazion
648cc9ecb7 Move post replacement create action to post replacements controller. 2017-05-14 21:31:01 -05:00
evazion
cb09b6661d Add /post_replacements.json, /posts/1234/replacements.json. 2017-05-14 18:49:57 -05:00