Commit Graph

37 Commits

Author SHA1 Message Date
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
5664ecc583
[PostFlags] Add back the resolved column/search
Added back on request even though it is not entirely working correctly.
Also invert the colorization condition so that newly created flags aren't marked.
2023-06-11 11:38:00 +02:00
Earlopain
0a7f67e59d
[PostFlags] Replace is_resolved search param with type
Flags have 3 states indicated by 2 boolean values.
The currenet search completely disregards is_deletion which
makes the page difficult to parse. The red border also doesn't make much sense.
2023-05-30 18:30:41 +02:00
Earlopain
97d001a3cc
[PostFlags] Remove category
The reasons are mostly useless and not updated to what e6 uses
2023-05-30 17:42:00 +02:00
Earlopain
f956349592
[PostFlags] Remove 48 hour reason
Discussed internally. The only real use case of this is artists wanting
their own art removed, and we already have takedowns for that.
2023-01-26 21:46:20 +01:00
Earlopain
665f432e17
[Users] Allow moderators to handle tickets 2022-11-28 16:21:40 +01:00
Kira
9d8f5b2da7 [Posts] Revise unapproval conditions
- Prevent unapproving posts that were approved by somebody else.
- Prevent unapproving auto-approved uploads made by a different user.
- Prevent unapproving posts that would be immediately deleted by the cutoff date.
- Remove unflag+unapprove because it seems useless and more likely to create mistakes. Force explicit deletion.
2022-09-20 02:04:16 -07:00
Earlopain
a9b6970956
[Controllers] Always allow search[id] parameter
It works for controllers which allow every parameter, but they need to be
explicitly set when permitting

Noticed because of e397a10e0d
2022-02-06 15:19:08 +01:00
Earlopain
aa77f1a76a
[Posts] Save post events in separate table
Part of  #346
2022-01-06 13:44:30 +01:00
Earlopain
609c1b4b8f
[IpSearch] Add ip searching capabilities and link to them 2021-11-17 18:09:45 +01:00
Kira
c91d22838b [Posts] Fix unflag + approve action throwing exception.
This also adds logging for unapprove actions.
2021-02-27 15:27:10 -08:00
Kira
c71f5c89ac More post flagging bugs 2020-03-20 02:00:56 -07:00
Kira
3f85d1efbd Flagging fix 2020-03-20 01:52:14 -07:00
Kira
ecd4dc9869 Fix up 48 hour flag 2020-03-16 17:14:35 -07:00
Kira
47de963b38 Change remote: true on approvals, appeals and flags to JS 2020-02-21 21:40:37 -08:00
Kira
d1750f938a Remove xml render special casing 2020-01-02 10:16:54 -08:00
Kira
cc71812fda Remove xml respond_to 2020-01-02 10:16:54 -08:00
Kira
0b92d9c2f9 Static list of flagging reasons like old e6 2019-08-02 15:25:00 -07:00
Kira
ccbbe39338 Quick unflag options for posts
This also loosens the restrictions on what can be flagged and how
frequently. Previously pending posts could not be flagged, which
was not in line with our current flagging system purpose.
2019-08-01 16:03:13 -07:00
evazion
705217d337 Fix new dtext shortlinks redirecting to nonexistent pages.
Fix the following dtext shortlinks redirecting to nonexistent pages:

* flag #1
* appeal #1
* mod action #1
* bur #1
2018-10-25 23:00:43 -05:00
evazion
151fa00933 tests: fix tests for /comments/new, /post_flags/new. 2018-10-01 10:38:15 -05: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
e3922fb525 flags/appeals controllers: remove unused check_privilege method (#3206). 2017-07-07 15:47:57 -05:00
evazion
652e251040 /post_{flags,appeals}: add uploader, approver, flag/appeal count columns.
Also include '»' links next to uploader/approver names for drilling down
the search by a given user.
2017-04-07 19:37:26 -05:00
evazion
7c8557dbac Make more pages publicly accessible to logged out users.
* /artist_commentaries
* /note_versions
* /post_appeals
* /post_flags
* /posts/1/events
* /super_voters
2016-10-17 05:57:05 -05:00
Toks
56fa98a358 Add flag and appeal searches
#1915
2013-08-04 11:34:20 -04:00
Toks
2016e15ce8 fixes #1508 2013-06-30 11:57:30 -04:00
Toks
9ccf1e0f8f add limit parameter to everything 2013-05-15 01:01:19 -04:00
r888888888
677f102976 fixes #1287 2013-04-16 21:28:54 -07:00
albert
541dabaaf6 fixes #1108 2013-03-29 15:37:28 -04:00
小太
cba839ba76 Kill trailing whitespace in ruby files 2013-03-19 23:10:10 +11:00
albert
78f1d0f69a fixes to user search 2013-02-21 12:42:41 -05:00
albert
3c68d64540 order post flags and appeals 2013-02-21 11:44:03 -05:00
albert
5158d1b274 fixes for upgrade schema script 2011-11-06 10:12:23 -05:00
albert
c74fa18898 fix pool controller tests 2011-07-22 18:15:43 -04:00
albert
f9c961cdc6 * Removed unapprovals, added post flags and post appeals (still need to update tests)
* Restyled text
2011-03-28 18:48:02 -04:00