Showing courtesy comments on actor album photos.

This commit is contained in:
DebaucheryLibrarian 2021-02-05 01:41:53 +01:00
parent 101f5a1453
commit 8af562e284
2 changed files with 16 additions and 5 deletions

View File

@ -317,9 +317,10 @@
<Album <Album
v-if="showAlbum" v-if="showAlbum"
:items="actor.photos" :items="[actor.avatar, ...actor.photos]"
:title="actor.name" :title="actor.name"
:portrait="true" :portrait="true"
:comments="true"
@close="$router.go(-1)" @close="$router.go(-1)"
/> />

View File

@ -16,7 +16,7 @@
:class="{ portrait }" :class="{ portrait }"
> >
<div <div
v-for="item in items" v-for="item in albumItems"
:key="item.id" :key="item.id"
class="item-container" class="item-container"
> >
@ -27,15 +27,15 @@
> >
<img <img
:src="`${path}/${item.thumbnail}`" :src="`${path}/${item.thumbnail}`"
:title="item.comment" :title="item.title"
loading="lazy" loading="lazy"
class="item image" class="item image"
> >
<span <span
v-if="comments && item.comment" v-if="comments && item.title"
class="item-comment" class="item-comment"
>{{ item.comment }}</span> >{{ item.title }}</span>
</a> </a>
</div> </div>
</div> </div>
@ -44,6 +44,13 @@
</template> </template>
<script> <script>
function albumItems() {
return this.items.map(item => ({
...item,
title: item.comment || (item.credit && `© ${item.credit}`) || (item.entity && `© ${item.entity.name}`),
}));
}
export default { export default {
props: { props: {
items: { items: {
@ -67,6 +74,9 @@ export default {
default: true, default: true,
}, },
}, },
computed: {
albumItems,
},
emits: ['close'], emits: ['close'],
}; };
</script> </script>