2020-12-24 14:50:13 +01:00
|
|
|
<template>
|
|
|
|
<article class="card card-thematique search-card">
|
2020-12-25 17:37:15 +01:00
|
|
|
<header>
|
|
|
|
<a
|
|
|
|
:href="item.path"
|
|
|
|
@click.prevent="openThematique"
|
|
|
|
>
|
|
|
|
<h1>{{ item.title }}</h1>
|
|
|
|
<h4>{{ item.short_description }}</h4>
|
|
|
|
</a>
|
2020-12-24 14:50:13 +01:00
|
|
|
</header>
|
|
|
|
<section class="images" v-switcher>
|
|
|
|
<figure
|
2021-03-03 17:55:32 +01:00
|
|
|
v-for="(img, index) in item.images"
|
2020-12-24 14:50:13 +01:00
|
|
|
:key="img.url"
|
2021-07-12 12:50:40 +02:00
|
|
|
class="lazy"
|
|
|
|
v-lazy="index"
|
2020-12-24 14:50:13 +01:00
|
|
|
>
|
|
|
|
<img
|
2020-12-25 17:37:15 +01:00
|
|
|
:data-src="img.style_cardmedium_url"
|
2020-12-24 14:50:13 +01:00
|
|
|
:title="img.title"
|
|
|
|
/>
|
|
|
|
<img
|
|
|
|
class="blank"
|
|
|
|
:src="blanksrc"
|
2021-03-09 14:29:28 +01:00
|
|
|
@click.prevent="openThematique"
|
2020-12-24 14:50:13 +01:00
|
|
|
>
|
|
|
|
</figure>
|
|
|
|
</section>
|
2021-03-09 14:29:28 +01:00
|
|
|
<!-- <CoolLightBox
|
2021-03-03 17:55:32 +01:00
|
|
|
:items="item.images"
|
2020-12-24 14:50:13 +01:00
|
|
|
:index="lightbox_index"
|
2020-12-25 17:37:15 +01:00
|
|
|
srcName="style_hd_url"
|
2020-12-24 14:50:13 +01:00
|
|
|
:loop="true"
|
|
|
|
@close="lightbox_index = null">
|
2021-03-09 14:29:28 +01:00
|
|
|
</CoolLightBox> -->
|
2020-12-24 14:50:13 +01:00
|
|
|
</article>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { mapState, mapActions } from 'vuex'
|
|
|
|
import cardMixins from 'vuejs/components/cardMixins'
|
|
|
|
// import ModalCard from 'vuejs/components/Content/ModalCard'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: "Card",
|
|
|
|
props: ['item'],
|
|
|
|
mixins: [cardMixins],
|
|
|
|
// components: {
|
|
|
|
// ModalCard
|
|
|
|
// },
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
blanksrc:`${drupalSettings.path.themePath}/assets/img/blank.gif`,
|
|
|
|
// loadingFlag: false,
|
2020-12-25 17:37:15 +01:00
|
|
|
lightbox_index: null,
|
2021-03-03 17:55:32 +01:00
|
|
|
alias: this.item.path.replace(/^.*\/thematique\//g, '')
|
2020-12-24 14:50:13 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
// computed: {
|
|
|
|
// ...mapState({
|
|
|
|
// flagcolls: state => state.User.flagcolls
|
|
|
|
// })
|
|
|
|
// },
|
|
|
|
methods: {
|
|
|
|
// ...mapActions({
|
|
|
|
// flagUnflag: 'User/flagUnflag'
|
|
|
|
// }),
|
|
|
|
// flagIsActive(collid) {
|
|
|
|
// // console.log("Card flagIsActive",
|
|
|
|
// // this.item.id,
|
|
|
|
// // this.flagcolls[collid].items,
|
|
|
|
// // this.flagcolls[collid].items.indexOf(this.item.id)
|
|
|
|
// // );
|
2021-03-31 18:42:05 +02:00
|
|
|
// // console.log(this.flagcolls[collid].items_uuids)
|
2020-12-24 14:50:13 +01:00
|
|
|
// // return this.flagcolls[collid].items_uuids.indexOf(this.item.uuid) !== -1;
|
|
|
|
// return this.flagcolls[collid].items.indexOf(this.item.id) !== -1;
|
|
|
|
// },
|
|
|
|
// flagIsLoading(collid) {
|
2021-03-31 18:42:05 +02:00
|
|
|
// // console.log(this.item.uuid)
|
|
|
|
// // console.log(this.flagcolls[collid].items_uuids)
|
2020-12-24 14:50:13 +01:00
|
|
|
// return collid === this.loadingFlag;
|
|
|
|
// },
|
|
|
|
// onFlagActionCard (e) {
|
2021-03-31 18:42:05 +02:00
|
|
|
// console.log("Card onFlagActionCard", e, this.item)
|
2020-12-24 14:50:13 +01:00
|
|
|
// if (!this.loadingFlag) {
|
|
|
|
// let collid = e.target.getAttribute('collid');
|
|
|
|
// let isActive = this.flagIsActive(collid);
|
|
|
|
// let action = isActive ? 'unflag' : 'flag';
|
2021-03-31 18:42:05 +02:00
|
|
|
// // console.log('collid', collid)
|
|
|
|
// // console.log("this.item", this.item)
|
2020-12-24 14:50:13 +01:00
|
|
|
// this.loadingFlag = collid;
|
|
|
|
// this.flagUnflag({ action: action, id: this.item.id, collid: collid})
|
|
|
|
// .then(data => {
|
2021-03-31 18:42:05 +02:00
|
|
|
// console.log("onFlagActionCard then", data)
|
2020-12-24 14:50:13 +01:00
|
|
|
// this.loadingFlag = false;
|
|
|
|
// })
|
|
|
|
// }
|
|
|
|
// },
|
|
|
|
openThematique (e) {
|
2021-03-31 18:42:05 +02:00
|
|
|
console.log('openThematique', e, this.alias)
|
2020-12-25 17:37:15 +01:00
|
|
|
this.$router.push({
|
|
|
|
name:`thematique`,
|
2021-03-06 16:46:19 +01:00
|
|
|
params: { alias:this.alias, id: this.item.id }
|
|
|
|
// query: { id: this.item.id },
|
|
|
|
// meta: { id:this.item.id }
|
2020-12-25 17:37:15 +01:00
|
|
|
})
|
2020-12-24 14:50:13 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
|
|
</style>
|