@europeana/portal
Version:
Europeana Portal
2 lines • 2.17 kB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[21],{1017:function(e,t){},1162:function(e,t,r){"use strict";r.r(t);var n=r(23),l=(r(75),r(41),r(315),r(30),{name:"RelatedEditorial",components:{ContentCard:r(711).default},props:{entityUri:{type:String,default:null},relatedEditorial:{type:Array,default:function(){return[]}},query:{type:String,default:""}},data:function(){return{related:this.relatedEditorial}},fetch:function(){var e=this;return Object(n.a)(regeneratorRuntime.mark((function t(){var r,n,l,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.entityUri||e.query){t.next=2;break}return t.abrupt("return");case 2:return r={entityUri:e.entityUri,query:e.query,locale:e.$i18n.isoLocale(),preview:"preview"===e.$route.query.mode,limit:4},n=e.entityUri?"entityRelatedContent":"relatedContent",t.next=6,e.$contentful.query(n,r);case 6:l=t.sent,o=l.data.data,e.related=o.blogPostingCollection.items.concat(o.exhibitionPageCollection.items).sort((function(a,b){return new Date(b.datePublished).getTime()-new Date(a.datePublished).getTime()})).slice(0,4);case 9:case"end":return t.stop()}}),t)})))()},watch:{query:"$fetch",entityUri:"$fetch"},methods:{entryUrl:function(e){var t;return"BlogPosting"===e.__typename?t="/blog":"ExhibitionPage"===e.__typename&&(t="/exhibitions"),"".concat(t,"/").concat(e.identifier)}}}),o=r(59),c=r(1017),d=r.n(c),component=Object(o.a)(l,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("section",{directives:[{name:"show",rawName:"v-show",value:e.related.length>0,expression:"related.length > 0"}],staticClass:"row mb-5"},[r("div",{staticClass:"col-12"},[r("b-card",{staticClass:"card-group-card",attrs:{title:e.$t("related.editorial.title"),"title-tag":"h2"}},[r("b-card-group",{staticClass:"d-flex flex-wrap"},e._l(e.related,(function(t,n){return r("ContentCard",{key:n,attrs:{title:t.name,url:e.entryUrl(t),"image-url":t.primaryImageOfPage.image.url,"image-content-type":t.primaryImageOfPage.image.contentType,variant:"list"}})})),1)],1)],1)])}),[],!1,null,null,null);"function"==typeof d.a&&d()(component);t.default=component.exports}}]);
//# sourceMappingURL=13fbc60.js.map