forked from DebaucheryLibrarian/traxxx
109 lines
1.7 KiB
Vue
109 lines
1.7 KiB
Vue
<template>
|
|
<div class="releases">
|
|
<h3
|
|
v-if="context"
|
|
class="heading"
|
|
><span class="range">{{ range }}</span> releases for '{{ context }}'</h3>
|
|
|
|
<ul
|
|
:key="sfw"
|
|
v-lazy-container="{ selector: '.thumbnail' }"
|
|
class="nolist tiles"
|
|
>
|
|
<li
|
|
v-for="(release, index) in releases"
|
|
:key="`release-${release.id}`"
|
|
>
|
|
<ReleaseTile
|
|
:release="release"
|
|
:referer="referer"
|
|
:index="index"
|
|
/>
|
|
</li>
|
|
</ul>
|
|
|
|
<span
|
|
v-if="releases.length === 0 && range !== 'all'"
|
|
class="empty"
|
|
>No {{ range }} releases</span>
|
|
|
|
<span
|
|
v-else-if="releases.length === 0"
|
|
class="empty"
|
|
>No recent or upcoming releases</span>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import ReleaseTile from '../tile/release.vue';
|
|
|
|
function range() {
|
|
return this.$route.params.range;
|
|
}
|
|
|
|
function sfw() {
|
|
return this.$store.state.ui.sfw;
|
|
}
|
|
|
|
export default {
|
|
components: {
|
|
ReleaseTile,
|
|
},
|
|
props: {
|
|
releases: {
|
|
type: Array,
|
|
default: () => [],
|
|
},
|
|
context: {
|
|
type: String,
|
|
default: null,
|
|
},
|
|
referer: {
|
|
type: String,
|
|
default: null,
|
|
},
|
|
},
|
|
computed: {
|
|
range,
|
|
sfw,
|
|
},
|
|
};
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
@import 'theme';
|
|
|
|
.heading {
|
|
padding: 0;
|
|
margin: 0 0 1rem 0;
|
|
|
|
.range {
|
|
text-transform: capitalize;
|
|
}
|
|
}
|
|
|
|
.tiles {
|
|
width: 100%;
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr));
|
|
grid-gap: 1rem;
|
|
}
|
|
|
|
.empty {
|
|
color: var(--shadow-strong);
|
|
font-weight: bold;
|
|
}
|
|
|
|
@media(max-width: $breakpoint3) {
|
|
.tiles {
|
|
grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
|
|
}
|
|
}
|
|
|
|
@media(max-width: $breakpoint2) {
|
|
.tiles {
|
|
grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
|
|
}
|
|
}
|
|
</style>
|