diff --git a/app/Livewire/Components/Forms/Album/Properties.php b/app/Livewire/Components/Forms/Album/Properties.php
index 5b740f42b5f..7c5f476d6c8 100644
--- a/app/Livewire/Components/Forms/Album/Properties.php
+++ b/app/Livewire/Components/Forms/Album/Properties.php
@@ -19,6 +19,7 @@
use App\Livewire\Traits\UseValidator;
use App\Models\Album as ModelsAlbum;
use App\Models\Extensions\BaseAlbum;
+use App\Models\TagAlbum;
use App\Policies\AlbumPolicy;
use App\Rules\CopyrightRule;
use App\Rules\TitleRule;
@@ -38,6 +39,7 @@ class Properties extends Component
#[Locked] public string $albumID;
#[Locked] public bool $is_model_album;
+ #[Locked] public bool $is_tag_album;
public string $title; // ! wired
public string $description; // ! wired
public string $photo_sorting_column = ''; // ! wired
@@ -47,6 +49,7 @@ class Properties extends Component
public string $album_aspect_ratio = ''; // ! wired
public string $license = 'none'; // ! wired
public string $copyright = ''; // ! wired
+ public ?string $tag = ''; // ! wired
/**
* This is the equivalent of the constructor for Livewire Components.
@@ -60,6 +63,7 @@ public function mount(BaseAlbum $album): void
Gate::authorize(AlbumPolicy::CAN_EDIT, [AbstractAlbum::class, $album]);
$this->is_model_album = $album instanceof ModelsAlbum;
+ $this->is_tag_album = $album instanceof TagAlbum;
$this->albumID = $album->id;
$this->title = $album->title;
@@ -74,6 +78,10 @@ public function mount(BaseAlbum $album): void
$this->album_sorting_order = $album->album_sorting?->order->value ?? '';
$this->album_aspect_ratio = $album->album_thumb_aspect_ratio?->value ?? '';
}
+ if ($this->is_tag_album) {
+ /** @var TagAlbum $album */
+ $this->tag = implode(', ', $album->show_tags);
+ }
}
/**
@@ -132,6 +140,10 @@ public function submit(AlbumFactory $albumFactory): void
$baseAlbum->album_sorting = $albumSortingCriterion;
$baseAlbum->album_thumb_aspect_ratio = AspectRatioType::tryFrom($this->album_aspect_ratio);
}
+ if ($this->is_tag_album) {
+ /** @var TagAlbum $baseAlbum */
+ $baseAlbum->show_tags = collect(explode(',', $this->tag))->map(fn ($v) => trim($v))->filter(fn ($v) => $v !== '')->all();
+ }
$this->notify(__('lychee.CHANGE_SUCCESS'));
$baseAlbum->save();
diff --git a/app/Livewire/DTO/AlbumRights.php b/app/Livewire/DTO/AlbumRights.php
index e34e5ddb031..54ee9cb782f 100644
--- a/app/Livewire/DTO/AlbumRights.php
+++ b/app/Livewire/DTO/AlbumRights.php
@@ -4,6 +4,7 @@
use App\Contracts\Models\AbstractAlbum;
use App\Livewire\Traits\UseWireable;
+use App\Models\Album;
use App\Policies\AlbumPolicy;
use Illuminate\Support\Facades\Gate;
use Livewire\Wireable;
@@ -22,6 +23,7 @@ public function __construct(
public bool $can_share_with_users = false,
public bool $can_download = false,
public bool $can_upload = false,
+ public bool $can_move = false,
public bool $can_delete = false,
public bool $can_access_original = false,
) {
@@ -42,6 +44,7 @@ public static function make(?AbstractAlbum $abstractAlbum): AlbumRights
can_share_with_users: Gate::check(AlbumPolicy::CAN_SHARE_WITH_USERS, [AbstractAlbum::class, $abstractAlbum]),
can_download: Gate::check(AlbumPolicy::CAN_DOWNLOAD, [AbstractAlbum::class, $abstractAlbum]),
can_upload: Gate::check(AlbumPolicy::CAN_UPLOAD, [AbstractAlbum::class, $abstractAlbum]),
+ can_move: Gate::check(AlbumPolicy::CAN_DELETE, [AbstractAlbum::class, $abstractAlbum]) && $abstractAlbum instanceof Album,
can_delete: Gate::check(AlbumPolicy::CAN_DELETE, [AbstractAlbum::class, $abstractAlbum]),
can_access_original: Gate::check(AlbumPolicy::CAN_ACCESS_FULL_PHOTO, [AbstractAlbum::class, $abstractAlbum]),
);
diff --git a/resources/views/components/gallery/album/menu/menu.blade.php b/resources/views/components/gallery/album/menu/menu.blade.php
index fcddf921e84..8a99101e99f 100644
--- a/resources/views/components/gallery/album/menu/menu.blade.php
+++ b/resources/views/components/gallery/album/menu/menu.blade.php
@@ -29,7 +29,7 @@