add: user homepage block ordering

- closes #4791
- uses alpinejs drag and drop function
- renames visible columns for better consistency
- eager loads user settings for block performance
This commit is contained in:
HDVinnie
2025-07-15 18:04:18 -04:00
parent fc763252d0
commit 170f704d0c
8 changed files with 481 additions and 247 deletions
+22 -11
View File
@@ -297,17 +297,28 @@ class User extends Authenticatable implements MustVerifyEmail
{
return $this->hasOne(UserSetting::class)->withDefault([
'censor' => false,
'news_visible' => true,
'chat_visible' => true,
'featured_visible' => true,
'random_media_visible' => true,
'poll_visible' => true,
'top_torrents_visible' => true,
'top_users_visible' => true,
'latest_topics_visible' => true,
'latest_posts_visible' => true,
'latest_comments_visible' => true,
'online_visible' => true,
'news_block_visible' => true,
'news_block_position' => 0,
'chat_block_visible' => true,
'chat_block_position' => 1,
'featured_block_visible' => true,
'featured_block_position' => 2,
'random_media_block_visible' => true,
'random_media_block_position' => 3,
'poll_block_visible' => true,
'poll_block_position' => 4,
'top_torrents_block_visible' => true,
'top_torrents_block_position' => 5,
'top_users_block_visible' => true,
'top_users_block_position' => 6,
'latest_topics_block_visible' => true,
'latest_topics_block_position' => 7,
'latest_posts_block_visible' => true,
'latest_posts_block_position' => 8,
'latest_comments_block_visible' => true,
'latest_comments_block_position' => 9,
'online_block_visible' => true,
'online_block_position' => 10,
'locale' => config('app.locale'),
'style' => config('other.default_style', 0),
'torrent_layout' => 0,