replaced coollightbox src by watermarked img

This commit is contained in:
Bachir Soussi Chiadmi 2020-12-25 11:33:39 +01:00
parent c1f117d7bb
commit f65e8fb140
9 changed files with 95 additions and 95 deletions

View File

@ -148,9 +148,15 @@ type Image {
url: String! url: String!
alt: String alt: String
style_minicard: ImageStyle style_minicard: ImageStyle
style_minicard_url: String
style_cardmedium: ImageStyle style_cardmedium: ImageStyle
style_cardmedium_url: String
style_cardfull: ImageStyle style_cardfull: ImageStyle
style_cardfull_url: String
style_articlecardmedium: ImageStyle style_articlecardmedium: ImageStyle
style_articlecardmedium_url: String
style_hd: ImageStyle
style_hd_url: String
} }
type ImageStyle { type ImageStyle {

View File

@ -457,24 +457,80 @@ class MaterioSchemaExtension extends SdlSchemaExtensionPluginBase {
->map('style', $builder->fromValue('card_medium_half')) ->map('style', $builder->fromValue('card_medium_half'))
); );
$registry->addFieldResolver('Image', 'style_minicard_url',
$builder->compose(
$builder->produce('image_derivative')
->map('entity', $builder->fromParent())
->map('style', $builder->fromValue('card_medium_half')),
$builder->callback(function($parent, $args){
return $parent['url'];
})
));
$registry->addFieldResolver('Image', 'style_cardmedium', $registry->addFieldResolver('Image', 'style_cardmedium',
$builder->produce('image_derivative') $builder->produce('image_derivative')
->map('entity', $builder->fromParent()) ->map('entity', $builder->fromParent())
->map('style', $builder->fromValue('card_medium')) ->map('style', $builder->fromValue('card_medium'))
); );
$registry->addFieldResolver('Image', 'style_cardmedium_url',
$builder->compose(
$builder->produce('image_derivative')
->map('entity', $builder->fromParent())
->map('style', $builder->fromValue('card_medium')),
$builder->callback(function($parent, $args){
return $parent['url'];
})
));
$registry->addFieldResolver('Image', 'style_cardfull', $registry->addFieldResolver('Image', 'style_cardfull',
$builder->produce('image_derivative') $builder->produce('image_derivative')
->map('entity', $builder->fromParent()) ->map('entity', $builder->fromParent())
->map('style', $builder->fromValue('card_full')) ->map('style', $builder->fromValue('card_full'))
); );
$registry->addFieldResolver('Image', 'style_cardfull_url',
$builder->compose(
$builder->produce('image_derivative')
->map('entity', $builder->fromParent())
->map('style', $builder->fromValue('card_full')),
$builder->callback(function($parent, $args){
return $parent['url'];
})
));
$registry->addFieldResolver('Image', 'style_articlecardmedium', $registry->addFieldResolver('Image', 'style_articlecardmedium',
$builder->produce('image_derivative') $builder->produce('image_derivative')
->map('entity', $builder->fromParent()) ->map('entity', $builder->fromParent())
->map('style', $builder->fromValue('article_card_medium')) ->map('style', $builder->fromValue('article_card_medium'))
); );
$registry->addFieldResolver('Image', 'style_articlecardmedium_url',
$builder->compose(
$builder->produce('image_derivative')
->map('entity', $builder->fromParent())
->map('style', $builder->fromValue('article_card_medium')),
$builder->callback(function($parent, $args){
return $parent['url'];
})
));
$registry->addFieldResolver('Image', 'style_hd',
$builder->produce('image_derivative')
->map('entity', $builder->fromParent())
->map('style', $builder->fromValue('hd'))
);
$registry->addFieldResolver('Image', 'style_hd_url',
$builder->compose(
$builder->produce('image_derivative')
->map('entity', $builder->fromParent())
->map('style', $builder->fromValue('hd')),
$builder->callback(function($parent, $args){
return $parent['url'];
})
));
} }
// __ ___ _ _ _ _ // __ ___ _ _ _ _

View File

@ -1835,7 +1835,7 @@ article.card {
display: inline-block; display: inline-block;
vertical-align: top; vertical-align: top;
width: 205px; width: 205px;
margin: 0 13px 0 0; } margin: 0 13px 13px 0; }
#main-content > article.article aside.linked-materials h3.field__label { #main-content > article.article aside.linked-materials h3.field__label {
font-size: 1em; font-size: 1em;

File diff suppressed because one or more lines are too long

View File

