pixelfed/public/js/groups-profile.9049d02d06606680.js
2024-07-23 01:31:06 -06:00

1 line
No EOL
12 KiB
JavaScript
Vendored

"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(" "),e.relationship.following?i("a",{staticClass:"btn btn-primary font-weight-bold mr-2",attrs:{href:e.profile.url}},[i("i",{staticClass:"far fa-comment-alt-dots mr-1"}),e._v(" Message\n ")]):e._e(),e._v(" "),e.relationship.following?i("a",{staticClass:"btn btn-light font-weight-bold mr-2",attrs:{href:e.profile.url}},[i("i",{staticClass:"fas fa-user-check mr-1"}),e._v(" "+e._s(e.relationship.followed_by?"Friends":"Following")+"\n ")]):e._e(),e._v(" "),e.relationship.following?e._e():i("a",{staticClass:"btn btn-light font-weight-bold mr-2",attrs:{href:e.profile.url}},[i("i",{staticClass:"fas fa-user mr-1"}),e._v(" View Main Profile\n ")]),e._v(" "),i("div",{staticClass:"dropdown"},[e._m(1),e._v(" "),i("div",{staticClass:"dropdown-menu dropdown-menu-right",attrs:{"aria-labelledby":"amenu"}},[e.currentProfile.id!=e.profile.id?i("a",{staticClass:"dropdown-item font-weight-bold",attrs:{href:"/i/report?type=user&id=".concat(e.profile.id)}},[e._v("Report")]):e._e(),e._v(" "),e.currentProfile.id==e.profile.id?i("a",{staticClass:"dropdown-item font-weight-bold",attrs:{href:"#"}},[e._v("Leave Group")]):e._e()])])])])])]),e._v(" "),i("div",{staticClass:"w-100 h-100 group-profile-feed"},[i("div",{staticClass:"container-xl"},[i("div",{staticClass:"row"},[i("div",{staticClass:"col-12 col-md-5"},[i("div",{staticClass:"card card-body shadow-sm infolet"},[i("h5",{staticClass:"font-weight-bold mb-3"},[e._v("Intro")]),e._v(" "),e.profile.local?e._e():i("div",{staticClass:"media mb-3 align-items-center"},[e._m(2),e._v(" "),i("div",{staticClass:"media-body"},[e._v("\n Remote member from "),i("strong",[e._v(e._s(e.profile.acct.split("@")[1]))])])]),e._v(" "),i("div",{staticClass:"media align-items-center"},[e._m(3),e._v(" "),i("div",{staticClass:"media-body"},[e._v("\n "+e._s(e.roleTitle)+" of "),i("strong",[e._v(e._s(e.group.name))]),e._v(" since "+e._s(e.formatJoinedDate(null===(t=e.profile.group)||void 0===t?void 0:t.joined))+"\n ")])])]),e._v(" "),e.canIntersect?i("div",{staticClass:"card card-body shadow-sm infolet"},[i("h5",{staticClass:"font-weight-bold mb-3"},[e._v("Things in Common")]),e._v(" "),e.commonIntersects.friends.length?e._m(5):e._e(),e._v(" "),e.commonIntersects.groups.length?i("div",{staticClass:"media mb-3 align-items-center"},[e._m(6),e._v(" "),i("div",{staticClass:"media-body"},[e._v("\n Also member of "),i("a",{staticClass:"text-dark font-weight-bold",attrs:{href:e.commonIntersects.groups[0].url}},[e._v(e._s(e.commonIntersects.groups[0].name))]),e._v(" and "+e._s(e.commonIntersects.groups_count)+" other groups\n ")])]):e._e(),e._v(" "),e.commonIntersects.topics.length?i("div",{staticClass:"media mb-0 align-items-center"},[e._m(7),e._v(" "),i("div",{staticClass:"media-body"},[e._v("\n Also interested in topics containing\n "),e._l(e.commonIntersects.topics,(function(t,s){return i("span",[e.commonIntersects.topics.length-1==s?i("span",[e._v(" and ")]):e._e(),i("a",{staticClass:"font-weight-bold text-dark",attrs:{href:t.url}},[e._v("#"+e._s(t.name))]),e.commonIntersects.topics.length>s+2?i("span",[e._v(", ")]):e._e()])})),e._v(" hashtags\n ")],2)]):e._e()]):e._e()]),e._v(" "),i("div",{staticClass:"col-12 col-md-7"},[e._m(8),e._v(" "),e.feedEmpty?i("div",{staticClass:"pt-5 text-center"},[i("h5",[e._v("No New Posts")]),e._v(" "),i("p",[e._v(e._s(e.profile.username)+" hasn't posted anything yet in "),i("strong",[e._v(e._s(e.group.name))]),e._v(".")]),e._v(" "),i("a",{staticClass:"font-weight-bold",attrs:{href:e.group.url}},[e._v("Go Back")])]):e._e(),e._v(" "),e.feedLoaded?i("div",{staticClass:"mt-2"},[e._l(e.feed,(function(t,s){return i("group-status",{key:"gps:"+t.id,attrs:{permalinkMode:!0,showGroupChevron:!0,group:e.group,prestatus:t,profile:e.profile,"group-id":e.group.id}})})),e._v(" "),e.feed.length>=1?i("div",{attrs:{distance:800}},[i("infinite-loading",{on:{infinite:e.infiniteFeed}},[i("div",{attrs:{slot:"no-more"},slot:"no-more"}),e._v(" "),i("div",{attrs:{slot:"no-results"},slot:"no-results"})])],1):e._e()],2):e._e()])])])])]:i("div",{staticClass:"w-100 h-100"},[e._m(0)])],2)},o=[function(){var t=this._self._c;return t("div",{staticClass:"d-flex justify-content-center align-items-center mt-5"},[t("div",{staticClass:"spinner-border",attrs:{role:"status"}},[t("span",{staticClass:"sr-only"},[this._v("Loading...")])])])},function(){var t=this._self._c;return t("button",{staticClass:"btn btn-light font-weight-bold dropdown-toggle",attrs:{type:"button",id:"amenu","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"}},[t("i",{staticClass:"fas fa-ellipsis-h"})])},function(){var t=this._self._c;return t("div",{staticClass:"media-icon"},[t("i",{staticClass:"far fa-globe",attrs:{title:"User is from a remote server","data-toggle":"tooltip","data-placement":"bottom"}})])},function(){var t=this._self._c;return t("div",{staticClass:"media-icon"},[t("i",{staticClass:"fas fa-users",attrs:{title:"User joined group on this date","data-toggle":"tooltip","data-placement":"bottom"}})])},function(){var t=this._self._c;return t("div",{staticClass:"media-icon"},[t("i",{staticClass:"far fa-user-friends"})])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"media mb-3 align-items-center"},[t._m(4),t._v(" "),e("div",{staticClass:"media-body"},[t._v("\n "+t._s(t.commonIntersects.friends_count)+" mutual friend"),t.commonIntersects.friends.length>1?e("span",[t._v("s")]):t._e(),t._v(" including\n "),t._l(t.commonIntersects.friends,(function(i,s){return e("span",[e("a",{staticClass:"text-dark font-weight-bold",attrs:{href:i.url}},[t._v(t._s(i.acct))]),t.commonIntersects.friends.length>s+1?e("span",[t._v(", ")]):e("span")])}))],2)])},function(){var t=this._self._c;return t("div",{staticClass:"media-icon"},[t("i",{staticClass:"fas fa-users"})])},function(){var t=this._self._c;return t("div",{staticClass:"media-icon"},[t("i",{staticClass:"far fa-thumbs-up fa-lg text-lighter"})])},function(){var t=this._self._c;return t("div",{staticClass:"card card-body shadow-sm"},[t("h5",{staticClass:"font-weight-bold mb-0"},[this._v("Group Posts")])])}]},89785:(t,e,i)=>{i.r(e),i.d(e,{default:()=>a});var s=i(76798),o=i.n(s)()((function(t){return t[1]}));o.push([t.id,".group-profile-component{background-color:#f0f2f5}.group-profile-component .header-jumbotron{background-color:#f3f4f6;border-bottom-left-radius:20px;border-bottom-right-radius:20px;height:320px}.group-profile-component .header-profile-card{align-items:center;display:flex;flex-direction:column;justify-content:center}.group-profile-component .header-profile-card .avatar{border-radius:50%;height:170px;margin-bottom:20px;margin-top:-150px;width:170px}.group-profile-component .header-profile-card .name{font-size:30px;font-weight:700;line-height:30px;margin-bottom:6px;text-align:center}.group-profile-component .header-profile-card .username{font-size:16px;font-weight:500;text-align:center}.group-profile-component .header-navbar{align-items:center;border-top:1px solid #f3f4f6;display:flex;height:60px;justify-content:space-between}.group-profile-component .header-navbar .dropdown{display:inline-block}.group-profile-component .header-navbar .dropdown-toggle:after{display:none}.group-profile-component .group-profile-feed{min-height:500px}.group-profile-component .infolet{margin-bottom:1rem}.group-profile-component .infolet .media-icon{display:flex;justify-content:center;margin-right:10px;width:30px}.group-profile-component .infolet .media-icon i{color:#d1d5db!important;font-size:1.1rem}.group-profile-component .btn-light{border-color:#f3f4f6}",""]);const a=o},23598:(t,e,i)=>{i.r(e),i.d(e,{default:()=>r});var s=i(85072),o=i.n(s),a=i(89785),n={insert:"head",singleton:!1};o()(a.default,n);const r=a.default.locals||{}},21567:(t,e,i)=>{i.r(e),i.d(e,{default:()=>n});var s=i(19359),o=i(35332),a={};for(const t in o)"default"!==t&&(a[t]=()=>o[t]);i.d(e,a);i(35011);const n=(0,i(14486).default)(o.default,s.render,s.staticRenderFns,!1,null,null,null).exports},35332:(t,e,i)=>{i.r(e),i.d(e,{default:()=>a});var s=i(42785),o={};for(const t in s)"default"!==t&&(o[t]=()=>s[t]);i.d(e,o);const a=s.default},19359:(t,e,i)=>{i.r(e);var s=i(17164),o={};for(const t in s)"default"!==t&&(o[t]=()=>s[t]);i.d(e,o)},35011:(t,e,i)=>{i.r(e);var s=i(23598),o={};for(const t in s)"default"!==t&&(o[t]=()=>s[t]);i.d(e,o)}}]);