forked from DebaucheryLibrarian/traxxx
189 lines
3.9 KiB
Vue
189 lines
3.9 KiB
Vue
<template>
|
|
<div
|
|
v-if="network"
|
|
class="content"
|
|
>
|
|
<FilterBar :fetch-releases="fetchNetwork" />
|
|
|
|
<div class="network">
|
|
<div class="sidebar">
|
|
<a
|
|
:href="network.url"
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
class="title"
|
|
>
|
|
<img
|
|
:src="`/img/logos/${network.slug}/network.png`"
|
|
class="logo"
|
|
>
|
|
</a>
|
|
|
|
<p
|
|
v-if="network.description"
|
|
class="description"
|
|
>{{ network.description }}</p>
|
|
|
|
<Sites
|
|
v-if="sites.length"
|
|
:sites="sites"
|
|
/>
|
|
</div>
|
|
|
|
<div class="header">
|
|
<a
|
|
:href="network.url"
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
class="title"
|
|
>
|
|
<img
|
|
:src="`/img/logos/${network.slug}/network.png`"
|
|
class="logo"
|
|
>
|
|
</a>
|
|
</div>
|
|
|
|
<div class="content-inner">
|
|
<Sites
|
|
v-if="sites.length"
|
|
:sites="sites"
|
|
class="compact"
|
|
/>
|
|
|
|
<Releases :releases="releases" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import FilterBar from '../header/filter-bar.vue';
|
|
import Releases from '../releases/releases.vue';
|
|
import Sites from '../sites/sites.vue';
|
|
|
|
async function fetchNetwork() {
|
|
this.network = await this.$store.dispatch('fetchNetworks', this.$route.params.networkSlug);
|
|
|
|
this.sites = this.network.sites
|
|
.filter(site => !site.independent)
|
|
.sort(({ name: nameA }, { name: nameB }) => nameA.localeCompare(nameB));
|
|
|
|
this.releases = this.network.sites.map(site => site.releases).flat();
|
|
}
|
|
|
|
async function mounted() {
|
|
await this.fetchNetwork();
|
|
this.pageTitle = this.network.name;
|
|
}
|
|
|
|
export default {
|
|
components: {
|
|
FilterBar,
|
|
Releases,
|
|
Sites,
|
|
},
|
|
data() {
|
|
return {
|
|
network: null,
|
|
sites: null,
|
|
releases: [],
|
|
pageTitle: null,
|
|
};
|
|
},
|
|
mounted,
|
|
methods: {
|
|
fetchNetwork,
|
|
},
|
|
};
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
@import 'theme';
|
|
|
|
@media(max-width: $breakpoint3) {
|
|
.releases .tiles {
|
|
grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
|
|
}
|
|
}
|
|
</style>
|
|
|
|
<style lang="scss" scoped>
|
|
@import 'theme';
|
|
|
|
.network {
|
|
display: flex;
|
|
flex-direction: row;
|
|
flex-grow: 1;
|
|
justify-content: stretch;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.sidebar {
|
|
height: 100%;
|
|
width: 18rem;
|
|
display: flex;
|
|
flex-direction: column;
|
|
flex-shrink: 0;
|
|
color: $text-contrast;
|
|
border-right: solid 1px $shadow-hint;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.sidebar .title {
|
|
border-bottom: solid 1px $shadow-hint;
|
|
}
|
|
|
|
.logo {
|
|
width: 100%;
|
|
max-height: 8rem;
|
|
display: flex;
|
|
justify-content: center;
|
|
object-fit: contain;
|
|
box-sizing: border-box;
|
|
padding: 1rem;
|
|
margin: 0;
|
|
filter: $logo-shadow;
|
|
}
|
|
|
|
.sites.compact {
|
|
display: none;
|
|
}
|
|
|
|
.header {
|
|
width: 100%;
|
|
height: 4rem;
|
|
display: none;
|
|
justify-content: center;
|
|
border-bottom: solid 1px $shadow-hint;
|
|
}
|
|
|
|
@media(max-width: $breakpoint) {
|
|
.header {
|
|
display: flex;
|
|
}
|
|
|
|
.sites.compact {
|
|
display: flex;
|
|
padding: 0 1rem 1rem 1rem;
|
|
}
|
|
|
|
.network {
|
|
flex-direction: column;
|
|
}
|
|
|
|
.logo {
|
|
max-width: 20rem;
|
|
height: 100%;
|
|
padding: .5rem;
|
|
}
|
|
|
|
.sidebar {
|
|
display: none;
|
|
height: auto;
|
|
width: 100%;
|
|
overflow: hidden;
|
|
}
|
|
}
|
|
</style>
|