Apply changes from #1632

This commit is contained in:
Bnyro 2023-03-19 11:10:21 +01:00
parent 125dda2b63
commit 115fc36e64
2 changed files with 39 additions and 38 deletions

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="flex flex-col w-full min-h-screen px-1vw py-5 reset" :class="[theme]"> <div class="flex flex-col w-full min-h-screen px-1vw py-5 antialiased reset" :class="[theme]">
<div class="flex-1"> <div class="flex-1">
<NavBar /> <NavBar />
<router-view v-slot="{ Component }"> <router-view v-slot="{ Component }">
@ -167,7 +167,7 @@ b {
} }
.video-grid { .video-grid {
@apply grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 col-auto lt-md:gap-x-2.5 md:gap-x-1vw gap-y-1.5; @apply grid grid-cols-1 mx-2 sm:mx-0 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 col-auto lt-md:gap-x-3 md:gap-x-6 gap-y-5;
} }
.btn { .btn {

View File

@ -1,6 +1,7 @@
<template> <template>
<div v-if="showVideo"> <div v-if="showVideo">
<router-link <router-link
class="focus:underline hover:underline inline-block w-full"
:to="{ :to="{
path: '/watch', path: '/watch',
query: { query: {
@ -50,43 +51,13 @@
<div> <div>
<p <p
style="display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical" style="display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical"
class="my-2 overflow-hidden flex link" class="pt-2 overflow-hidden flex link font-bold"
:title="item.title" :title="item.title"
v-text="item.title" v-text="item.title"
/> />
</div> </div>
</router-link> </router-link>
<div class="float-right m-0 inline-block children:px-1">
<router-link
:to="{
path: '/watch',
query: {
v: item.url.substr(-11),
...(playlistId && { list: playlistId }),
...(index >= 0 && { index: index + 1 }),
listen: '1',
},
}"
:aria-label="'Listen to ' + item.title"
:title="'Listen to ' + item.title"
>
<font-awesome-icon icon="headphones" />
</router-link>
<button v-if="authenticated" :title="$t('actions.add_to_playlist')" @click="showModal = !showModal">
<font-awesome-icon icon="circle-plus" />
</button>
<button
v-if="admin"
:title="$t('actions.remove_from_playlist')"
ref="removeButton"
@click="removeVideo(item.url.substr(-11))"
>
<font-awesome-icon icon="circle-minus" />
</button>
<PlaylistAddModal v-if="showModal" :video-id="item.url.substr(-11)" @close="showModal = !showModal" />
</div>
<div class="flex"> <div class="flex">
<router-link :to="item.uploaderUrl"> <router-link :to="item.uploaderUrl">
<img <img
@ -100,10 +71,10 @@
/> />
</router-link> </router-link>
<div class="w-[calc(100%-32px-1rem)]"> <div class="px-2 flex-1">
<router-link <router-link
v-if="item.uploaderUrl && item.uploaderName && !hideChannel" v-if="item.uploaderUrl && item.uploaderName && !hideChannel"
class="link-secondary overflow-hidden block" class="link-secondary overflow-hidden block text-sm"
:to="item.uploaderUrl" :to="item.uploaderUrl"
:title="item.uploaderName" :title="item.uploaderName"
> >
@ -111,14 +82,44 @@
<font-awesome-icon class="ml-1.5" v-if="item.uploaderVerified" icon="check" /> <font-awesome-icon class="ml-1.5" v-if="item.uploaderVerified" icon="check" />
</router-link> </router-link>
<strong v-if="item.views >= 0 || item.uploadedDate" class="text-sm"> <div v-if="item.views >= 0 || item.uploadedDate" class="text-xs font-normal text-gray-300 mt-1">
<span v-if="item.views >= 0"> <span v-if="item.views >= 0">
<font-awesome-icon icon="eye" /> <font-awesome-icon icon="eye" />
<span class="pl-0.5" v-text="`${numberFormat(item.views)} `" /> <span class="pl-1" v-text="`${numberFormat(item.views)} `" />
</span> </span>
<span v-if="item.uploaded > 0" class="pl-0.5" v-text="timeAgo(item.uploaded)" /> <span v-if="item.uploaded > 0" class="pl-0.5" v-text="timeAgo(item.uploaded)" />
<span v-else-if="item.uploadedDate" class="pl-0.5" v-text="item.uploadedDate" /> <span v-else-if="item.uploadedDate" class="pl-0.5" v-text="item.uploadedDate" />
</strong> </div>
</div>
<div>
<router-link
:to="{
path: '/watch',
query: {
v: item.url.substr(-11),
...(playlistId && { list: playlistId }),
...(index >= 0 && { index: index + 1 }),
listen: '1',
},
}"
:aria-label="'Listen to ' + item.title"
:title="'Listen to ' + item.title"
>
<font-awesome-icon icon="headphones" />
</router-link>
<button v-if="authenticated" :title="$t('actions.add_to_playlist')" @click="showModal = !showModal">
<font-awesome-icon icon="circle-plus" />
</button>
<button
v-if="admin"
:title="$t('actions.remove_from_playlist')"
ref="removeButton"
@click="removeVideo(item.url.substr(-11))"
>
<font-awesome-icon icon="circle-minus" />
</button>
<PlaylistAddModal v-if="showModal" :video-id="item.url.substr(-11)" @close="showModal = !showModal" />
</div> </div>
</div> </div>
</div> </div>