Skip to content

Commit

Permalink
Clarify teams for events that have similar teams
Browse files Browse the repository at this point in the history
  • Loading branch information
slmnio committed Feb 23, 2022
1 parent 194710d commit 25a7e68
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
11 changes: 11 additions & 0 deletions website/src/utils/content-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
5 changes: 5 additions & 0 deletions website/src/views/Player.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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", {
Expand All @@ -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", {
Expand All @@ -64,6 +67,7 @@ export default {
theme: ReactiveThing("theme")
}),
team_staff: ReactiveArray("team_staff", {
event: ReactiveThing("event"),
theme: ReactiveThing("theme")
}),
accolades: ReactiveArray("accolades", {
Expand All @@ -72,6 +76,7 @@ export default {
})
}),
brands_designed: ReactiveArray("brands_designed", {
event: ReactiveThing("event"),
theme: ReactiveThing("theme")
}),
socials: ReactiveArray("socials"),
Expand Down
14 changes: 9 additions & 5 deletions website/src/views/sub-views/PlayerMain.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@
</ContentRow>
<ContentRow title="Owner of" v-if="ownedTeams">
<ContentThing :thing="team" type="team" :theme="team.theme" v-for="team in ownedTeams"
v-bind:key="team.id" :show-logo="true" />
:text="clarifyTeam(team)" v-bind:key="team.id" :show-logo="true" />
</ContentRow>
<ContentRow title="Captain of" v-if="captainedTeams">
<ContentThing :thing="team" type="team" :theme="team.theme" v-for="team in captainedTeams"
v-bind:key="team.id" :show-logo="true" />
:text="clarifyTeam(team)" v-bind:key="team.id" :show-logo="true" />
</ContentRow>
<ContentRow title="Team staff for" v-if="teamStaff">
<ContentThing :thing="team" type="team" :theme="team.theme" v-for="team in teamStaff"
v-bind:key="team.id" :show-logo="true" />
:text="clarifyTeam(team)" v-bind:key="team.id" :show-logo="true" />
</ContentRow>
<ContentRow title="Brand designer for" v-if="brandsDesigned">
<ContentThing :thing="team" type="team" :theme="team.theme" v-for="team in brandsDesigned"
v-bind:key="team.id" :show-logo="true" :overrideURL="`/team/${team.id}/theme`" />
:text="clarifyTeam(team)" v-bind:key="team.id" :show-logo="true" :overrideURL="`/team/${team.id}/theme`" />
</ContentRow>
<ContentRow title="Player for" v-if="teams">
<ContentThing :thing="team" type="team" :theme="team.theme" v-for="team in teams"
v-bind:key="team.id" :show-logo="true" />
:text="clarifyTeam(team)" v-bind:key="team.id" :show-logo="true" />
</ContentRow>
<ContentRow title="Event staff for" v-if="eventStaff">
<ContentThing :thing="event" type="event" :theme="event.theme" v-for="event in eventStaff"
Expand All @@ -50,6 +50,7 @@
import ContentRow from "@/components/website/ContentRow";
import ContentThing from "@/components/website/ContentThing";
import { sortTeams, sortEvents } from "@/utils/sorts";
import { clarifyTeam } from "@/utils/content-utils";
export default {
props: ["player"],
Expand Down Expand Up @@ -135,6 +136,9 @@ export default {
return groups;
}
},
methods: {
clarifyTeam
}
};
</script>
Expand Down

0 comments on commit 25a7e68

Please sign in to comment.