Added setting to disable campaigns.

This commit is contained in:
DebaucheryLibrarian 2023-07-02 05:13:40 +02:00
parent 4a3674feac
commit 57a8b8e2f6
6 changed files with 59 additions and 4 deletions

View File

@ -96,7 +96,10 @@
/> />
</Scroll> </Scroll>
<div class="campaign-container"> <div
v-if="config.campaigns.entity"
class="campaign-container"
>
<Campaign <Campaign
:entity="entity" :entity="entity"
:min-ratio="3" :min-ratio="3"

View File

@ -1,7 +1,10 @@
<template> <template>
<div class="home"> <div class="home">
<div class="content-inner"> <div class="content-inner">
<div class="campaign-container"> <div
v-if="config.campaigns.home"
class="campaign-container"
>
<Campaign <Campaign
:min-ratio="6" :min-ratio="6"
/> />
@ -35,6 +38,8 @@
</template> </template>
<script> <script>
import config from 'config';
import FilterBar from '../filters/filter-bar.vue'; import FilterBar from '../filters/filter-bar.vue';
import Releases from '../releases/releases.vue'; import Releases from '../releases/releases.vue';
import Pagination from '../pagination/pagination.vue'; import Pagination from '../pagination/pagination.vue';
@ -76,7 +81,7 @@ export default {
releases: [], releases: [],
networks: [], networks: [],
pageTitle: null, pageTitle: null,
limit: 29, // reserve one campaign spot limit: 30 - config.campaigns.tiles, // reserve one campaign spot
totalCount: 0, totalCount: 0,
from: null, from: null,
done: false, done: false,

View File

@ -55,6 +55,8 @@
</template> </template>
<script setup> <script setup>
import config from 'config';
import { defineProps, defineEmits, computed } from 'vue'; import { defineProps, defineEmits, computed } from 'vue';
import { useStore } from 'vuex'; import { useStore } from 'vuex';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
@ -97,7 +99,7 @@ const props = defineProps({
const campaignIndex = computed(() => Math.floor(Math.random() * props.releases.length - 5) + 5); const campaignIndex = computed(() => Math.floor(Math.random() * props.releases.length - 5) + 5);
const items = computed(() => props.releases.flatMap((release, index) => (props.releases.length > 10 && index === campaignIndex.value ? ['campaign', release] : release))); const items = computed(() => props.releases.flatMap((release, index) => (config.campaigns.tiles && props.releases.length > 10 && index === campaignIndex.value ? ['campaign', release] : release)));
const range = computed(() => router.route?.params.range); const range = computed(() => router.route?.params.range);
const sfw = computed(() => store.state.ui.sfw); const sfw = computed(() => store.state.ui.sfw);

View File

@ -7,6 +7,11 @@ export default {
mediaPath: '/media', mediaPath: '/media',
s3Path: 'https://s3.wasabisys.com', s3Path: 'https://s3.wasabisys.com',
}, },
campaigns: {
home: true,
entity: true,
tiles: 0,
},
showDisclaimer: false, showDisclaimer: false,
disclaimer: 'This site is in early development, and content may occasionally disappear. Please stay tuned, you will be able to use traxxx to its full potential in the near future!', disclaimer: 'This site is in early development, and content may occasionally disappear. Please stay tuned, you will be able to use traxxx to its full potential in the near future!',
selectableTags: [ selectableTags: [

39
package-lock.json generated
View File

@ -55,6 +55,7 @@
"knex": "^0.95.12", "knex": "^0.95.12",
"knex-migrate": "^1.7.4", "knex-migrate": "^1.7.4",
"longjohn": "^0.2.12", "longjohn": "^0.2.12",
"merge-anything": "^5.1.7",
"mime": "^2.4.4", "mime": "^2.4.4",
"mitt": "^3.0.0", "mitt": "^3.0.0",
"moment": "^2.24.0", "moment": "^2.24.0",
@ -10581,6 +10582,17 @@
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/is-what": {
"version": "4.1.15",
"resolved": "https://registry.npmjs.org/is-what/-/is-what-4.1.15.tgz",
"integrity": "sha512-uKua1wfy3Yt+YqsD6mTUEa2zSi3G1oPlqTflgaPJ7z63vUGN5pxFpnQfeSLMFnJDEsdvOtkp1rUWkYjB4YfhgA==",
"engines": {
"node": ">=12.13"
},
"funding": {
"url": "https://github.com/sponsors/mesqueeb"
}
},
"node_modules/is-windows": { "node_modules/is-windows": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz",
@ -11602,6 +11614,20 @@
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"node_modules/merge-anything": {
"version": "5.1.7",
"resolved": "https://registry.npmjs.org/merge-anything/-/merge-anything-5.1.7.tgz",
"integrity": "sha512-eRtbOb1N5iyH0tkQDAoQ4Ipsp/5qSR79Dzrz8hEPxRX10RWWR/iQXdoKmBSRCThY1Fh5EhISDtpSc93fpxUniQ==",
"dependencies": {
"is-what": "^4.1.8"
},
"engines": {
"node": ">=12.13"
},
"funding": {
"url": "https://github.com/sponsors/mesqueeb"
}
},
"node_modules/merge-deep": { "node_modules/merge-deep": {
"version": "3.0.3", "version": "3.0.3",
"resolved": "https://registry.npmjs.org/merge-deep/-/merge-deep-3.0.3.tgz", "resolved": "https://registry.npmjs.org/merge-deep/-/merge-deep-3.0.3.tgz",
@ -27103,6 +27129,11 @@
"call-bind": "^1.0.2" "call-bind": "^1.0.2"
} }
}, },
"is-what": {
"version": "4.1.15",
"resolved": "https://registry.npmjs.org/is-what/-/is-what-4.1.15.tgz",
"integrity": "sha512-uKua1wfy3Yt+YqsD6mTUEa2zSi3G1oPlqTflgaPJ7z63vUGN5pxFpnQfeSLMFnJDEsdvOtkp1rUWkYjB4YfhgA=="
},
"is-windows": { "is-windows": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz",
@ -27903,6 +27934,14 @@
} }
} }
}, },
"merge-anything": {
"version": "5.1.7",
"resolved": "https://registry.npmjs.org/merge-anything/-/merge-anything-5.1.7.tgz",
"integrity": "sha512-eRtbOb1N5iyH0tkQDAoQ4Ipsp/5qSR79Dzrz8hEPxRX10RWWR/iQXdoKmBSRCThY1Fh5EhISDtpSc93fpxUniQ==",
"requires": {
"is-what": "^4.1.8"
}
},
"merge-deep": { "merge-deep": {
"version": "3.0.3", "version": "3.0.3",
"resolved": "https://registry.npmjs.org/merge-deep/-/merge-deep-3.0.3.tgz", "resolved": "https://registry.npmjs.org/merge-deep/-/merge-deep-3.0.3.tgz",

View File

@ -114,6 +114,7 @@
"knex": "^0.95.12", "knex": "^0.95.12",
"knex-migrate": "^1.7.4", "knex-migrate": "^1.7.4",
"longjohn": "^0.2.12", "longjohn": "^0.2.12",
"merge-anything": "^5.1.7",
"mime": "^2.4.4", "mime": "^2.4.4",
"mitt": "^3.0.0", "mitt": "^3.0.0",
"moment": "^2.24.0", "moment": "^2.24.0",