This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Zaimki/routes/faq.vue

90 lines
2.6 KiB
Vue
Raw Permalink Normal View History

2020-10-10 09:31:31 -07:00
<template>
2020-11-29 02:03:01 -08:00
<div>
2021-05-13 04:54:13 -07:00
<LinksNav v-if="config.links.enabled"/>
2021-10-16 09:34:11 -07:00
<h2 class="mb-4">
2020-10-10 09:31:31 -07:00
<Icon v="map-marker-question"/>
<T>faq.headerLong</T>
</h2>
2021-10-16 09:34:11 -07:00
<section>
<div class="input-group mb-3 bg-white">
<span class="input-group-text">
<Icon v="filter"/>
</span>
<input class="form-control border-primary" v-model="filter" :placeholder="$t('crud.filterLong')" ref="filter"/>
<button v-if="filter" class="btn btn-outline-danger" @click="filter = ''; $refs.filter.focus()">
<Icon v="times"/>
</button>
</div>
</section>
<details class="border mb-3" open v-show="!filter || $t('home.mission.header').toLowerCase().includes(filter.toLowerCase())">
2021-09-05 10:44:54 -07:00
<summary class="d-none"/>
<div class="px-3">
<Mission/>
</div>
</details>
2021-07-24 05:55:24 -07:00
2021-09-05 10:44:54 -07:00
<Answer v-for="question in Object.keys($t('faq.questions'))" :key="question"
:question="question"
:id="question" :ref="question.replace(/-/g, '_')"
@click="setHash('', question)"
2021-10-16 09:34:11 -07:00
v-show="!filter
|| $t(`faq.questions.${question}.question`).toLowerCase().includes(filter.toLowerCase())
|| $t(`faq.questions.${question}.answer`).join('|').toLowerCase().includes(filter.toLowerCase())"
2021-09-05 10:44:54 -07:00
/>
2020-10-11 07:27:21 -07:00
<section>
<Share :title="$t('faq.headerLong')"/>
</section>
2020-10-10 09:31:31 -07:00
</div>
</template>
<script>
2020-10-10 10:28:01 -07:00
import { head } from "../src/helpers";
import hash from "../plugins/hash";
2020-10-10 10:28:01 -07:00
2020-10-10 09:31:31 -07:00
export default {
mixins: [ hash ],
2021-10-16 09:34:11 -07:00
data() {
return {
filter: '',
}
},
2020-10-10 09:31:31 -07:00
mounted() {
this.handleHash('', hash => {
2021-04-08 05:37:31 -07:00
const $component = this.$refs[hash.replace(/-/g, '_')];
if (!$component) {
2020-10-10 09:31:31 -07:00
return;
}
2021-04-08 05:37:31 -07:00
const $el = $component[0].$el;
$el.open = true;
$el.focus();
$el.scrollIntoView();
2020-10-10 09:31:31 -07:00
setTimeout(_ => {
2021-04-08 05:37:31 -07:00
$el.scrollIntoView();
2020-10-10 09:31:31 -07:00
}, 1000);
}, false)
2020-10-10 09:31:31 -07:00
},
2020-10-10 10:28:01 -07:00
head() {
return head({
title: this.$t('faq.headerLong'),
});
},
2020-10-10 09:31:31 -07:00
};
</script>
<style lang="scss" scoped>
2021-10-16 09:34:11 -07:00
@import "assets/variables";
2020-10-10 09:31:31 -07:00
details {
summary {
font-weight: bold;
}
2021-10-16 09:34:11 -07:00
&[open] {
box-shadow: $box-shadow;
}
2020-10-10 09:31:31 -07:00
}
</style>