mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-18 04:21:27 +00:00
1 line
12 KiB
JavaScript
1 line
12 KiB
JavaScript
|
"use strict";(self.webpackChunkpixelfed=self.webpackChunkpixelfed||[]).push([[9231],{42785:(t,e,i)=>{i.r(e),i.d(e,{default:()=>a});var s=i(95002),o=i(74692);const a={props:{gid:{type:String},pid:{type:String}},components:{"group-status":s.default},data:function(){return{loaded:!1,currentProfile:{},roleTitle:"Member",group:{},profile:{},relationship:{following:!1},feed:[],ids:[],feedLoaded:!1,feedEmpty:!1,page:1,canIntersect:!1,commonIntersects:[]}},beforeMount:function(){o("body").css("background-color","#f0f2f5")},mounted:function(){this.fetchGroup(),this.$nextTick((function(){o('[data-toggle="tooltip"]').tooltip()}))},methods:{fetchGroup:function(){var t=this;axios.get("/api/v0/groups/"+this.gid).then((function(e){t.group=e.data})).finally((function(){t.fetchSelfProfile()}))},fetchSelfProfile:function(){var t=this;axios.get("/api/pixelfed/v1/accounts/verify_credentials").then((function(e){t.currentProfile=e.data})).catch((function(e){t.$router.push("/groups/"+t.gid)})).finally((function(){t.fetchProfile()})),this.$nextTick((function(){o('[data-toggle="tooltip"]').tooltip()}))},fetchProfile:function(){var t=this;axios.get("/api/v0/groups/accounts/"+this.gid+"/"+this.pid).then((function(e){t.profile=e.data,"founder"==e.data.group.role&&(t.roleTitle="Admin")})),window._sharedData.user.id!=this.pid?axios.get("/api/v1/accounts/relationships?id[]="+this.pid).then((function(e){t.relationship=e.data[0]})).finally((function(){t.fetchInitialFeed()})):this.fetchInitialFeed()},fetchInitialFeed:function(){var t=this;window._sharedData.user&&window._sharedData.user.id!=this.pid&&this.fetchCommonIntersections(),axios.get("/api/v0/groups/".concat(this.gid,"/user/").concat(this.pid,"/feed")).then((function(e){t.feed=e.data.filter((function(e){return"reply:text"!=e.pf_type||e.account.id!=t.profile.id})),t.feedLoaded=!0,t.feedEmpty=0==t.feed.length,t.page++,t.loaded=!0})).catch((function(e){t.$router.push("/groups/"+t.gid),console.log(e)}))},infiniteFeed:function(t){var e=this;0!=this.feed.length?axios.get("/api/v0/groups/".concat(this.group.id,"/user/").concat(this.profile.id,"/feed"),{params:{page:this.page}}).then((function(i){if(i.data.length){var s=i.data.filter((function(t){return"reply:text"!=t.pf_type||t.account.id!=e.profile.id})),o=e;s.forEach((function(t){-1==o.ids.indexOf(t.id)&&(o.ids.push(t.id),o.feed.push(t))})),t.loaded(),e.page++}else t.complete()})):t.complete()},fetchCommonIntersections:function(){var t=this;axios.get("/api/v0/groups/member/intersect/common",{params:{gid:this.gid,pid:this.pid}}).then((function(e){t.commonIntersects=e.data,t.canIntersect=e.data.groups.length||e.data.topics.length}))},formatJoinedDate:function(t){var e=new Date(t);return new Intl.DateTimeFormat("en-US",{year:"numeric",month:"long"}).format(e)}}}},17164:(t,e,i)=>{i.r(e),i.d(e,{render:()=>s,staticRenderFns:()=>o});var s=function(){var t,e=this,i=e._self._c;return i("div",{staticClass:"group-profile-component w-100 h-100"},[e.loaded?[i("div",{staticClass:"bg-white mb-3 border-bottom"},[i("div",{staticClass:"container-xl header"},[i("div",{staticClass:"header-jumbotron"}),e._v(" "),i("div",{staticClass:"header-profile-card"},[i("img",{staticClass:"avatar",attrs:{src:e.profile.avatar,onerror:"this.onerror=null;this.src='/storage/avatars/default.png?v=2'"}}),e._v(" "),i("p",{staticClass:"name"},[e._v("\n "+e._s(e.profile.display_name)+"\n ")]),e._v(" "),i("p",{staticClass:"username text-muted"},[e.profile.local?i("span",[e._v("@"+e._s(e.profile.username))]):i("span",[e._v(e._s(e.profile.acct))]),e._v(" "),e.profile.is_admin?i("span",{staticClass:"text-danger ml-1",attrs:{title:"Site administrator","data-toggle":"tooltip","data-placement":"bottom"}},[i("i",{staticClass:"far fa-users-crown"})]):e._e()])]),e._v(" "),i("div",{staticClass:"header-navbar"},[i("div"),e._v(" "),i("div",[e.currentProfile.id===e.profile.id?i("a",{staticClass:"btn btn-light font-weight-bold mr-2",attrs:{href:"/settings/home"}},[i("i",{staticClass:"fas fa-edit mr-1"}),e._v(" Edit Profile\n ")]):e._e(),e._v(
|