1"use strict";(self["webpackChunktjing"]=self["webpackChunktjing"]||[]).push([[133],{30133:function(t,e,s){s.r(e),s.d(e,{default:function(){return _}});s(28743);var n=function(){var t=this,e=t._self._c;return t.loaded?e("div",{staticClass:"posts-container"},[t.userIsAdmin&&0===t.clubData.news.length?e("div",{staticClass:"no-posts-admin"},[t._m(0),t.userIsAdmin?e("button",{staticClass:"create-post-button",on:{click:function(e){return t.$router.push({name:"organization-post-news"})}}},[e("Add",{attrs:{color:"white"}}),t._m(1)],1):t._e()]):0===t.clubData.news.length?e("div",{staticClass:"no-posts"},[e("p",[t._v("This club hasnât posted anything yet.")])]):[t.userIsAdmin?e("button",{staticClass:"create-post-button",on:{click:function(e){return t.$router.push({name:"organization-post-news"})}}},[e("Add",{attrs:{color:"white"}}),t._m(2)],1):t._e(),t._l(t.clubData.news,(function(s){return e("section",{staticClass:"news-post"},[e("carousel",{attrs:{autoplay:!0,autoplayTimeout:1e4,perPage:1}},t._l(t.newsImages(s.attachments),(function(n,a){return e("slide",{key:a},[e("img",{staticClass:"news-slider-image",attrs:{src:t.contentImageThumbnailUrl(n.url),alt:"News image"},on:{click:function(e){t.activeNewsSection=s,t.index=a}}})])})),1),e("div",{staticClass:"news-wrapper"},[s.published?t._e():e("p",{staticClass:"unpublished-label"},[e("Hide",{attrs:{color:"sunset"}}),e("b",[t._v("Unpublished")])],1),e("div",{staticClass:"news-header"},[e("UserProfileAvatar",{attrs:{size:"L",profileImageUrl:s.createdBy.profile.profileImageUrl,initials:s.createdBy.firstName.charAt(0)+s.createdBy.lastName.charAt(0)}}),e("div",{staticClass:"news-header-info-wrapper"},[e("p",{staticClass:"poster"},[e("b",[t._v(t._s(s.createdBy.firstName)+" "+t._s(s.createdBy.lastName))])]),e("p",{staticClass:"post-date"},[t._v(" "+t._s(t.dateFormatter(s.createdAt,"D MMM YYYY"))+" ")]),"MEMBER"===s.audience?[e("p",{staticClass:"round-separator"}),e("p",{staticClass:"members-only-label"},[t._v("Members only")])]:t._e()],2),t.userIsAdmin?e("ActionMenu",{attrs:{items:t.newsOptions(s)},on:{delete:function(e){t.postToDelete=s},togglePublish:function(e){return t.togglePublish(s)},manageAttachments:function(e){return t.$router.push({name:"organization-manage-post-attachments",params:{postId:s.id}})},edit:function(e){return t.$router.push({name:"organization-edit-news",params:{postId:s.id}})}}}):t._e()],1),e("div",{staticClass:"news-title"},[e("h3",[t._v(t._s(s.title))])]),e("vue-markdown",{staticClass:"news-body clubs-markdown",attrs:{source:s.body}}),t.hasAttachments(s.attachments)?e("div",{staticClass:"news-attachments"},t._l(t.newsAttachments(s.attachments),(function(s){return e("a",{staticClass:"attachment",attrs:{href:s.url}},[e("p",[e("b",[t._v(" "+t._s(t.getFileNameFromUrl(s.url))+" ")])]),e("Download2")],1)})),0):t._e()],1)],1)})),e("infinite-loading",{attrs:{spinner:"spiral"},on:{infinite:t.loadMorePosts}},[e("div",{attrs:{slot:"no-more"},slot:"no-more"},[t._v(" Congrats! Youâve reached our very first post ð£ ")]),e("div",{attrs:{slot:"no-results"},slot:"no-results"})]),e("CoolLightBox",{attrs:{items:t.lightBoxImages,index:t.index},on:{close:function(e){t.activeNewsSection=null,t.index=null}}})],e("sweet-modal",{ref:"deletepost",attrs:{"enable-mobile-fullscreen":!1,blocking:"","hide-close-button":""}},[e("DeletePost",{on:{close:function(e){t.postToDelete=null},delete:function(e){return t.deletePost(t.postToDelete)}}})],1)],2):t._e()},a=[function(){var t=this,e=t._self._c;return e("p",[t._v(" Create a post with news for members to read. "),e("br"),t._v(" You can add photos and documents to all posts. ")])},function(){var t=this,e=t._self._c;return e("p",[e("b",[t._v("Create post")])])},function(){var t=this,e=t._self._c;return e("p",[e("b",[t._v("Create post")])])}],o=s(49834),i=s(59181),r=s.n(i),l=s(58685),d=s(62680),u=s(27804),c=s(36498),p=s(96275),h=s(57742),m=s(25029),g=s(16697),f=s(32252),b=s.n(f),w={name:"PublicClubNews",props:["me","userIsAdmin"],mixins:[o.A],data(){return{loaded:!1,clubData:null,index:null,activeNewsSection:null,postToDelete:null}},components:{VueMarkdown:r(),CoolLightBox:l.A,Add:d.A,UserProfileAvatar:c.A,Download2:p.A,Carousel:h.Carousel,Slide:h.Slide,ActionMenu:m.A,Hide:u.A,DeletePost:g.A,InfiniteLoading:b()},watch:{postToDelete:function(t){null!==t?this.$refs.deletepost.o
1pen():this.$refs.deletepost.close()}},computed:{lightBoxImages(){const t=this.clubData.news.find((t=>t.id===this.activeNewsSection?.id));return t?t.attachments.filter((t=>"IMAGE"===t.documentType)).map((t=>t.url)):[]}},methods:{async deletePost(t){try{const e=await this.$axios({headers:{Authorization:this.$store.state.user.sessionInfo.token},data:{query:`\n mutation {\n DeleteOrganizationContent(contentId:"${t.id}")\n }\n `}});if(e.data.errors)throw e.data.errors[0];this.$store.dispatch("showMessage",{show:!0,message:"Post deleted",type:"success"}),this.$refs.deletepost.close(),this.loadData()}catch(e){this.$store.dispatch("showMessage",{show:!0,message:e.message||"Error deletin gpost",type:"error"})}},async togglePublish(t){try{const e=await this.$axios({headers:{Authorization:this.$store.state.user.sessionInfo.token},data:{query:`\n mutation UpdateOrganizationContent($UpdateOrganizationContent: UpdateOrganizationContentInput!){\n UpdateOrganizationContent(contentId:"${t.id}", input: $UpdateOrganizationContent){\n id\n }\n }\n `,variables:{UpdateOrganizationContent:{published:!t.published}}}});if(e.data.errors)throw e.data.errors[0];t.published=!t.published,this.$store.dispatch("showMessage",{show:!0,message:"Section updated",type:"success"})}catch(e){this.$store.dispatch("showMessage",{show:!0,message:"Error updating section",type:"error"})}},newsOptions(t){const e=[];return e.push({title:"Edit text",action:"edit",disabled:!1,textColor:"",subItems:[],confirmationRequired:!1,separator:null}),e.push({title:"Edit files",action:"manageAttachments",disabled:!1,textColor:"",subItems:[],confirmationRequired:!1,separator:null}),e.push({title:t.published?"Unpublish":"Publish",action:"togglePublish",disabled:!1,textColor:"",subItems:[],confirmationRequired:!1,separator:null}),e.push({title:"Delete",action:"delete",disabled:!1,textColor:"#FF0064",subItems:[],confirmationRequired:!1,separator:null}),e},getFileNameFromUrl(t){const e=t.substring(t.lastIndexOf("/")+1).replace(/\.[^/.]+$/,""),s=decodeURIComponent(e);return decodeURIComponent(s.split("").map((t=>"%"+t.charCodeAt(0).toString(16).padStart(2,"0"))).join(""))},newsImages(t){return t.filter((t=>"IMAGE"===t.documentType))},newsAttachments(t){return t.filter((t=>"DOCUMENT"===t.documentType))},hasAttachments(t){return t.some((t=>"DOCUMENT"===t.documentType))},contentImageThumbnailUrl(t){const e="_x512.",s=t,n=s.substring(s.lastIndexOf("/")+1),a=n.replace(".",e),o=s.replace(n,a);return o},async loadMorePosts(t){const e=this.$route.params.slug,s=await this.$axios({headers:{Authorization:this.$store.state.user.sessionInfo.token},data:{query:`\n {\n organization(slug:"${e}"){\n news(first:5, skip:${this.clubData.news.length}){\n id\n published\n audience\n title\n position\n body\n attachments{\n id\n documentType\n url\n }\n createdAt\n createdBy{\n id\n firstName\n lastName\n profile{\n profileImageUrl\n }\n }\n updatedAt\n updatedBy{\n id\n firstName\n lastName\n }\n }\n }\n }\n `}});s.data.data.organization.news.length>0?(this.clubData.news.push(...s.data.data.organization.news),t.loaded()):t.complete()},async loadData(){const t=this.$route.params.slug,e=await this.$axios({headers:{Authorization:this.$store.state.user.sessionInfo.token},data:{query:`\n {\n organization(slug:"${t}"){\n news(first:5, skip:0){\n id\n published\n audience\n title\n position\n body\n attachments{\n id\n documentType\n url\n }\n createdAt\n createdBy{\n id\n firstName\n lastName\n profile{\n profileImageUrl\n }\n }\n updatedAt\n updatedBy{\n id\n firstName\n lastName\n }\n }\n }\n }\n `}});this.clubData=e.data.data.organization,this.loaded=!0}},beforeMount(){this.loadData()},beforeCreate(){},destroyed(){}},C=w,y=s(81656),A=(0,y.A)(C,n,a,!1,null,"0e0a2461",null),_=A.exports}}]); 2//# sourceMappingURL=133.d6822c65.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.