7 lines
9.6 KiB
JavaScript
7 lines
9.6 KiB
JavaScript
(self.webpackChunkmaterio_com=self.webpackChunkmaterio_com||[]).push([[282],{8964:e=>{var t={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"ThematiqueFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Thematique"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"title"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"body"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"tags"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"linked_materials"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"title"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"short_description"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"images"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"style_cardmedium_url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"style_hd_url"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"samples"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"showroom"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"location"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"images"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"alt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"style_cardfull_url"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:374}};t.loc.source={body:"fragment ThematiqueFields on Thematique {\n id\n title\n body\n tags {\n id\n name\n }\n linked_materials {\n id\n title\n short_description\n images {\n url\n style_cardmedium_url\n style_hd_url\n }\n \tsamples{\n showroom{\n name\n id\n }\n location\n }\n }\n images {\n id\n url\n alt\n style_cardfull_url\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};e.exports=t},6024:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("article",{staticClass:"card search-card"},[i("header",{on:{click:function(t){return t.preventDefault(),e.openModalCard(t)}}},[e.isloggedin?i("h1",[e._v(e._s(e.item.title))]):e._e(),e._v(" "),i("h4",[e._v(e._s(e.item.short_description))]),e._v(" "),e.isloggedin?i("span",{staticClass:"ref"},[e._v(e._s(e.item.reference))]):e._e()]),e._v(" "),e.isloggedin?i("nav",{staticClass:"tools"},[i("section",{staticClass:"tool flags"},[i("span",{staticClass:"btn mdi mdi-folder-outline"}),e._v(" "),i("div",{staticClass:"tool-content"},[i("ul",[e._l(e.flagcolls,(function(t){return e.flagcolls?i("li",{key:t.id},[i("span",{staticClass:"flag mdi",class:[e.flagIsLoading(t.id)?"mdi-loading mdi-spin":e.flagIsActive(t.id)?"mdi-close-circle isActive":"mdi-plus"],attrs:{collid:t.id},on:{click:function(t){return t.preventDefault(),e.onFlagActionCard(t)}}},[e._v("\n "+e._s(t.name)+"\n ")])]):e._e()})),e._v(" "),e.collsLength<15?i("li",{staticClass:"create-flag"},[i("input",{directives:[{name:"model",rawName:"v-model",value:e.new_folder_name,expression:"new_folder_name"}],attrs:{placeholder:"new folder"},domProps:{value:e.new_folder_name},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.preventDefault(),t.stopPropagation(),e.onCreateFlagColl(t))},input:function(t){t.target.composing||(e.new_folder_name=t.target.value)}}}),e._v(" "),i("span",{staticClass:"add-btn mdi",class:e.addFlagBtnClassObj,on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.onCreateFlagColl(t)}}})]):e._e()],2)])]),e._v(" "),e.item.samples&&e.item.samples.length?i("section",{staticClass:"tool samples"},[i("span",{staticClass:"btn mdi mdi-beaker-outline"}),e._v(" "),i("div",{staticClass:"tool-content"},[i("span",{staticClass:"label"},[e._v(e._s(e.$t("materio.Samples")))]),e._v(" "),i("ul",e._l(e.item.samples,(function(t){return i("li",{key:t.showroom.id},[i("span",{staticClass:"showroom"},[e._v(e._s(t.showroom.name))]),e._v(": "+e._s(t.location)+"\n ")])})),0)])]):e._e(),e._v(" "),e.item.note?i("section",{staticClass:"tool note"},[i("span",{staticClass:"btn mdi mdi-note"})]):e._e(),e._v(" "),i("section",{staticClass:"tool print"},[i("a",{attrs:{href:e.item.path+"/printable/print",target:"_blank"}},[i("span",{staticClass:"btn mdi mdi-printer"})])])]):e._e(),e._v(" "),i("section",{directives:[{name:"switcher",rawName:"v-switcher"}],staticClass:"images"},e._l(e.item.images,(function(t,a){return i("figure",{key:t.url},[i("img",{directives:[{name:"lazy",rawName:"v-lazy",value:a,expression:"index"}],staticClass:"lazy",attrs:{"data-src":t.style_cardmedium_url,title:t.title}}),e._v(" "),i("img",{staticClass:"blank",attrs:{src:e.blanksrc},on:{click:function(t){return t.preventDefault(),e.openModalCard(t)}}})])})),0)])};a._withStripped=!0;var n=i(629),s=i(8357),l=i(3939);const d={name:"Card",props:["item"],mixins:[s.Z],components:{ModalCard:l.Z},data:()=>({blanksrc:`${drupalSettings.path.themePath}/assets/img/blank.gif`,loadingFlag:!1,new_folder_name:"",is_creating_folder:!1}),computed:{...(0,n.rn)({flagcolls:e=>e.User.flagcolls,isloggedin:e=>e.User.isloggedin}),collsLength(){return Object.keys(this.flagcolls).length},addFlagBtnClassObj(){return{"mdi-plus-circle-outline":!this.is_creating_folder,"mdi-loading":this.is_creating_folder,active:this.new_folder_name.length>4&&!this.is_creating_folder,loading:this.is_creating_folder}}},methods:{...(0,n.nv)({createFlagColl:"User/createFlagColl",flagUnflag:"User/flagUnflag"}),onCreateFlagColl(){this.new_folder_name,this.is_creating_folder=!0,this.createFlagColl(this.new_folder_name).then((e=>{this.new_folder_name="",this.is_creating_folder=!1;let t=e.id;this.loadingFlag=t,this.flagUnflag({action:"flag",id:this.item.id,collid:t}).then((e=>{this.loadingFlag=!1}))}))},flagIsActive(e){return-1!==this.flagcolls[e].items.indexOf(this.item.id)},flagIsLoading(e){return e===this.loadingFlag},onFlagActionCard(e){if(this.item,!this.loadingFlag){let t=e.target.getAttribute("collid"),i=this.flagIsActive(t)?"unflag":"flag";this.loadingFlag=t,this.flagUnflag({action:i,id:this.item.id,collid:t}).then((e=>{this.loadingFlag=!1}))}},openModalCard(e){this.isLoggedin,this.isloggedin&&this.$modal.show(l.Z,{item:this.item,addNoteId:e=>{this.item.note={id:e}}},{name:`modal-${this.item.id}`,draggable:!1,classes:"vm--modale-card",width:"95%",height:"95%"})}}};var o=(0,i(1900).Z)(d,a,[],!1,null,"0318fc68",null);o.options.__file="web/themes/custom/materiotheme/vuejs/components/Content/Card.vue";const r=o.exports},3255:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>v});var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return!e.thematique||e.loading?i("div",{staticClass:"loading"},[i("span",[e._v(e._s(e.$t("default.Loading…")))])]):i("article",{staticClass:"thematique"},[i("div",{staticClass:"cols"},[i("div",{staticClass:"col col-left"},[i("section",{staticClass:"body",domProps:{innerHTML:e._s(e.thematique.body)}}),e._v(" "),i("section",{staticClass:"visuel"},[i("img",{attrs:{src:e.image_accroche.style_cardfull_url,alt:""}})])]),e._v(" "),i("div",{staticClass:"col col-right"},[i("aside",{staticClass:"linked-materials"},[i("div",{staticClass:"card-list"},[i("ul",{},e._l(e.thematique.linked_materials,(function(e){return i("li",{key:e.id},[i("Card",{attrs:{item:e}})],1)})),0)])])])])])};a._withStripped=!0;var n=i(4408),s=i(8492),l=(i(2141),i(546)),d=i(3033),o=i(4119),r=i.n(o),m=i(8964),c=i.n(m),u=i(6024);const g={name:"Thematique",router:n.Z,store:s.Z,data:()=>({nid:null,path:null,thematique:{},image_accroche:null,loading:!0}),metaInfo(){return{title:this.thematique.title}},created(){this.getThematique()},methods:{getThematique(){this.$route,this.$route.params.id?this.id=this.$route.params.id:"node"==drupalDecoupled.entity_type&&"thematique"==drupalDecoupled.entity_bundle&&(this.id=drupalDecoupled.entity_id),this.id?this.loadThematique():this.$router.replace({name:"home"})},loadThematique(){this.loading=!0;const e=r()`{
|
|
thematique(id: ${this.id}, lang: "${drupalDecoupled.lang_code}") {
|
|
...ThematiqueFields
|
|
}
|
|
}
|
|
${c()}
|
|
`;l.E.post("",{query:(0,d.S)(e)}).then((({data:{data:{thematique:e}}})=>{this.parseDataGQL(e)})).catch((e=>{console.warn("Issue with loadThematique",e),Promise.reject(e)}))},parseDataGQL(e){e?(this.thematique=e,e.images&&(this.image_accroche=e.images[0]),this.$store.commit("Common/setPagetitle",e.title)):console.warn("Thematique not loaded"),this.loading=!1}},components:{Card:u.Z},watch:{$route(e,t){this.getThematique()}}};var h=(0,i(1900).Z)(g,a,[],!1,null,"128bc334",null);h.options.__file="web/themes/custom/materiotheme/vuejs/components/Pages/Thematique.vue";const v=h.exports}}]); |