Commit Graph

57 Commits

Author SHA1 Message Date
clragon
29b98e5002
[StaffNotes] Add updating and deleting (#823) 2025-01-12 19:28:32 -08:00
clragon
fb1bfd7962
[ModActions] Add value field whitelist (#777) 2024-11-18 08:30:39 -08:00
Donovan Daniels
8a3e70e5ca
[AvoidPosting] Integrate the avoid posting list into the site (#582) 2024-08-03 14:15:26 -07:00
Donovan Daniels
4a0a0c2f93
[UserFeedbacks] Add ability to soft delete feedbacks (#670) 2024-07-21 10:58:40 -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
Donovan Daniels
b330a5f579
[ModActions] Ban Update Mod Action (#539)
* [ModActions] Ban Update Mod Action

* Add back accidentally removed newline

* Log expiration for user_ban_update ModAction

The duration in days makes sense on creation but it falls apart when updating
For this to correctly work the duration needs to be persisted as well
which it isn't at the moment.

---------

Co-authored-by: Earlopain <14981592+Earlopain@users.noreply.github.com>
2023-12-04 19:09:35 +01:00
Earlopain
79bada3392
[Search] Unify user lookup
There was lots of duplication between id/name searching, with a plethora
of different approaches. Now it's all in one place.
A few places that didn't have name/id search previously now do.
2023-08-04 20:46:59 +02:00
clragon
3a2987c84f
[Search] Allow ascending order for IDs 2023-07-07 14:55:30 +02:00
Earlopain
555f6b5d6b
[ModActions] Reenable the api
Disabled in 164ae7efb9
The actual values aren't exposed. There's no telling what
they contain, especially the older ones.
2023-05-07 15:16:48 +02:00
Zwagoth
d35c33f437
Merge pull request #442 from zwagoth/mascots
Dynamic Mascots
2022-10-19 18:22:38 -04:00
Earlopain
2f69a127c7
[Takedowns] Create ModAction on delete 2022-10-17 15:59:29 +02:00
Earlopain
b5fbc1e2eb
[Home] Add dynamic mascots 2022-10-15 21:40:40 +02:00
Earlopain
72460f1254
[BURs] Add tag nuke option for admins 2022-10-01 21:37:00 +02:00
Earlopain
7e33ea8271
[Cleanup] Remove pool is_deleted
Pools are hard-deleted now. There are also a few pools with this flag
which can't be properly deleted at the moment
2022-07-11 22:52:26 +02:00
Earlopain
4168692f2d
[PostSets] Fix exception on admin update
This code path had a few issues which weren't triggered previously.
Also changes the visibility change modaction to track the new visibility.
2022-05-23 18:18:26 +02:00
Earlopain
0e60ac29f9
[Cleanup] Remove mb_chars usage
Ruby 2.4 supports this natively
2022-04-09 14:23:12 +02:00
Earlopain
04c312f042
[ModActions] Add a few missing search actions
Partial for #382
ModActions for set update/mark_private aren't created, but thats another issue
2022-03-21 14:22:43 +01:00
Earlopain
a7de562385
Revert "[Cleanup] Remove post report reasons"
This reverts commit 6b6e19db38.
2022-03-08 11:32:18 +01:00
Earlopain
57a9c728dc
[ModActions] Log when user is linked to artists 2022-03-06 15:38:08 +01:00
Earlopain
6b6e19db38
[Cleanup] Remove post report reasons
Users must select a reason when reporting a post, but that wasn't
displayed in tickets for about 2 years now
2022-03-05 14:20:14 +01:00
Earlopain
e3728546c7
[Cleanup] Remove artist banning 2022-02-19 16:54:26 +01:00
Earlopain
8f9ea21e46
[Users] Log when admins edit text or upload limit 2022-02-05 15:07:30 +01:00
Earlopain
aa77f1a76a
[Posts] Save post events in separate table
Part of  #346
2022-01-06 13:44:30 +01:00
Earlopain
2f3ac660d1
[ModActions] Remove category and description
category was not maintained at all and would fallback to 2000, it was
also not exposed in any way.
Same for description, it's always null
2021-07-18 19:33:37 +02: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
Earlopain
d8cd0c924a [ModAction] Add missing decorators 2021-03-19 23:22:27 +01:00
Kira
ca5b0d5f80 [Mod Action] Fix search 2020-04-24 23:41:49 -07:00
Kira
46f25e933e Migration script for mod actions
It's really terrible but there is no need for these to be done
quickly.
2020-01-30 04:06:57 -08:00
Kira
b64d223b46 Update validations to use new syntax 2019-09-05 05:59:51 -07:00
Kira
ebc23caa77 Refactor mod action log sites 2019-04-14 02:34:04 -07:00
Kira
779f30b6bd Preliminary mod action decorator and structure 2019-04-14 02:30:01 -07:00
evazion
0eff095a3e Refactor searching text attributes.
* Allow using ApplicationRecord#attribute_matches to search text attributes,
and standardize models on using this instead of duplicating code.

* Remove restrictions that limited wildcard searches to Builders only in various places.
2018-08-31 19:50:46 -05:00
evazion
6ff70c5002 mod actions: separate account upgrades from promotions (fix #3841) 2018-08-26 11:12:04 -05:00
evazion
8cc393183e Fix #3754: Include unbans in Mod Actions. 2018-08-22 00:08:33 -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
Albert Yi
a114af107f
Merge pull request #3526 from BrokenEagle/fix-mod-actions
Fix mod actions
2018-01-30 11:40:54 -08:00
BrokenEagle
3933c273c4
Add mod action for move favorites 2018-01-30 11:27:28 -08: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
7ca3d2735c
Merge pull request #3495 from BrokenEagle/fix-missing-super-search
Fix missing controllers for search[id] (Ref #3430)
2018-01-15 11:11:24 -08:00
BrokenEagle
85f04a826a
Added additional mod actions 2018-01-14 00:07:20 -08:00
BrokenEagle
fcdc61f111
Add search interface for mod actions 2018-01-14 00:07:16 -08:00
BrokenEagle
3c45273694
Add category for mod actions 2018-01-13 20:55:52 -08:00
BrokenEagle
ba7fadf6e9
Fix missing controllers for search[id] 2018-01-13 10:01:57 -08:00
evazion
c1834ab8dd Inherit models from ApplicationRecord instead of ActiveRecord::Base. 2017-06-16 13:28:31 -05:00
Albert Yi
4d698bf98b add modaction helper 2017-01-03 15:04:47 -08:00
Toks
3804bf5e3d Require creator for mod actions 2014-06-17 15:51:18 -04:00
r888888888
a89c57cee0 Fix Rails 4.1 migration issues 2014-04-24 17:01:03 -07:00
r888888888
fad0ab7c93 fixes #2133 2014-04-16 17:43:34 -07:00
小太
cba839ba76 Kill trailing whitespace in ruby files 2013-03-19 23:10:10 +11:00
albert
b901859264 fix mod actionl isting 2013-02-28 10:19:59 -08:00