@ -998,7 +998,7 @@ article.card{
display: inline-block; display: inline-block;
vertical-align: top; vertical-align: top;
width:$column_width; width:$column_width;
margin:0 $column_goutiere 0 0; margin:0 $column_goutiere $column_goutiere 0;
} }
} }
h3.field__label{ h3.field__label{

View File

@ -14,67 +14,31 @@ fragment ArticleFields on Article {
body body
showroom { showroom {
id id
uuid
name name
} }
tags { tags {
id id
uuid
name name
} }
thesaurus { thesaurus {
id id
uuid
name name
} }
linked_materials { linked_materials {
id id
title title
memo short_description
body
images { images {
id
url url
alt style_cardmedium_url
style_minicard{ style_hd_url
width
height
url
}
style_cardmedium{
width
height
url
}
style_cardfull{
width
height
url
}
} }
} }
images { images {
id id
url url
alt alt
style_minicard{
width
height
url
}
style_cardmedium{
width
height
url
}
style_cardfull{
width
height
url
}
style_articlecardmedium{ style_articlecardmedium{
width
height
url url
} }
} }

View File

@ -3,11 +3,11 @@
<header <header
@click="openModalCard" @click="openModalCard"
> >
<h1>{{ item.title }}</h1> <h1 v-if="isloggedin">{{ item.title }}</h1>
<h4>{{ item.short_description }}</h4> <h4>{{ item.short_description }}</h4>
<span class="ref">{{ item.reference }}</span> <span v-if="isloggedin" class="ref">{{ item.reference }}</span>
</header> </header>
<nav class="tools"> <nav class="tools" v-if="isloggedin">
<section class="tool flags"> <section class="tool flags">
<span class="btn mdi mdi-folder-outline"/> <span class="btn mdi mdi-folder-outline"/>
<div class="tool-content"> <div class="tool-content">
@ -21,7 +21,7 @@
:collid="coll.id" :collid="coll.id"
@click.prevent="onFlagActionCard" @click.prevent="onFlagActionCard"
> >
{{ coll.name }} {{ coll.name }}
</span> </span>
</li> </li>
</ul> </ul>
@ -36,7 +36,7 @@
<img <img
class="lazy" class="lazy"
v-lazy="index" v-lazy="index"
:data-src="img.style_cardmedium.url" :data-src="img.style_cardmedium_url"
:title="img.title" :title="img.title"
/> />
<img <img
@ -47,9 +47,10 @@
</figure> </figure>
</section> </section>
<CoolLightBox <CoolLightBox
v-if="isloggedin"
:items="item.images" :items="item.images"
:index="lightbox_index" :index="lightbox_index"
srcName="url" srcName="style_hd_url"
:loop="true" :loop="true"
@close="lightbox_index = null"> @close="lightbox_index = null">
</CoolLightBox> </CoolLightBox>
@ -77,7 +78,8 @@ export default {
}, },
computed: { computed: {
...mapState({ ...mapState({
flagcolls: state => state.User.flagcolls flagcolls: state => state.User.flagcolls,
isloggedin: state => state.User.isloggedin
}) })
}, },
methods: { methods: {
@ -116,15 +118,17 @@ export default {
} }
}, },
openModalCard (e) { openModalCard (e) {
this.$modal.show( if(this.isLoggedin){
ModalCard, this.$modal.show(
{ item: this.item }, ModalCard,
{ { item: this.item },
draggable: true, {
width: '850px', draggable: true,
height: '610px' width: '850px',
} height: '610px'
) }
)
}
} }
} }
} }

View File

@ -287,7 +287,7 @@ export default {
}); });
} }
console.log('this.content.lightbox_items', this.lightbox_items); // console.log('this.content.lightbox_items', this.lightbox_items);
// update main page title // update main page title
this.$store.commit('Common/setPagetitle', article.title) this.$store.commit('Common/setPagetitle', article.title)
@ -296,32 +296,12 @@ export default {
}, },
onPrevNext(a){ onPrevNext(a){
// console.log('clicked on next', this.prevnext.next); // console.log('clicked on next', this.prevnext.next);
// let alias = this.prevnext.next.view_node.replace(/^.?\/blabla\//g, '')
let alias = a.replace(/^.?\/blabla\//g, '') let alias = a.replace(/^.?\/blabla\//g, '')
this.$router.push({ this.$router.push({
name:`article`, name:`article`,
params: { alias:alias } params: { alias:alias }
// query: { uuid: this.prevnext.next.uuid }
}) })
}, },
// onNext(){
// // console.log('clicked on next', this.prevnext.next);
// let alias = this.prevnext.next.view_node.replace(/^.?\/blabla\//g, '')
// this.$router.push({
// name:`article`,
// params: { alias:alias }
// // query: { uuid: this.prevnext.next.uuid }
// })
// },
// onPrev(){
// // console.log('clicked on prev', this.prevnext.next);
// let alias = this.prevnext.prev.view_node.replace(/^.?\/blabla\//g, '')
// this.$router.push({
// name:`article`,
// params: { alias:alias }
// // query: { uuid: this.prevnext.prev.uuid }
// })
// },
setLightboxIndex(index) { setLightboxIndex(index) {
this.lightbox_index = index this.lightbox_index = index
} }

View File

@ -35,16 +35,6 @@ export default {
// actions // actions
actions: { actions: {
getItems ({ dispatch, commit, state }) { getItems ({ dispatch, commit, state }) {
// if(!state.contenttype){
// REST.get('/entity/node_type/article?_format=json', {})
// .then(({ data }) => {
// console.log('blabla REST contenttype : data', data);
// })
// .catch(( error ) => {
// console.warn('Issue with blabla contenttype', error)
// Promise.reject(error)
// })
// }
return REST.get(`/blabla_rest?_format=json&page=${state.page}`, {}) return REST.get(`/blabla_rest?_format=json&page=${state.page}`, {})
.then(({ data }) => { .then(({ data }) => {
console.log('blabla REST: data', data) console.log('blabla REST: data', data)
@ -70,8 +60,8 @@ export default {
getItemIndex ({ dispatch, commit, state }, nid) { getItemIndex ({ dispatch, commit, state }, nid) {
console.log('getItemIndex nid', nid) console.log('getItemIndex nid', nid)
return state.items.findIndex((e) => { return state.items.findIndex((e) => {
// console.log('findIndex', e, nid); console.log('findIndex', e.nid, nid);
return e.nid === nid return e.nid == nid
}) })
}, },
getPrevNextItems ({ dispatch, commit, state }, index) { getPrevNextItems ({ dispatch, commit, state }, index) {