Commit Graph

73 Commits

Author SHA1 Message Date
clragon
8136799546
[UserFeedbacks] Restore deleted user feedbacks from staff notes (#859) 2025-02-03 09:00:20 -08:00
Donovan Daniels
b6acf106f2
[UserFeedbacks] Allow janitors to see deleted feedback (#802) 2024-11-25 06:50:12 -08:00
Tarrgon
9a9f175da4
[DText] Add newline normalization (#699) 2024-11-10 20:22:40 -08:00
Sindrake
cc1189292c [UserFeedbacks] Fix a misnamed mod action 2024-07-21 15:20:40 -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
c11ad6b874
[UserFeedback] Add Updater 2024-01-04 14:31:54 -06:00
Earlopain
7c7c2f1870
[Users] Add a size limit to the body of feedback 2023-09-12 19:09:17 +02: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
Donovan Daniels
0cea3d85ba
[ModActions] Revise report_reason_update & user_feedback_create (#521)
* [ModActions] report_reason_update: log description changes

* [ModActions] user_feedback_update: log reason/type changes

* [ModActions] Tweak display of feedback changes

---------

Co-authored-by: Earlopain <earlopain@protonmail.com>
2023-05-16 18:49:50 +02:00
Earlopain
aca5543f3c
[UserFeedback] Add option to send dmail on update 2023-04-10 12:51:03 +02:00
Earlopain
6801742487
[Cleanup] Remove promote message code 2022-09-26 20:20:20 +02:00
Earlopain
a0fe40db74
[UserFeedback] Log creator in staff notes on delete 2022-09-11 18:51:54 +02:00
Earlopain
0e60ac29f9
[Cleanup] Remove mb_chars usage
Ruby 2.4 supports this natively
2022-04-09 14:23:12 +02:00
Earlopain
bc54c5b7df
[Feedback] Log creation date on destroy in StaffNotes 2022-03-21 10:42:21 +01:00
Earlopain
55443873a3
[Cleanup] Remove no_feedback 2022-03-16 15:32:24 +01:00
Earlopain
a9125e7951
[StaffNotes] Log feedback on destroy 2022-02-19 20:55:51 +01:00
Earlopain
1c6b2dcba9
[Users] Remove special casing for name change feedback
Part of old danbooru code, these feedbacks where never created on e6.
Also remove name change approve/reject controller actions, it's all automatic
2022-01-22 16:20:49 +01:00
Kira
9bbc5afe28 [Rails] More deprecation warnings 2021-02-25 12:08:09 -08:00
Kira
454ddbc902 [Admin] Allow editing user feedback from old creators
Previously the person who created a feedback entry needed to be a
moderator, but as the site has lost some moderators over the years
it became impossible to edit user feedback created by demoted users.

So only check creator when creating new entries to fix that.
2020-04-24 23:56:06 -07:00
Kira
c1ffe79645 Remove irrelevant text from negative feedback 2019-11-24 06:26:46 -08:00
Kira
b64d223b46 Update validations to use new syntax 2019-09-05 05:59:51 -07:00
Kira
db390427c1 Menus were busted for new items added to them 2019-08-09 23:29:01 -07:00
Kira
03de07a2a1 Bunch of dumb little fixes related to user level changes 2019-06-30 11:16:05 -07:00
Kira
9fa294ba31 Convert gold -> privileged for user level 2019-06-29 08:45:58 -07:00
Kira
ebc23caa77 Refactor mod action log sites 2019-04-14 02:34:04 -07:00
Albert Yi
4706cae114 Add user permissions for flagging and for giving user feedback 2018-12-11 17:08:31 -08:00
evazion
f5012464ab Fix #3965: Extraneous API attributes.
Remove the updater_id/updater_ip_addr virtual attributes from
pools/notes. Juss pass them in as params to create_version instead.
2018-10-30 15:41:17 -05:00
Albert Yi
4b9f3e384f include more messaging for user feedback 2018-09-05 16:32:18 -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
Albert Yi
72f319ccf3 rename lambda references to use shorthand syntax 2018-05-10 11:18:02 -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
dac095f318 /user_feedbacks: change default order to created_at.
Order by created_at instead of by id because old feedbacks aren't in id order.
2018-02-04 16:43:00 -06:00
Albert Yi
47bd812811
Merge pull request #3525 from BrokenEagle/fix-index-default-order
Fix index default order
2018-01-29 13:11:24 -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
evazion
100c1d2828 Fix #3523: Feedback notification dmails should include the text of the feedback. 2018-01-28 14:32:38 -06:00
BrokenEagle
3c45273694
Add category for mod actions 2018-01-13 20:55:52 -08:00
evazion
0ca726802f Fix #3430: Accept the search[id] param in all controllers.
* Allow every controller to take the `search[id]` param.

* Parse the `search[id]` param the same way that the `id:<N>` metatag is
  parsed. So `search[id]=1,2,3`, `search[id]=<42`, `search[id]=1..10`, for
  example, are all accepted.
2017-12-17 17:36:52 -06:00
evazion
c1834ab8dd Inherit models from ApplicationRecord instead of ActiveRecord::Base. 2017-06-16 13:28:31 -05:00
evazion
94e548cfe1 /bans: add test for searching bans. 2017-04-19 17:56:26 -05:00
evazion
b1af644f67 dmails: send automated dmails from Danbooru.config.system_user.
Sends automated dmails from `Danbooru.config.system_user`, rather than
whichever user is performing the action happens to be (usually User.admins.first).

Also adds a notice in the view that the dmail was automated.
2017-02-23 22:51:17 -06:00
evazion
7486bb0add Fix #2851: Account deletion should remove name change requests.
Hides name change requests for deleted users (username matches /user_[0-9]+~*/).
2017-01-19 22:32:13 +00:00
Type-kun
5ce26c2e52 Remaining fixes to mod actions on user feedbacks and IP bans 2017-01-16 18:21:09 +05:00
Type-kun
02c243b968 Revert to: "Another partial fix for issue #2824, which also affected ip bans and feedback" 2017-01-14 21:53:33 +00:00
Albert Yi
f2a5d45db0 implement token bucket rate limiting 2017-01-09 17:31:14 -08:00
Type-kun
9da5e67a65 Another partial fix for issue #2824, which also affected ip bans and feedback
Also fixed minor errors with IP bans
2017-01-09 13:57:16 +05:00
Albert Yi
b9a1e115fb add additional mod actions 2017-01-03 16:02:36 -08:00
evazion
fa74c71b6d Prevent mods from editing/deleting feedbacks given to themselves. 2016-11-28 03:57:24 -06:00
r888888888
fad0ab7c93 fixes #2133 2014-04-16 17:43:34 -07:00