Added plain URL for privileged users.
This commit is contained in:
parent
e22978cbe4
commit
fc46ae00f8
|
|
@ -18,7 +18,7 @@
|
|||
</div>
|
||||
|
||||
<Link
|
||||
:href="scene.watchUrl"
|
||||
:href="user?.abilities.some((ability) => ability.plainUrls) ? scene.url : scene.watchUrl"
|
||||
:title="scene.date ? format(scene.date.toISOString(), 'y-MM-dd hh:mm') : `Release date unknown, added ${format(scene.createdAt, 'y-MM-dd')}`"
|
||||
target="_blank"
|
||||
class="date-link nolink"
|
||||
|
|
@ -52,6 +52,10 @@ defineProps({
|
|||
type: Object,
|
||||
default: null,
|
||||
},
|
||||
user: {
|
||||
type: Object,
|
||||
default: null,
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
|
||||
<Meta
|
||||
:scene="scene"
|
||||
:user="user"
|
||||
class="meta-full"
|
||||
/>
|
||||
|
||||
|
|
|
|||
|
|
@ -43,6 +43,14 @@
|
|||
>{{ entity.name }}</h2>
|
||||
</a>
|
||||
|
||||
<a
|
||||
v-if="user?.abilities.some((ability) => ability.plainUrls)"
|
||||
:href="entity.url"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
class="plainurl"
|
||||
><Icon icon="link" /></a>
|
||||
|
||||
<Heart
|
||||
domain="entities"
|
||||
:item="entity"
|
||||
|
|
@ -154,7 +162,7 @@ import Movies from '#/components/movies/movies.vue';
|
|||
import Domains from '#/components/domains/domains.vue';
|
||||
import Heart from '#/components/stashes/heart.vue';
|
||||
|
||||
const { pageProps, routeParams } = inject('pageContext');
|
||||
const { pageProps, routeParams, user } = inject('pageContext');
|
||||
const { entity } = pageProps;
|
||||
|
||||
const children = ref(null);
|
||||
|
|
@ -163,9 +171,7 @@ const expanded = ref(false);
|
|||
const scrollable = computed(() => children.value?.scrollWidth > children.value?.clientWidth);
|
||||
const domain = routeParams.domain;
|
||||
|
||||
const entityUrl = (() => {
|
||||
return entity.affiliateUrl || entity.url || null;
|
||||
})();
|
||||
const entityUrl = entity.affiliateUrl || entity.url || null;
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
|
@ -313,6 +319,25 @@ const entityUrl = (() => {
|
|||
display: none;
|
||||
}
|
||||
|
||||
.plainurl {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 .25rem;
|
||||
margin-top: -.25rem;
|
||||
|
||||
.icon {
|
||||
width: 1rem;
|
||||
height: auto;
|
||||
padding: .5rem;
|
||||
fill: var(--highlight);
|
||||
}
|
||||
|
||||
&:hover .icon {
|
||||
fill: var(--primary);
|
||||
}
|
||||
}
|
||||
|
||||
@media(--small-20) {
|
||||
.logo {
|
||||
padding: .5rem 1rem;
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
</div>
|
||||
|
||||
<Link
|
||||
:href="scene.watchUrl"
|
||||
:href="user?.abilities.some((ability) => ability.plainUrls) ? scene.url : scene.watchUrl"
|
||||
:title="scene.date ? formatDate(scene.date.toISOString(), 'y-MM-dd hh:mm') : `Release date unknown, added ${formatDate(scene.createdAt, 'y-MM-dd')}`"
|
||||
target="_blank"
|
||||
class="date nolink"
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ function curateScene(rawScene, assets, reqUser) {
|
|||
|
||||
const isVideoRestricted = config.media.videoRestrictions.includes(curatedScene.channel.slug) || config.media.videoRestrictions.includes(`_${curatedScene.network?.slug}`);
|
||||
|
||||
if ((!isVideoRestricted || reqUser?.abilities?.trailerAccess)) {
|
||||
if (!isVideoRestricted || reqUser?.abilities?.some((ability) => ability.trailerAccess)) {
|
||||
curatedScene.trailer = curateMedia(assets.trailer, { type: 'trailer', isRestricted: isVideoRestricted });
|
||||
curatedScene.teaser = curateMedia(assets.teaser, { type: 'teaser', isRestricted: isVideoRestricted });
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ export function curateUser(user, _assets = {}) {
|
|||
isIdentityVerified: user.identity_verified,
|
||||
avatar: `/media/avatars/${user.id}_${user.username}.png`,
|
||||
role: user.role,
|
||||
abilities: user.abilities,
|
||||
abilities: [...user.role_abilities || [], ...user.abilities || []],
|
||||
createdAt: user.created_at,
|
||||
};
|
||||
|
||||
|
|
|
|||
2
static
2
static
|
|
@ -1 +1 @@
|
|||
Subproject commit c8ee47e1815757c1a2a8db725c1550efc0edb04e
|
||||
Subproject commit 7887d3f52eade5827b96cb7c9fa46f3b4b978690
|
||||
Loading…
Reference in New Issue