[census] add banner
This commit is contained in:
parent
ff76be9c1b
commit
a6047e0854
|
@ -84,10 +84,18 @@
|
||||||
</nuxt-link>
|
</nuxt-link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="locales[config.locale].published === false" class="alert alert-warning">
|
<div v-if="locales[config.locale].published === false" class="alert alert-warning mt-3">
|
||||||
<Icon v="exclamation-triangle"/>
|
<Icon v="exclamation-triangle"/>
|
||||||
This language version is still under construction!
|
This language version is still under construction!
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="showCensus" class="alert alert-info mt-3">
|
||||||
|
<a href="#" class="float-right" @click.prevent="dismissCensus">
|
||||||
|
<Icon v="times"/>
|
||||||
|
</a>
|
||||||
|
<Icon v="user-chart" size="2" class="d-inline-block float-left mr-3 mt-2"/>
|
||||||
|
<T>census.banner</T>
|
||||||
|
|
||||||
|
</div>
|
||||||
</header>
|
</header>
|
||||||
<header v-else class="mb-4">
|
<header v-else class="mb-4">
|
||||||
<h1 class="text-nowrap">
|
<h1 class="text-nowrap">
|
||||||
|
@ -101,12 +109,14 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapState } from 'vuex'
|
import { mapState } from 'vuex'
|
||||||
|
import {DateTime} from "luxon";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
hamburgerActive: false,
|
hamburgerActive: false,
|
||||||
hamburgerShown: false,
|
hamburgerShown: false,
|
||||||
|
censusDismissed: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -230,6 +240,21 @@
|
||||||
|
|
||||||
return links;
|
return links;
|
||||||
},
|
},
|
||||||
|
showCensus() {
|
||||||
|
if (!process.client) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const finished = !!parseInt(window.localStorage.getItem('census-finished') || 0);
|
||||||
|
const dismissed = !!parseInt(window.localStorage.getItem('census-dismissed') || 0);
|
||||||
|
const alreadyIn = this.$route.path === '/' + this.config.census.route;
|
||||||
|
if (!this.config.census.enabled || finished || dismissed || this.censusDismissed || alreadyIn) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const start = DateTime.fromISO(this.config.census.start).toLocal();
|
||||||
|
const end = DateTime.fromISO(this.config.census.end).toLocal();
|
||||||
|
const now = DateTime.utc().setZone(this.config.format.timezone);
|
||||||
|
return now >= start && now <= end;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
isActiveRoute(link) {
|
isActiveRoute(link) {
|
||||||
|
@ -250,6 +275,10 @@
|
||||||
const st = document.body.scrollTop || document.querySelector('html').scrollTop;
|
const st = document.body.scrollTop || document.querySelector('html').scrollTop;
|
||||||
this.hamburgerShown = st > 300;
|
this.hamburgerShown = st > 300;
|
||||||
},
|
},
|
||||||
|
dismissCensus() {
|
||||||
|
window.localStorage.setItem('census-dismissed', '1');
|
||||||
|
this.censusDismissed = true;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
if (process.client) {
|
if (process.client) {
|
||||||
|
|
|
@ -946,6 +946,10 @@ profile:
|
||||||
census:
|
census:
|
||||||
header: 'Spis'
|
header: 'Spis'
|
||||||
headerLong: 'Niebinarny spis powszechny'
|
headerLong: 'Niebinarny spis powszechny'
|
||||||
|
banner: >
|
||||||
|
Trwa „Niebinarny spis powszechny”!
|
||||||
|
Jeśli jesteś osobą niebinarną i chcesz nam pomóc zbadać, jakiego języka używamy by się wyrażać,
|
||||||
|
{/spis=kliknij tutaj, by wypełnić formularz}.
|
||||||
description:
|
description:
|
||||||
- >
|
- >
|
||||||
Ciekawi Cię, jakiego języka używają polskie osoby niebinarne?
|
Ciekawi Cię, jakiego języka używają polskie osoby niebinarne?
|
||||||
|
|
Reference in New Issue