Added plain URL for privileged users.

This commit is contained in:
2026-01-30 06:03:03 +01:00
parent e22978cbe4
commit fc46ae00f8
7 changed files with 39 additions and 9 deletions

View File

@@ -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;