From 25a7e68fcecb5cce7210a5d483b8732a707bcbf8 Mon Sep 17 00:00:00 2001 From: Solomon Cammack Date: Wed, 23 Feb 2022 20:44:57 +0000 Subject: [PATCH] Clarify teams for events that have similar teams --- website/src/utils/content-utils.js | 11 +++++++++++ website/src/views/Player.vue | 5 +++++ website/src/views/sub-views/PlayerMain.vue | 14 +++++++++----- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/website/src/utils/content-utils.js b/website/src/utils/content-utils.js index 8093a1bd..b188e9b2 100644 --- a/website/src/utils/content-utils.js +++ b/website/src/utils/content-utils.js @@ -167,3 +167,14 @@ export function money(num) { export function getAuctionMax() { return 8; } + +export function clarifyTeam(team) { + console.log({ + team, + event: team.event + }); + if (team.event && team.event.clarify_teams && team.event.short) { + return `${team.name} (${team.event.short})`; + } + return team.name; +} diff --git a/website/src/views/Player.vue b/website/src/views/Player.vue index 8fa85306..4d683c81 100644 --- a/website/src/views/Player.vue +++ b/website/src/views/Player.vue @@ -44,6 +44,7 @@ export default { player () { return ReactiveRoot(this.id, { member_of: ReactiveArray("member_of", { + event: ReactiveThing("event"), theme: ReactiveThing("theme"), accolades: ReactiveArray("accolades", { event: ReactiveThing("event", { @@ -52,9 +53,11 @@ export default { }) }), owned_teams: ReactiveArray("owned_teams", { + event: ReactiveThing("event"), theme: ReactiveThing("theme") }), captain_of: ReactiveArray("captain_of", { + event: ReactiveThing("event"), theme: ReactiveThing("theme") }), event_staff: ReactiveArray("event_staff", { @@ -64,6 +67,7 @@ export default { theme: ReactiveThing("theme") }), team_staff: ReactiveArray("team_staff", { + event: ReactiveThing("event"), theme: ReactiveThing("theme") }), accolades: ReactiveArray("accolades", { @@ -72,6 +76,7 @@ export default { }) }), brands_designed: ReactiveArray("brands_designed", { + event: ReactiveThing("event"), theme: ReactiveThing("theme") }), socials: ReactiveArray("socials"), diff --git a/website/src/views/sub-views/PlayerMain.vue b/website/src/views/sub-views/PlayerMain.vue index 1d31be70..febc9b4f 100644 --- a/website/src/views/sub-views/PlayerMain.vue +++ b/website/src/views/sub-views/PlayerMain.vue @@ -7,23 +7,23 @@ + :text="clarifyTeam(team)" v-bind:key="team.id" :show-logo="true" /> + :text="clarifyTeam(team)" v-bind:key="team.id" :show-logo="true" /> + :text="clarifyTeam(team)" v-bind:key="team.id" :show-logo="true" /> + :text="clarifyTeam(team)" v-bind:key="team.id" :show-logo="true" :overrideURL="`/team/${team.id}/theme`" /> + :text="clarifyTeam(team)" v-bind:key="team.id" :show-logo="true" />