Skip to content

Commit

Permalink
Add link to album from sharing page (#2625)
Browse files Browse the repository at this point in the history
  • Loading branch information
ildyria authored Oct 29, 2024
1 parent 4f13ee7 commit 46851db
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
2 changes: 2 additions & 0 deletions app/Http/Resources/Models/AccessPermissionResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public function __construct(
public ?int $user_id = null,
public ?string $username = null,
public ?string $album_title = null,
public ?string $album_id = null,
public bool $grants_full_photo_access = false,
public bool $grants_download = false,
public bool $grants_upload = false,
Expand All @@ -29,6 +30,7 @@ public static function fromModel(AccessPermission $accessPermission): AccessPerm
user_id: $accessPermission->user_id,
username: $accessPermission->user->name,
album_title: $accessPermission->album->title,
album_id: $accessPermission->base_album_id,
grants_full_photo_access: $accessPermission->grants_full_photo_access,
grants_download: $accessPermission->grants_download,
grants_upload: $accessPermission->grants_upload,
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/forms/album/AlbumProperties.vue
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ function load(editable: App.Http.Resources.Editable.EditableBaseAlbumResource, p
photoSortingOrder.value = SelectBuilders.buildSortingOrder(editable.photo_sorting?.order);
albumSortingColumn.value = SelectBuilders.buildAlbumSorting(editable.album_sorting?.column);
albumSortingOrder.value = SelectBuilders.buildSortingOrder(editable.album_sorting?.order);
photoLayout.value = SelectBuilders.buildPhotoLayout(editable.photo_layout);
photoLayout.value = SelectBuilders.buildPhotoLayout(editable.photo_layout ?? undefined);
license.value = SelectBuilders.buildLicense(editable.license);
aspectRatio.value = SelectBuilders.buildAspectRatio(editable.aspect_ratio);
header_id.value = buildHeaderId(editable.header_id, photos);
Expand Down
6 changes: 5 additions & 1 deletion resources/js/components/forms/sharing/ShareLine.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<template>
<div class="flex">
<div class="w-5/12 flex items-center text-muted-color">
<span v-if="props.withAlbum" class="w-full">{{ props.perm.album_title }}</span>
<span v-if="props.withAlbum" class="w-full">
<router-link :to="{ name: 'album', params: { albumid: props.perm.album_id } }" class="hover:text-color-emphasis underline">{{
props.perm.album_title
}}</router-link>
</span>
<span class="w-full">{{ props.perm.username }}</span>
</div>
<div class="w-1/2 flex items-center justify-around">
Expand Down
3 changes: 2 additions & 1 deletion resources/js/lychee.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ declare namespace App.Http.Resources.Editable {
photo_sorting: App.DTO.PhotoSortingCriterion | null;
album_sorting: App.DTO.AlbumSortingCriterion | null;
aspect_ratio: App.Enum.AspectRatioType | null;
photo_layout: any | null;
photo_layout: App.Enum.PhotoLayoutType | null;
header_id: string | null;
cover_id: string | null;
tags: Array<string>;
Expand Down Expand Up @@ -270,6 +270,7 @@ declare namespace App.Http.Resources.Models {
user_id: number | null;
username: string | null;
album_title: string | null;
album_id: string | null;
grants_full_photo_access: boolean;
grants_download: boolean;
grants_upload: boolean;
Expand Down
2 changes: 1 addition & 1 deletion resources/js/views/Sharing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<div class="flex flex-col text-muted-color-emphasis">
<div class="flex items-center">
<div class="w-5/12 flex items-center">
<span class="w-full">{{ $t("lychee.ALBUM_TITLE") }}</span>
<span class="w-full">{{ "Album Title" }}</span>
<span class="w-full">{{ $t("lychee.USERNAME") }}</span>
</div>
<div class="w-1/2 flex items-center justify-around">
Expand Down

0 comments on commit 46851db

Please sign in to comment.