2020-06-27 02:50:13 +00:00
|
|
|
<template>
|
|
|
|
<div
|
|
|
|
v-if="entity"
|
|
|
|
class="entity content"
|
|
|
|
>
|
|
|
|
<div class="info">
|
2020-06-30 22:25:27 +00:00
|
|
|
<a
|
2021-06-27 22:05:24 +00:00
|
|
|
:href="entityUrl"
|
2020-06-30 22:25:27 +00:00
|
|
|
target="_blank"
|
|
|
|
rel="noopener"
|
|
|
|
class="link link-child"
|
|
|
|
>
|
|
|
|
<template v-if="entity.hasLogo">
|
|
|
|
<img
|
|
|
|
v-if="$route.name === 'network'"
|
|
|
|
class="logo logo-child"
|
|
|
|
:src="`/img/logos/${entity.slug}/thumbs/network.png`"
|
|
|
|
>
|
|
|
|
|
|
|
|
<img
|
2020-07-02 02:04:28 +00:00
|
|
|
v-else-if="entity.parent && !entity.independent"
|
2020-06-30 22:25:27 +00:00
|
|
|
class="logo logo-child"
|
|
|
|
:src="`/img/logos/${entity.parent.slug}/thumbs/${entity.slug}.png`"
|
|
|
|
>
|
|
|
|
|
|
|
|
<img
|
|
|
|
v-else
|
|
|
|
class="logo logo-child"
|
|
|
|
:src="`/img/logos/${entity.slug}/thumbs/${entity.slug}.png`"
|
|
|
|
>
|
|
|
|
</template>
|
2020-06-27 22:44:53 +00:00
|
|
|
|
2020-06-30 22:25:27 +00:00
|
|
|
<h2
|
2020-06-27 22:44:53 +00:00
|
|
|
v-else
|
2020-06-30 22:25:27 +00:00
|
|
|
class="name"
|
|
|
|
>{{ entity.name }}</h2>
|
2020-07-02 23:28:22 +00:00
|
|
|
|
2020-07-23 16:27:49 +00:00
|
|
|
<Icon
|
|
|
|
v-if="entity.url"
|
|
|
|
icon="share2"
|
|
|
|
/>
|
2020-06-30 22:25:27 +00:00
|
|
|
</a>
|
2020-06-27 22:15:13 +00:00
|
|
|
|
2020-07-08 00:53:46 +00:00
|
|
|
<ul
|
|
|
|
v-if="entity.tags.length > 0"
|
|
|
|
class="tags"
|
|
|
|
>
|
2020-07-05 02:10:35 +00:00
|
|
|
<li
|
|
|
|
v-for="tag in entity.tags"
|
|
|
|
:key="`tag-${tag.slug}`"
|
|
|
|
>{{ tag.name }}</li>
|
|
|
|
</ul>
|
|
|
|
|
2021-10-30 20:41:58 +00:00
|
|
|
<RouterLink
|
2020-06-27 02:50:13 +00:00
|
|
|
v-if="entity.parent"
|
2020-06-27 22:15:13 +00:00
|
|
|
:to="`/${entity.parent.type}/${entity.parent.slug}`"
|
2020-06-30 22:25:27 +00:00
|
|
|
class="link link-parent"
|
2020-06-27 02:50:13 +00:00
|
|
|
>
|
|
|
|
<img
|
2020-06-27 22:44:53 +00:00
|
|
|
v-if="entity.parent.hasLogo"
|
2020-06-27 22:15:13 +00:00
|
|
|
class="logo logo-parent"
|
2020-06-27 02:50:13 +00:00
|
|
|
:src="`/img/logos/${entity.parent.slug}/thumbs/network.png`"
|
|
|
|
>
|
2020-06-27 22:44:53 +00:00
|
|
|
|
2020-07-02 23:28:22 +00:00
|
|
|
<img
|
|
|
|
v-if="entity.parent.hasLogo"
|
|
|
|
class="favicon"
|
|
|
|
:src="`/img/logos/${entity.parent.slug}/favicon.png`"
|
|
|
|
>
|
|
|
|
|
2020-06-27 22:44:53 +00:00
|
|
|
<h3
|
|
|
|
v-else
|
|
|
|
class="name parent-name"
|
|
|
|
>{{ entity.parent.name }}</h3>
|
2021-06-27 22:05:24 +00:00
|
|
|
|
|
|
|
<Icon icon="device_hub" />
|
2021-10-30 20:41:58 +00:00
|
|
|
</RouterLink>
|
2020-06-27 02:50:13 +00:00
|
|
|
</div>
|
|
|
|
|
2021-03-24 16:17:51 +00:00
|
|
|
<div
|
|
|
|
class="content-inner"
|
|
|
|
@scroll="events.emit('scroll', $event)"
|
|
|
|
>
|
2020-06-29 23:07:48 +00:00
|
|
|
<Scroll
|
|
|
|
v-if="entity.children.length > 0"
|
2020-12-30 01:23:43 +00:00
|
|
|
v-slot="scroll"
|
2021-02-03 18:21:47 +00:00
|
|
|
:expandable="true"
|
2020-07-02 02:04:28 +00:00
|
|
|
:expanded="expanded"
|
2021-01-14 00:37:50 +00:00
|
|
|
class="scroll-light"
|
2020-07-02 02:04:28 +00:00
|
|
|
@expand="(state) => expanded = state"
|
2020-06-29 23:07:48 +00:00
|
|
|
>
|
2020-07-02 02:04:28 +00:00
|
|
|
<Children
|
|
|
|
:entity="entity"
|
|
|
|
:class="{ expanded }"
|
2020-12-30 01:23:43 +00:00
|
|
|
@load="scroll.loaded"
|
2020-07-02 02:04:28 +00:00
|
|
|
/>
|
2020-06-29 01:55:10 +00:00
|
|
|
</Scroll>
|
2020-06-27 02:50:13 +00:00
|
|
|
|
2021-06-28 00:50:06 +00:00
|
|
|
<div class="campaign-container">
|
2021-06-28 03:13:41 +00:00
|
|
|
<Campaign
|
|
|
|
:entity="entity"
|
|
|
|
:min-ratio="3"
|
|
|
|
/>
|
2021-06-28 00:50:06 +00:00
|
|
|
</div>
|
|
|
|
|
2020-06-27 02:50:13 +00:00
|
|
|
<FilterBar
|
2021-01-17 20:24:20 +00:00
|
|
|
ref="filter"
|
2020-06-27 02:50:13 +00:00
|
|
|
:fetch-releases="fetchEntity"
|
|
|
|
:items-total="totalCount"
|
|
|
|
:items-per-page="limit"
|
2022-03-04 22:31:59 +00:00
|
|
|
:available-tags="entity.tags"
|
2020-06-27 02:50:13 +00:00
|
|
|
/>
|
|
|
|
|
|
|
|
<div class="releases">
|
2021-10-25 00:06:24 +00:00
|
|
|
<Releases
|
|
|
|
:releases="entity.releases"
|
2023-07-02 03:07:38 +00:00
|
|
|
:entity="entity"
|
2021-10-25 00:06:24 +00:00
|
|
|
:done="done"
|
|
|
|
/>
|
2020-06-29 01:55:10 +00:00
|
|
|
|
|
|
|
<Pagination
|
|
|
|
:items-total="totalCount"
|
|
|
|
:items-per-page="limit"
|
|
|
|
class="pagination-top"
|
|
|
|
/>
|
2020-06-27 02:50:13 +00:00
|
|
|
</div>
|
2020-08-15 17:04:33 +00:00
|
|
|
|
|
|
|
<Footer />
|
2020-06-27 02:50:13 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-07-20 02:20:33 +00:00
|
|
|
import FilterBar from '../filters/filter-bar.vue';
|
2020-06-29 01:55:10 +00:00
|
|
|
import Pagination from '../pagination/pagination.vue';
|
2020-06-27 02:50:13 +00:00
|
|
|
import Releases from '../releases/releases.vue';
|
2020-06-29 01:55:10 +00:00
|
|
|
import Children from './children.vue';
|
|
|
|
import Scroll from '../scroll/scroll.vue';
|
2021-06-28 00:50:06 +00:00
|
|
|
import Campaign from '../campaigns/campaign.vue';
|
2020-06-27 02:50:13 +00:00
|
|
|
|
2021-03-19 02:27:48 +00:00
|
|
|
async function fetchEntity(scroll = true) {
|
2021-10-25 00:06:24 +00:00
|
|
|
this.done = false;
|
2021-06-27 22:05:24 +00:00
|
|
|
this.entityUrl = null;
|
|
|
|
|
2020-06-27 02:50:13 +00:00
|
|
|
const { entity, totalCount } = await this.$store.dispatch('fetchEntityBySlugAndType', {
|
|
|
|
entitySlug: this.$route.params.entitySlug,
|
|
|
|
entityType: this.$route.name,
|
|
|
|
limit: this.limit,
|
|
|
|
range: this.$route.params.range,
|
|
|
|
pageNumber: Number(this.$route.params.pageNumber),
|
|
|
|
});
|
|
|
|
|
|
|
|
this.entity = entity;
|
|
|
|
this.totalCount = totalCount;
|
|
|
|
|
|
|
|
this.pageTitle = entity.name;
|
2021-07-05 22:01:44 +00:00
|
|
|
|
2022-01-28 03:05:29 +00:00
|
|
|
const campaign = entity.campaigns.find((campaignX) => !campaignX.banner)
|
|
|
|
|| entity.parent?.campaigns.find((campaignX) => !campaignX.banner);
|
2021-07-11 23:41:18 +00:00
|
|
|
|
2023-07-02 03:07:38 +00:00
|
|
|
if (entity.url) {
|
|
|
|
const { searchParams, pathname, origin } = new URL(entity.url);
|
|
|
|
|
|
|
|
const affiliateParams = new URLSearchParams({
|
|
|
|
...(entity.url && Object.fromEntries(searchParams)), // preserve any query in entity URL, e.g. ?siteId=5
|
|
|
|
...(campaign?.affiliate?.parameters && Object.fromEntries(new URLSearchParams(campaign.affiliate.parameters))), // append affiliate parameters
|
|
|
|
}).toString();
|
2023-06-19 03:19:49 +00:00
|
|
|
|
2023-07-02 03:07:38 +00:00
|
|
|
this.entityUrl = campaign?.url || campaign?.affiliate?.url || `${origin}${pathname}${campaign?.affiliate?.parameters ? `?${affiliateParams}` : ''}`;
|
|
|
|
}
|
2021-07-11 23:41:18 +00:00
|
|
|
|
2021-10-25 00:06:24 +00:00
|
|
|
this.done = true;
|
2021-06-27 22:05:24 +00:00
|
|
|
|
2021-05-08 22:23:10 +00:00
|
|
|
if (scroll && this.$refs.filter?.$el) {
|
2021-03-19 02:27:48 +00:00
|
|
|
this.$refs.filter.$el.scrollIntoView();
|
|
|
|
}
|
2020-06-28 01:19:09 +00:00
|
|
|
}
|
|
|
|
|
2020-06-27 02:50:13 +00:00
|
|
|
async function mounted() {
|
|
|
|
await this.fetchEntity();
|
|
|
|
}
|
|
|
|
|
2021-05-08 22:23:10 +00:00
|
|
|
async function route(to) {
|
|
|
|
if (to.name === 'channel' || to.name === 'network' || to.name === 'studio') {
|
|
|
|
await this.fetchEntity();
|
|
|
|
this.expanded = false;
|
|
|
|
}
|
2020-06-27 02:50:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
FilterBar,
|
2020-06-29 01:55:10 +00:00
|
|
|
Pagination,
|
|
|
|
Children,
|
2020-06-27 02:50:13 +00:00
|
|
|
Releases,
|
2020-06-29 01:55:10 +00:00
|
|
|
Scroll,
|
2021-06-28 00:50:06 +00:00
|
|
|
Campaign,
|
2020-06-27 02:50:13 +00:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
entity: null,
|
2020-09-03 20:22:12 +00:00
|
|
|
pageTitle: null,
|
2020-06-27 02:50:13 +00:00
|
|
|
totalCount: null,
|
2021-10-25 00:06:24 +00:00
|
|
|
done: false,
|
2020-07-23 02:29:46 +00:00
|
|
|
limit: Number(this.$route.query.limit) || 20,
|
2020-07-02 02:04:28 +00:00
|
|
|
expanded: false,
|
2021-06-27 22:05:24 +00:00
|
|
|
entityUrl: null,
|
2020-06-27 02:50:13 +00:00
|
|
|
};
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
$route: route,
|
2021-01-04 00:30:39 +00:00
|
|
|
'$store.state.ui.tagFilter': fetchEntity,
|
2020-06-27 02:50:13 +00:00
|
|
|
},
|
|
|
|
mounted,
|
|
|
|
methods: {
|
|
|
|
fetchEntity,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2020-07-05 02:40:57 +00:00
|
|
|
@import 'breakpoints';
|
2020-06-28 01:58:16 +00:00
|
|
|
|
2020-06-27 02:50:13 +00:00
|
|
|
.info {
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
background: var(--profile);
|
|
|
|
border-bottom: solid 1px var(--lighten-hint);
|
2020-07-02 23:28:22 +00:00
|
|
|
}
|
2020-06-27 22:44:53 +00:00
|
|
|
|
2020-07-02 23:28:22 +00:00
|
|
|
.link {
|
2021-06-28 00:50:06 +00:00
|
|
|
max-width: 15rem;
|
2020-07-02 23:28:22 +00:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
box-sizing: border-box;
|
2021-06-28 03:13:41 +00:00
|
|
|
padding: 1rem;
|
2020-07-02 23:28:22 +00:00
|
|
|
text-decoration: none;
|
|
|
|
}
|
2020-06-30 22:25:27 +00:00
|
|
|
|
2020-07-02 23:28:22 +00:00
|
|
|
.link-child {
|
2021-06-28 00:50:06 +00:00
|
|
|
flex-shrink: 0;
|
|
|
|
|
2020-07-02 23:28:22 +00:00
|
|
|
.icon {
|
|
|
|
fill: var(--lighten);
|
|
|
|
margin: 0 0 0 1rem;
|
2020-06-30 22:25:27 +00:00
|
|
|
}
|
|
|
|
|
2020-07-02 23:28:22 +00:00
|
|
|
&:hover .icon {
|
|
|
|
fill: var(--text-light);
|
2020-06-27 22:44:53 +00:00
|
|
|
}
|
2020-06-27 02:50:13 +00:00
|
|
|
}
|
|
|
|
|
2020-07-02 23:28:22 +00:00
|
|
|
.link-parent {
|
|
|
|
flex-direction: row-reverse;
|
2021-06-28 00:50:06 +00:00
|
|
|
flex-shrink: 0;
|
2020-07-08 00:53:46 +00:00
|
|
|
margin: 0 0 0 3rem;
|
2021-06-27 22:05:24 +00:00
|
|
|
|
|
|
|
.icon {
|
|
|
|
width: 1.25rem;
|
|
|
|
height: 1.25rem;
|
|
|
|
fill: var(--lighten);
|
|
|
|
margin: 0 .5rem 0 0;
|
|
|
|
}
|
2020-07-02 23:28:22 +00:00
|
|
|
}
|
|
|
|
|
2020-06-27 02:50:13 +00:00
|
|
|
.logo {
|
|
|
|
height: 100%;
|
2020-07-02 23:28:22 +00:00
|
|
|
max-width: 100%;
|
2020-06-27 02:50:13 +00:00
|
|
|
object-fit: contain;
|
2020-07-02 23:28:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.logo-child {
|
2021-06-27 22:05:24 +00:00
|
|
|
height: 3rem;
|
2020-07-02 23:28:22 +00:00
|
|
|
}
|
|
|
|
|
2020-07-15 03:12:29 +00:00
|
|
|
.logo-parent {
|
2020-07-02 23:28:22 +00:00
|
|
|
height: 1.5rem;
|
2020-06-27 22:15:13 +00:00
|
|
|
}
|
|
|
|
|
2020-07-15 03:12:29 +00:00
|
|
|
.favicon {
|
|
|
|
height: 1rem;
|
2021-06-28 00:50:06 +00:00
|
|
|
flex-shrink: 0;
|
2021-06-27 22:05:24 +00:00
|
|
|
}
|
|
|
|
|
2020-08-19 19:48:55 +00:00
|
|
|
.content-inner {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
}
|
|
|
|
|
2020-12-30 01:23:43 +00:00
|
|
|
.scroll {
|
|
|
|
background: var(--profile);
|
|
|
|
}
|
|
|
|
|
2021-06-28 00:50:06 +00:00
|
|
|
.campaign-container {
|
2023-06-24 15:16:06 +00:00
|
|
|
max-height: 150px;
|
2021-06-28 00:50:06 +00:00
|
|
|
background: var(--background-dim);
|
|
|
|
text-align: center;
|
|
|
|
padding: .5rem;
|
|
|
|
}
|
|
|
|
|
2020-08-19 19:48:55 +00:00
|
|
|
.releases {
|
|
|
|
flex-grow: 1;
|
|
|
|
}
|
|
|
|
|
2020-06-27 22:44:53 +00:00
|
|
|
.name {
|
|
|
|
color: var(--text-light);
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
padding: 0;
|
2020-07-02 23:28:22 +00:00
|
|
|
margin: 0;
|
2020-06-30 22:25:27 +00:00
|
|
|
white-space: nowrap;
|
2020-06-27 22:44:53 +00:00
|
|
|
font-size: 1.5rem;
|
|
|
|
}
|
|
|
|
|
2020-07-02 23:28:22 +00:00
|
|
|
.favicon {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
2020-07-08 00:53:46 +00:00
|
|
|
@media(max-width: $breakpoint) {
|
|
|
|
.tags {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-05 02:40:57 +00:00
|
|
|
@media(max-width: $breakpoint-micro) {
|
2020-07-08 00:53:46 +00:00
|
|
|
.logo-parent {
|
2020-07-02 23:28:22 +00:00
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.favicon {
|
|
|
|
display: inline-block;
|
|
|
|
}
|
2020-06-27 02:50:13 +00:00
|
|
|
}
|
2020-07-08 00:53:46 +00:00
|
|
|
|
|
|
|
@media(max-width: $breakpoint-nano) {
|
|
|
|
.link-child .icon {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
2020-06-27 02:50:13 +00:00
|
|
|
</style>
|