diff --git a/assets/components/auth/login.vue b/assets/components/auth/login.vue index ec229609f..8a5a7b486 100644 --- a/assets/components/auth/login.vue +++ b/assets/components/auth/login.vue @@ -36,6 +36,7 @@ >Log in Sign up @@ -65,7 +66,7 @@ async function login() { } function mounted() { - if (!this.$store.state.auth.enabled) { + if (!this.$store.state.auth.login) { this.$router.replace({ name: 'not-found' }); } } diff --git a/assets/components/auth/signup.vue b/assets/components/auth/signup.vue index f61bc8519..2a696b3d9 100644 --- a/assets/components/auth/signup.vue +++ b/assets/components/auth/signup.vue @@ -44,6 +44,7 @@ >Sign up Log in @@ -74,7 +75,7 @@ async function signup() { } function mounted() { - if (!this.$store.state.auth.enabled) { + if (!this.$store.state.auth.signup) { this.$router.replace({ name: 'not-found' }); } } diff --git a/assets/components/entities/entity.vue b/assets/components/entities/entity.vue index c7b58557a..87b7d5669 100644 --- a/assets/components/entities/entity.vue +++ b/assets/components/entities/entity.vue @@ -5,7 +5,7 @@ >
+ + + + + +
@@ -124,6 +145,9 @@ import Children from './children.vue'; import Scroll from '../scroll/scroll.vue'; async function fetchEntity(scroll = true) { + this.campaign = null; + this.entityUrl = null; + const { entity, totalCount } = await this.$store.dispatch('fetchEntityBySlugAndType', { entitySlug: this.$route.params.entitySlug, entityType: this.$route.name, @@ -137,6 +161,16 @@ async function fetchEntity(scroll = true) { this.pageTitle = entity.name; + const channelBannerCampaigns = entity.campaigns.filter(campaign => campaign.banner); + const networkBannerCampaigns = entity.parent?.campaigns.filter(campaign => campaign.banner); + const bannerCampaigns = channelBannerCampaigns.length > 0 ? channelBannerCampaigns : networkBannerCampaigns; + + if (bannerCampaigns.length > 0) { + this.campaign = bannerCampaigns[Math.floor(Math.random() * bannerCampaigns.length)]; + } + + this.entityUrl = entity.campaigns.find(campaign => !campaign.banner)?.affiliate.url || entity.url; + if (scroll && this.$refs.filter?.$el) { this.$refs.filter.$el.scrollIntoView(); } @@ -168,6 +202,8 @@ export default { totalCount: null, limit: Number(this.$route.query.limit) || 20, expanded: false, + campaign: null, + entityUrl: null, }; }, watch: { @@ -185,6 +221,7 @@ export default { @import 'breakpoints'; .info { + height: 6rem; display: flex; justify-content: space-between; background: var(--profile); @@ -214,6 +251,13 @@ export default { .link-parent { flex-direction: row-reverse; margin: 0 0 0 3rem; + + .icon { + width: 1.25rem; + height: 1.25rem; + fill: var(--lighten); + margin: 0 .5rem 0 0; + } } .logo { @@ -223,7 +267,7 @@ export default { } .logo-child { - height: 2rem; + height: 3rem; } .logo-parent { @@ -234,6 +278,14 @@ export default { height: 1rem; } +.campaign { + height: 100%; +} + +.campaign-banner { + height: 100%; +} + .content-inner { display: flex; flex-direction: column; diff --git a/assets/components/header/menu.vue b/assets/components/header/menu.vue index 10944b9ab..f1c7d5502 100644 --- a/assets/components/header/menu.vue +++ b/assets/components/header/menu.vue @@ -2,13 +2,13 @@