Commit Graph

67 Commits

Author SHA1 Message Date
Cinder
4883912e93
[Security] Implement read only mode (#821) 2024-12-08 19:28:31 -08:00
Earlopain
e3fdc5d61b
[Pools] Fix discrepancy between index page count and actual page count
One was using `user.per_page`, the other config.posts_per_page. Consolidate this
logic to `paginate_posts` to make it more obvious what's going on.
2024-04-04 22:52:49 +02: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
930b4b905c
[Pools] Fix show/gallery for frozen string literals
Get rid of the presenters/post sets.
2024-02-25 11:38:55 +01:00
Earlopain
56e849695b
[Cleanup] Remove readonly only
Since its introduction 3 years ago, it got used once I believe
I can't even say if this properly works anymore.

If something like that is actually desired in the future, it should just be a whitelist instead
2024-02-23 16:48:56 +01:00
Earlopain
de726f46de
[Pools] Remove import functionality 2022-12-24 12:48:17 +01:00
Earlopain
0a03bea16c
Merge branch 'master' into pools-is-deleted 2022-08-07 16:29:47 +02:00
faucet
d4bc676cdb
[Pools] Remove default category search parameter on gallery endpoint #424)
* [Pools Gallery] Default to any category when none is selected

* [Pools Gallery] Remove modified variable entirely, allowing more desirable default behaviour instead
2022-07-13 17:32:55 +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
bd93c61e77
[ReadOnly] Add basic read-only mode 2021-07-18 17:50:57 +02:00
Kira
27872acdca [Pools] Allow pool deletion
And have it actually do something
2020-09-17 16:40:21 -07:00
Kira
c1d435c18d Fix pool import remote: use 2020-02-21 21:40:37 -08:00
Kira
6be9fdc5d0 Post flags/appeals/replacement update for remote: true 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
4024108f1c Convert builder -> janitor for user rank 2019-06-29 12:58:28 -07:00
Kira
66b6d29ae3 Add pool import
This also limits the number of posts in a pool to 1000.
2019-04-05 16:08:33 -07:00
Albert Yi
60cee5f452
Merge pull request #3989 from evazion/fix-3987
Wiki pages: convert other_names column to array (#3987)
2018-11-19 16:23:32 -08:00
evazion
29fdfc42a4 pools/gallery: allow searching for collection pools (#3992).
Default to showing only series pools when not doing a search. Otherwise,
when doing a search, show both series and collection pools.
2018-11-15 12:22:51 -06:00
evazion
b660aeefd7 application record: add array_attribute method.
Add `array_attribute` method that defines helper methods for converting
array attributes to or from strings.
2018-11-13 19:18:11 -06:00
evazion
115ed16a96 pools: store post_ids as array instead of string (fix #3979) 2018-11-08 15:09:31 -06:00
Albert Yi
3f40929ca1 fixes #3723 2018-05-24 10:18:16 -07:00
Albert Yi
da34c95da5 add expiry parameter 2018-05-22 14:57:46 -07:00
Albert Yi
72d72fd3d0 eliminate usage of localstorage to cache tag autocomplete results (fixes #3543) 2018-05-17 09:54:37 -07:00
Albert Yi
519769d951 fixes #3706 2018-05-10 10:09:52 -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
r888888888
e0ec9ed518 fix ordering of forum posts in topics 2018-02-01 16:35:47 -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
BrokenEagle
956bd707a5
Add additional restrictions on updating deleted pools 2017-11-20 19:31:11 -08:00
r888888888
c83a76ccce fixes #3282 2017-09-14 11:07:14 -07:00
evazion
3b9a54f681 pools: strip leading/trailing, consecutive underscores in names (fix #3263). 2017-08-10 18:33:36 -05:00
evazion
0c79d2f09e Removed unused controllers actions / routes (#3206). 2017-07-07 15:38:06 -05:00
evazion
c46b31aa9c Prevent reverting to foreign versions (fixes #2711). 2016-10-11 06:57:46 +00:00
r888888888
1d9596d7f2 fixes #2417 2015-06-29 18:17:59 -07:00
Toks
5a8674d342 fix #2239 2015-05-02 11:12:30 -04:00
Toks
cbdc78d606 #2245 make gallery obey user's per page setting 2014-09-07 00:03:23 -04:00
Toks
4f0a83f996 #2245 allow anonymous to view gallery 2014-09-06 23:58:00 -04:00
r888888888
267df896c6 fixes #2245 2014-08-25 16:41:27 -07:00
Toks
2bc5605edc Allow searching for deleted pools 2013-11-01 10:07:47 -04:00
r888888888
e5171d0610 fixes #1999 2013-09-26 17:27:47 -07:00
r888888888
bd4b018e83 fixes #1916 2013-09-04 17:34:33 -07:00
Toks
b32783c8ba fixes #1946 2013-08-18 18:24:39 -04:00
Toks
ab57c4fa09 fixes #1713 2013-07-11 21:14:18 -04:00
Toks
2016e15ce8 fixes #1508 2013-06-30 11:57:30 -04:00
Toks
d99e9c5d81 fixes #1561 2013-05-20 08:42:15 -04:00
Toks
9ccf1e0f8f add limit parameter to everything 2013-05-15 01:01:19 -04:00
Toks
240eba56c2 fixes #1429 2013-04-30 19:54:00 -04: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
56dd8707fd controller tweaks 2013-02-23 15:58:21 -05:00