@europeana/portal
Version:
Europeana Portal
2 lines • 11.7 kB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[77],{1085:function(t,e,n){"use strict";n.r(e);var r=n(16),o=(n(21),n(42),n(22),n(99),n(43),n(250),n(14),n(141)),c=n.n(o),l=n(786),d=n.n(l),data=n(83),f=n(24),v=n(663),m=n(649),h={name:"SetPage",components:{ClientOnly:c.a,ErrorMessage:()=>n.e(16).then(n.bind(null,1016)),LoadingSpinner:()=>n.e(4).then(n.bind(null,660)),ItemPreviewCardGroup:v.a,SocialShareModal:m.a,SetFormModal:()=>n.e(8).then(n.bind(null,1097)),SetRecommendations:()=>n.e(19).then(n.bind(null,1098))},beforeRouteLeave(t,e,n){var o=this;return Object(r.a)((function*(){yield o.$store.commit("set/setActive",null),yield o.$store.commit("set/setActiveRecommendations",[]),yield o.$store.commit("entity/setFeaturedSetId",null),yield o.$store.commit("entity/setPinned",[]),n()}))()},middleware(t){var{app:e,params:n,redirect:r}=t;e.$features.setGalleries&&r({name:"galleries-all___".concat(e.i18n.locale),params:n})},fetch(){var t=this;return Object(r.a)((function*(){try{t.validateRoute(),yield t.$store.dispatch("set/fetchActive",t.setId),t.setIsEntityBestItems&&t.userIsEntityEditor&&(yield t.$store.commit("entity/setFeaturedSetId",t.setId),yield t.$store.dispatch("entity/getPins"))}catch(t){throw 403===t.statusCode&&(t.titlePath="errorMessage.galleryUnauthorised.title",t.descriptionPath="errorMessage.galleryUnauthorised.description",t.metaTitlePath="errorMessage.galleryUnauthorised.metaTitle",t.illustrationSrc=n(787)),t}}))()},head(){return{title:this.$pageHeadTitle(this.displayTitle.values[0]),meta:[{hid:"title",name:"title",content:this.displayTitle.values[0]},{hid:"og:title",property:"og:title",content:this.displayTitle.values[0]},{hid:"og:image",property:"og:image",content:this.shareMediaUrl},{hid:"og:type",property:"og:type",content:"article"}].concat(this.displayDescription&&this.displayDescription.values[0]?[{hid:"description",name:"description",content:this.displayDescription.values[0]},{hid:"og:description",property:"og:description",content:this.displayDescription.values[0]}]:[])}},computed:{fetchState(){return this.$fetchState},set(){return this.$store.state.set.active||{}},setId(){return this.$route.params.pathMatch},setFormModalId(){return"set-form-modal-".concat(this.setId)},setCreatorId(){return this.set.creator&&"string"==typeof this.set.creator?this.set.creator:this.set.creator.id},userIsOwner(){return this.$auth.loggedIn&&this.$store.state.auth.user&&this.setCreatorId&&this.setCreatorId.endsWith("/".concat(this.$store.state.auth.user.sub))},userIsEntityEditor(){var t,e,n,r,o,c,l=this.$store.state.auth.user,d=null==l||null===(t=l.resource_access)||void 0===t||null===(e=t.entities)||void 0===e||null===(n=e.roles)||void 0===n?void 0:n.includes("editor"),f=null==l||null===(r=l.resource_access)||void 0===r||null===(o=r.usersets)||void 0===o||null===(c=o.roles)||void 0===c?void 0:c.includes("editor");return d&&f},userCanEdit(){return this.userIsOwner||this.setIsEntityBestItems&&this.userIsEntityEditor},setIsEntityBestItems(){return"EntityBestItemsSet"===this.set.type},displayTitle(){return this.$fetchState.error?{values:[this.$t(this.$fetchState.error.metaTitlePath?this.$fetchState.error.metaTitlePath:"error")]}:Object(f.h)(this.set.title,this.$i18n.locale)},displayDescription(){return Object(f.h)(this.set.description,this.$i18n.locale)},displayRecommendations(){return this.enableRecommendations&&this.$auth.loggedIn&&this.userCanEdit},enableRecommendations(){return!this.setIsEntityBestItems||(this.$features.acceptEntityRecommendations||this.$features.rejectEntityRecommendations)},displayItemCount(){var label=this.set.total>100?"items.itemOf":"items.itemCount";return this.$tc(label,this.set.total,{max:100})},shareMediaUrl(){var t,e,n,r;return this.$apis.thumbnail.edmPreview(null===(t=this.set)||void 0===t||null===(e=t.items)||void 0===e||null===(n=e[0])||void 0===n||null===(r=n.edmPreview)||void 0===r?void 0:r[0],{size:400})}},methods:{validateRoute(){if(!/^\d+$/.test(this.$route.params.pathMatch))throw d()(400,"Invalid set ID")},reorderItems(t){this.$store.dispatch("set/update",{id:"".concat(data.c,"/").concat(this.setId),body:{type:this.set.type,title:this.set.title,description:this.set.description,visibility:this.set.visibility,items:t.map((t=>"".concat(data.b).concat(t.id)))},params:{profile:"standard"}})}}},y=(n(926),n(40)),component=Object(y.a)(h,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.$fetchState.error&&"white-page"},[t.$fetchState.pending?n("b-container",{attrs:{"data-qa":"loading spinner container"}},[n("b-row",{staticClass:"flex-md-row py-4 text-center"},[n("b-col",{attrs:{cols:"12"}},[n("LoadingSpinner")],1)],1)],1):t.$fetchState.error?n("ErrorMessage",{attrs:{"data-qa":"error message container",error:t.$fetchState.error.message,"title-path":t.$fetchState.error.titlePath,"description-path":t.$fetchState.error.descriptionPath,"illustration-src":t.$fetchState.error.illustrationSrc}}):t.set.id?n("div",{staticClass:"mt-n3",attrs:{"data-qa":"user gallery page"}},[n("b-container",{attrs:{fluid:""}},[n("b-row",{staticClass:"flex-md-row pt-5 bg-white mb-4"},[n("b-col",{attrs:{cols:"12"}},[n("b-container",{staticClass:"mb-5"},[n("b-row",{staticClass:"mb-4"},[n("b-col",[n("div",{staticClass:"context-label"},[t._v("\n "+t._s(t.$tc("galleries.galleries",1))+"\n ")]),t._v(" "),n("h1",{attrs:{lang:t.displayTitle.code}},[t._v("\n "+t._s(t.displayTitle.values[0])+"\n ")]),t._v(" "),n("p",{staticClass:"usergallery-description mb-3 w-75",attrs:{lang:t.displayDescription.code}},[t._v("\n "+t._s(t.displayDescription.values[0])+"\n ")]),t._v(" "),"private"===t.set.visibility||t.set.creator.nickname?n("div",{staticClass:"usergallery-metadata mb-2"},[t.set.creator.nickname?n("span",{staticClass:"curator mb-2"},[t._v("\n "+t._s(t.$t("set.labels.curatedBy"))+" @"+t._s(t.set.creator.nickname)+"\n ")]):t._e(),t._v(" "),"private"===t.set.visibility?n("span",{staticClass:"\n visibility mb-2"},[t._v("\n "+t._s(t.$t("set.labels.private"))+"\n ")]):t._e()]):t._e()])],1),t._v(" "),n("div",{staticClass:"d-inline-flex collection-buttons"},[t.userIsOwner?[n("b-button",{staticClass:"text-decoration-none mr-2",attrs:{variant:"outline-primary","data-qa":"edit set button"},on:{click:function(e){return t.$bvModal.show(t.setFormModalId)}}},[t._v("\n "+t._s(t.$t("actions.edit"))+"\n ")]),t._v(" "),n("SetFormModal",{attrs:{"set-id":t.set.id,"modal-id":t.setFormModalId,title:t.set.title,description:t.set.description,visibility:t.set.visibility}})]:t._e(),t._v(" "),n("b-button",{directives:[{name:"b-modal",rawName:"v-b-modal.share-modal",modifiers:{"share-modal":!0}}],staticClass:"text-decoration-none",attrs:{variant:"outline-primary"}},[t._v("\n "+t._s(t.$t("actions.share"))+"\n ")]),t._v(" "),n("SocialShareModal",{attrs:{"media-url":t.shareMediaUrl}})],2)],1)],1)],1)],1),t._v(" "),n("b-container",{staticClass:"mb-3",attrs:{"data-qa":"user set"}},[n("b-row",[n("b-col",[n("h2",{staticClass:"related-heading text-uppercase",attrs:{"data-qa":"item count"}},[t._v("\n "+t._s(t.displayItemCount)+"\n ")])])],1),t._v(" "),n("b-row",[n("b-col",[n("b-container",{staticClass:"px-0"},[n("b-row",{staticClass:"mb-3"},[n("b-col",{attrs:{cols:"12"}},[n("ItemPreviewCardGroup",{attrs:{items:t.set.items,"show-pins":t.setIsEntityBestItems&&t.userIsEntityEditor,"draggable-items":t.userIsOwner},on:{endItemDrag:t.reorderItems}})],1)],1)],1)],1)],1),t._v(" "),n("client-only",[t.displayRecommendations?n("SetRecommendations",{attrs:{identifier:"/"+t.$route.params.pathMatch,type:t.set.type}}):t._e()],1)],1)],1):t._e()],1)}),[],!1,null,"b42f47b2",null);e.default=component.exports},799:function(t,e,n){var content=n(927);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,n(106).default)("5bd2083d",content,!0,{sourceMap:!1})},926:function(t,e,n){"use strict";n(799)},927:function(t,e,n){var r=n(105)(!1);r.push([t.i,'.usergallery-metadata .visibility[data-v-b42f47b2]::before,.usergallery-metadata .curator[data-v-b42f47b2]::before,[class^=icon-][data-v-b42f47b2],[class*=" icon-"][data-v-b42f47b2]{font-family:"icomoon";speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;vertical-align:middle;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-accept[data-v-b42f47b2]::before{content:""}.icon-ic-add[data-v-b42f47b2]::before{content:""}.icon-arrow-down[data-v-b42f47b2]::before{content:""}.icon-back[data-v-b42f47b2]::before{content:""}.icon-cancel-circle[data-v-b42f47b2]::before{content:""}.icon-caret-down[data-v-b42f47b2]::before{content:""}.icon-check-circle[data-v-b42f47b2]::before{content:""}.icon-clear[data-v-b42f47b2]::before{content:""}.icon-close[data-v-b42f47b2]::before{content:""}.icon-ic-download[data-v-b42f47b2]::before{content:""}.icon-edit[data-v-b42f47b2]::before{content:""}.icon-external-link[data-v-b42f47b2]::before{content:""}.icon-facebook[data-v-b42f47b2]::before{content:""}.icon-ic-feedback[data-v-b42f47b2]::before{content:""}.icon-file[data-v-b42f47b2]::before{content:""}.icon-filter[data-v-b42f47b2]::before{content:""}.icon-globe[data-v-b42f47b2]::before{content:""}.icon-heart[data-v-b42f47b2]::before{content:""}.icon-info[data-v-b42f47b2]::before{content:""}.icon-info-outline[data-v-b42f47b2]::before{content:""}.icon-instagram[data-v-b42f47b2]::before{content:""}.icon-language[data-v-b42f47b2]::before{content:""}.icon-license[data-v-b42f47b2]::before{content:""}.icon-link[data-v-b42f47b2]::before{content:""}.icon-linkedin[data-v-b42f47b2]::before{content:""}.icon-pinterest[data-v-b42f47b2]::before{content:""}.icon-push-pin[data-v-b42f47b2]::before{content:""}.icon-reject[data-v-b42f47b2]::before{content:""}.icon-search[data-v-b42f47b2]::before{content:""}.icon-share[data-v-b42f47b2]::before{content:""}.icon-ic-tag[data-v-b42f47b2]::before{content:""}.icon-temporary-tag[data-v-b42f47b2]::before{content:""}.icon-translate[data-v-b42f47b2]::before{content:""}.icon-twitter[data-v-b42f47b2]::before{content:""}.icon-3d[data-v-b42f47b2]::before{content:""}.icon-sound[data-v-b42f47b2]::before{content:""}.icon-text[data-v-b42f47b2]::before{content:""}.icon-image[data-v-b42f47b2]::before{content:""}.icon-video[data-v-b42f47b2]::before{content:""}.icon-unavailable[data-v-b42f47b2]::before{content:""}.icon-ic-move-vert[data-v-b42f47b2]::before{content:""}.icon-ic-move-xy[data-v-b42f47b2]::before{content:""}.icon-menu[data-v-b42f47b2]::before{content:""}.usergallery-description[data-v-b42f47b2]{color:#4d4d4d}.usergallery-metadata[data-v-b42f47b2]{font-size:.875rem;font-weight:600;line-height:1.125;color:#4d4d4d}.usergallery-metadata .curator[data-v-b42f47b2],.usergallery-metadata .visibility[data-v-b42f47b2]{display:inline-flex;align-items:center}.usergallery-metadata .curator[data-v-b42f47b2]::before,.usergallery-metadata .visibility[data-v-b42f47b2]::before{font-size:1.5rem;padding-right:.2rem}.usergallery-metadata .curator[data-v-b42f47b2]{margin-right:1.5rem}.usergallery-metadata .curator[data-v-b42f47b2]::before{content:"";font-size:1.125rem}.usergallery-metadata .visibility[data-v-b42f47b2]::before{content:"";font-size:1.125rem}.collection-buttons .text[data-v-b42f47b2]{font-weight:600}',""]),t.exports=r}}]);
//# sourceMappingURL=745d561.modern.js.map