Profile.vue 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176
  1. <template>
  2. <div class="w-100 h-100">
  3. <div v-if="relationship && relationship.blocking && warning" class="bg-white pt-3 border-bottom">
  4. <div class="container">
  5. <p class="text-center font-weight-bold">You are blocking this account</p>
  6. <p class="text-center font-weight-bold">Click <a href="#" class="cursor-pointer" @click.prevent="warning = false;">here</a> to view profile</p>
  7. </div>
  8. </div>
  9. <div v-if="loading" style="height: 80vh;" class="d-flex justify-content-center align-items-center">
  10. <img src="/img/pixelfed-icon-grey.svg" class="">
  11. </div>
  12. <div v-if="!loading && !warning">
  13. <div v-if="profileLayout == 'metro'">
  14. <div class="bg-white py-5 border-bottom">
  15. <div class="container">
  16. <div class="row">
  17. <div class="col-12 col-md-4 d-flex">
  18. <div class="profile-avatar mx-md-auto">
  19. <div class="d-block d-md-none">
  20. <div class="row">
  21. <div class="col-5">
  22. <img class="rounded-circle box-shadow mr-2" :src="profile.avatar" width="77px" height="77px">
  23. <p v-if="sponsorList.patreon || sponsorList.liberapay || sponsorList.opencollective" class="text-center mt-1 mr-2">
  24. <button type="button" @click="showSponsorModal" class="btn btn-sm btn-outline-secondary font-weight-bold py-0">
  25. Donate
  26. </button>
  27. </p>
  28. </div>
  29. <div class="col-7 pl-2">
  30. <p class="align-middle">
  31. <span class="font-weight-ultralight h3 mb-0">{{profile.username}}</span>
  32. <span class="float-right mb-0" v-if="!loading && profile.id != user.id && user.hasOwnProperty('id')">
  33. <a class="fas fa-cog fa-lg text-muted text-decoration-none" href="#" @click.prevent="visitorMenu"></a>
  34. </span>
  35. </p>
  36. <p v-if="!loading && profile.id == user.id && user.hasOwnProperty('id')">
  37. <a class="btn btn-outline-dark py-0 px-4 mt-3" href="/settings/home">Edit Profile</a>
  38. </p>
  39. <div v-if="profile.id != user.id && user.hasOwnProperty('id')">
  40. <p class="mt-3 mb-0" v-if="relationship.following == true">
  41. <button type="button" class="btn btn-outline-dark font-weight-bold px-4 py-0" v-on:click="followProfile()" data-toggle="tooltip" title="Unfollow">Unfollow</button>
  42. </p>
  43. <p class="mt-3 mb-0" v-if="!relationship.following">
  44. <button type="button" class="btn btn-outline-dark font-weight-bold px-4 py-0" v-on:click="followProfile()" data-toggle="tooltip" title="Follow">Follow</button>
  45. </p>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. <div class="d-none d-md-block">
  51. <img class="rounded-circle box-shadow" :src="profile.avatar" width="172px" height="172px">
  52. <p v-if="sponsorList.patreon || sponsorList.liberapay || sponsorList.opencollective" class="text-center mt-3">
  53. <button type="button" @click="showSponsorModal" class="btn btn-outline-secondary font-weight-bold py-0">
  54. <i class="fas fa-heart text-danger"></i>
  55. Donate
  56. </button>
  57. </p>
  58. </div>
  59. </div>
  60. </div>
  61. <div class="col-12 col-md-8 d-flex align-items-center">
  62. <div class="profile-details">
  63. <div class="d-none d-md-flex username-bar pb-2 align-items-center">
  64. <span class="font-weight-ultralight h3">{{profile.username}}</span>
  65. <span class="pl-4" v-if="profile.is_admin">
  66. <span class="btn btn-outline-secondary font-weight-bold py-0">ADMIN</span>
  67. </span>
  68. <span class="pl-4">
  69. <a :href="'/users/'+profile.username+'.atom'" class="fas fa-rss fa-lg text-muted text-decoration-none"></a>
  70. </span>
  71. <span class="pl-4" v-if="owner && user.hasOwnProperty('id')">
  72. <a class="fas fa-cog fa-lg text-muted text-decoration-none" href="/settings/home"></a>
  73. </span>
  74. <span class="pl-4" v-if="!owner && user.hasOwnProperty('id')">
  75. <a class="fas fa-cog fa-lg text-muted text-decoration-none" href="#" @click.prevent="visitorMenu"></a>
  76. </span>
  77. <span v-if="profile.id != user.id && user.hasOwnProperty('id')">
  78. <span class="pl-4" v-if="relationship.following == true">
  79. <button type="button" class="btn btn-outline-secondary font-weight-bold btn-sm" v-on:click="followProfile()" data-toggle="tooltip" title="Unfollow"><i class="fas fa-user-minus"></i></button>
  80. </span>
  81. <span class="pl-4" v-if="!relationship.following">
  82. <button type="button" class="btn btn-primary font-weight-bold btn-sm" v-on:click="followProfile()" data-toggle="tooltip" title="Follow"><i class="fas fa-user-plus"></i></button>
  83. </span>
  84. </span>
  85. </div>
  86. <div class="d-none d-md-inline-flex profile-stats pb-3 lead">
  87. <div class="font-weight-light pr-5">
  88. <a class="text-dark" :href="profile.url">
  89. <span class="font-weight-bold">{{profile.statuses_count}}</span>
  90. Posts
  91. </a>
  92. </div>
  93. <div v-if="profileSettings.followers.count" class="font-weight-light pr-5">
  94. <a class="text-dark cursor-pointer" v-on:click="followersModal()">
  95. <span class="font-weight-bold">{{profile.followers_count}}</span>
  96. Followers
  97. </a>
  98. </div>
  99. <div v-if="profileSettings.following.count" class="font-weight-light">
  100. <a class="text-dark cursor-pointer" v-on:click="followingModal()">
  101. <span class="font-weight-bold">{{profile.following_count}}</span>
  102. Following
  103. </a>
  104. </div>
  105. </div>
  106. <p class="lead mb-0 d-flex align-items-center pt-3">
  107. <span class="font-weight-bold pr-3">{{profile.display_name}}</span>
  108. </p>
  109. <div v-if="profile.note" class="mb-0 lead" v-html="profile.note"></div>
  110. <p v-if="profile.website" class=""><a :href="profile.website" class="font-weight-bold" rel="me external nofollow noopener" target="_blank">{{profile.website}}</a></p>
  111. </div>
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. <div class="d-block d-md-none bg-white my-0 py-2 border-bottom">
  117. <ul class="nav d-flex justify-content-center">
  118. <li class="nav-item">
  119. <div class="font-weight-light">
  120. <span class="text-dark text-center">
  121. <p class="font-weight-bold mb-0">{{profile.statuses_count}}</p>
  122. <p class="text-muted mb-0">Posts</p>
  123. </span>
  124. </div>
  125. </li>
  126. <li class="nav-item px-5">
  127. <div v-if="profileSettings.followers.count" class="font-weight-light">
  128. <a class="text-dark cursor-pointer text-center" v-on:click="followersModal()">
  129. <p class="font-weight-bold mb-0">{{profile.followers_count}}</p>
  130. <p class="text-muted mb-0">Followers</p>
  131. </a>
  132. </div>
  133. </li>
  134. <li class="nav-item">
  135. <div v-if="profileSettings.following.count" class="font-weight-light">
  136. <a class="text-dark cursor-pointer text-center" v-on:click="followingModal()">
  137. <p class="font-weight-bold mb-0">{{profile.following_count}}</p>
  138. <p class="text-muted mb-0">Following</p>
  139. </a>
  140. </div>
  141. </li>
  142. </ul>
  143. </div>
  144. <div class="bg-white">
  145. <ul class="nav nav-topbar d-flex justify-content-center border-0">
  146. <li class="nav-item">
  147. <a :class="this.mode == 'grid' ? 'nav-link font-weight-bold text-uppercase text-primary' : 'nav-link font-weight-bold text-uppercase'" href="#" v-on:click.prevent="switchMode('grid')"><i class="fas fa-th fa-lg"></i></a>
  148. </li>
  149. <li class="nav-item px-3">
  150. <a :class="this.mode == 'list' ? 'nav-link font-weight-bold text-uppercase text-primary' : 'nav-link font-weight-bold text-uppercase'" href="#" v-on:click.prevent="switchMode('list')"><i class="fas fa-th-list fa-lg"></i></a>
  151. </li>
  152. <li class="nav-item pr-3">
  153. <a :class="this.mode == 'collections' ? 'nav-link font-weight-bold text-uppercase text-primary' : 'nav-link font-weight-bold text-uppercase'" href="#" v-on:click.prevent="switchMode('collections')"><i class="fas fa-images fa-lg"></i></a>
  154. </li>
  155. <li class="nav-item" v-if="owner">
  156. <a :class="this.mode == 'bookmarks' ? 'nav-link font-weight-bold text-uppercase text-primary' : 'nav-link font-weight-bold text-uppercase'" href="#" v-on:click.prevent="switchMode('bookmarks')"><i class="fas fa-bookmark fa-lg"></i></a>
  157. </li>
  158. </ul>
  159. </div>
  160. <div class="container">
  161. <div class="profile-timeline mt-md-4">
  162. <div class="row" v-if="mode == 'grid'">
  163. <div class="col-4 p-0 p-sm-2 p-md-3 p-xs-1" v-for="(s, index) in timeline">
  164. <a class="card info-overlay card-md-border-0" :href="s.url">
  165. <div class="square">
  166. <span v-if="s.pf_type == 'photo:album'" class="float-right mr-3 post-icon"><i class="fas fa-images fa-2x"></i></span>
  167. <span v-if="s.pf_type == 'video'" class="float-right mr-3 post-icon"><i class="fas fa-video fa-2x"></i></span>
  168. <span v-if="s.pf_type == 'video:album'" class="float-right mr-3 post-icon"><i class="fas fa-film fa-2x"></i></span>
  169. <div class="square-content" v-bind:style="previewBackground(s)">
  170. </div>
  171. <div class="info-overlay-text">
  172. <h5 class="text-white m-auto font-weight-bold">
  173. <span>
  174. <span class="far fa-heart fa-lg p-2 d-flex-inline"></span>
  175. <span class="d-flex-inline">{{s.favourites_count}}</span>
  176. </span>
  177. <span>
  178. <span class="fas fa-retweet fa-lg p-2 d-flex-inline"></span>
  179. <span class="d-flex-inline">{{s.reblogs_count}}</span>
  180. </span>
  181. </h5>
  182. </div>
  183. </div>
  184. </a>
  185. </div>
  186. </div>
  187. <div class="row" v-if="mode == 'list'">
  188. <div class="col-md-8 col-lg-8 offset-md-2 px-0 timeline">
  189. <div class="card status-card card-md-rounded-0 my-sm-2 my-md-3 my-lg-4" :data-status-id="status.id" v-for="(status, index) in timeline" :key="status.id">
  190. <div class="card-header d-inline-flex align-items-center bg-white">
  191. <img v-bind:src="status.account.avatar" width="32px" height="32px" style="border-radius: 32px;">
  192. <a class="username font-weight-bold pl-2 text-dark" v-bind:href="status.account.url">
  193. {{status.account.username}}
  194. </a>
  195. <div v-if="user.hasOwnProperty('id')" class="text-right" style="flex-grow:1;">
  196. <div class="dropdown">
  197. <button class="btn btn-link text-dark no-caret dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="Post options">
  198. <span class="fas fa-ellipsis-v fa-lg text-muted"></span>
  199. </button>
  200. <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton">
  201. <a class="dropdown-item font-weight-bold" :href="status.url">Go to post</a>
  202. <span v-if="status.account.id != user.id">
  203. <a class="dropdown-item font-weight-bold" :href="reportUrl(status)">Report</a>
  204. <a class="dropdown-item font-weight-bold" v-on:click="muteProfile(status)">Mute Profile</a>
  205. <a class="dropdown-item font-weight-bold" v-on:click="blockProfile(status)">Block Profile</a>
  206. </span>
  207. <span v-if="status.account.id == user.id || user.is_admin == true">
  208. <a class="dropdown-item font-weight-bold" :href="editUrl(status)">Edit</a>
  209. <a class="dropdown-item font-weight-bold text-danger" v-on:click="deletePost(status)">Delete</a>
  210. </span>
  211. </div>
  212. </div>
  213. </div>
  214. </div>
  215. <div class="postPresenterContainer">
  216. <div v-if="status.pf_type === 'photo'" class="w-100">
  217. <photo-presenter :status="status"></photo-presenter>
  218. </div>
  219. <div v-else-if="status.pf_type === 'video'" class="w-100">
  220. <video-presenter :status="status"></video-presenter>
  221. </div>
  222. <div v-else-if="status.pf_type === 'photo:album'" class="w-100">
  223. <photo-album-presenter :status="status"></photo-album-presenter>
  224. </div>
  225. <div v-else-if="status.pf_type === 'video:album'" class="w-100">
  226. <video-album-presenter :status="status"></video-album-presenter>
  227. </div>
  228. <div v-else-if="status.pf_type === 'photo:video:album'" class="w-100">
  229. <mixed-album-presenter :status="status"></mixed-album-presenter>
  230. </div>
  231. <div v-else class="w-100">
  232. <p class="text-center p-0 font-weight-bold text-white">Error: Problem rendering preview.</p>
  233. </div>
  234. </div>
  235. <div class="card-body">
  236. <div class="reactions my-1" v-if="user.hasOwnProperty('id')">
  237. <h3 v-bind:class="[status.favourited ? 'fas fa-heart text-danger pr-3 m-0 cursor-pointer' : 'far fa-heart pr-3 m-0 like-btn cursor-pointer']" title="Like" v-on:click="likeStatus(status, $event)"></h3>
  238. <h3 class="far fa-comment pr-3 m-0 cursor-pointer" title="Comment" v-on:click="commentFocus(status, $event)"></h3>
  239. <h3 v-if="status.visibility == 'public'" v-bind:class="[status.reblogged ? 'far fa-share-square pr-3 m-0 text-primary cursor-pointer' : 'far fa-share-square pr-3 m-0 share-btn cursor-pointer']" title="Share" v-on:click="shareStatus(status, $event)"></h3>
  240. </div>
  241. <div class="likes font-weight-bold">
  242. <span class="like-count">{{status.favourites_count}}</span> {{status.favourites_count == 1 ? 'like' : 'likes'}}
  243. </div>
  244. <div class="caption">
  245. <p class="mb-2 read-more" style="overflow: hidden;">
  246. <span class="username font-weight-bold">
  247. <bdi><a class="text-dark" :href="status.account.url">{{status.account.username}}</a></bdi>
  248. </span>
  249. <span v-html="status.content"></span>
  250. </p>
  251. </div>
  252. <div class="comments">
  253. </div>
  254. <div class="timestamp pt-1">
  255. <p class="small text-uppercase mb-0">
  256. <a :href="status.url" class="text-muted">
  257. <timeago :datetime="status.created_at" :auto-update="60" :converter-options="{includeSeconds:true}" :title="timestampFormat(status.created_at)" v-b-tooltip.hover.bottom></timeago>
  258. </a>
  259. </p>
  260. </div>
  261. </div>
  262. <div class="card-footer bg-white d-none">
  263. <form class="" v-on:submit.prevent="commentSubmit(status, $event)">
  264. <input type="hidden" name="item" value="">
  265. <input class="form-control status-reply-input" name="comment" placeholder="Add a comment…" autocomplete="off">
  266. </form>
  267. </div>
  268. </div>
  269. </div>
  270. </div>
  271. <div v-if="['grid','list'].indexOf(mode) != -1 && timeline.length == 0">
  272. <div class="py-5 text-center text-muted">
  273. <p><i class="fas fa-camera-retro fa-2x"></i></p>
  274. <p class="h2 font-weight-light pt-3">No posts yet</p>
  275. </div>
  276. </div>
  277. <div v-if="timeline.length && ['grid','list'].indexOf(mode) != -1">
  278. <infinite-loading @infinite="infiniteTimeline">
  279. <div slot="no-more"></div>
  280. <div slot="no-results"></div>
  281. </infinite-loading>
  282. </div>
  283. <div class="row" v-if="mode == 'bookmarks'">
  284. <div v-if="bookmarks.length">
  285. <div class="col-4 p-0 p-sm-2 p-md-3 p-xs-1" v-for="(s, index) in bookmarks">
  286. <a class="card info-overlay card-md-border-0" :href="s.url">
  287. <div class="square">
  288. <span v-if="s.pf_type == 'photo:album'" class="float-right mr-3 post-icon"><i class="fas fa-images fa-2x"></i></span>
  289. <span v-if="s.pf_type == 'video'" class="float-right mr-3 post-icon"><i class="fas fa-video fa-2x"></i></span>
  290. <span v-if="s.pf_type == 'video:album'" class="float-right mr-3 post-icon"><i class="fas fa-film fa-2x"></i></span>
  291. <div class="square-content" v-bind:style="previewBackground(s)">
  292. </div>
  293. <div class="info-overlay-text">
  294. <h5 class="text-white m-auto font-weight-bold">
  295. <span>
  296. <span class="far fa-heart fa-lg p-2 d-flex-inline"></span>
  297. <span class="d-flex-inline">{{s.favourites_count}}</span>
  298. </span>
  299. <span>
  300. <span class="fas fa-retweet fa-lg p-2 d-flex-inline"></span>
  301. <span class="d-flex-inline">{{s.reblogs_count}}</span>
  302. </span>
  303. </h5>
  304. </div>
  305. </div>
  306. </a>
  307. </div>
  308. </div>
  309. <div v-else class="col-12">
  310. <div class="py-5 text-center text-muted">
  311. <p><i class="fas fa-bookmark fa-2x"></i></p>
  312. <p class="h2 font-weight-light pt-3">You have no saved bookmarks</p>
  313. </div>
  314. </div>
  315. </div>
  316. <div class="col-12" v-if="mode == 'collections'">
  317. <div v-if="collections.length" class="row">
  318. <div class="col-4 p-0 p-sm-2 p-md-3 p-xs-1" v-for="(c, index) in collections">
  319. <a class="card info-overlay card-md-border-0" :href="c.url">
  320. <div class="square">
  321. <div class="square-content" v-bind:style="'background-image: url(' + c.thumb + ');'">
  322. </div>
  323. </div>
  324. </a>
  325. </div>
  326. </div>
  327. <div v-else>
  328. <div class="py-5 text-center text-muted">
  329. <p><i class="fas fa-images fa-2x"></i></p>
  330. <p class="h2 font-weight-light pt-3">No collections yet</p>
  331. </div>
  332. </div>
  333. </div>
  334. </div>
  335. </div>
  336. </div>
  337. <div v-if="profileLayout == 'moment'">
  338. <div :class="momentBackground()" style="width:100%;min-height:274px;">
  339. </div>
  340. <div class="bg-white border-bottom">
  341. <div class="container">
  342. <div class="row">
  343. <div class="col-12 row mx-0">
  344. <div class="col-4"></div>
  345. <div class="col-4 text-center">
  346. <div class="d-block d-md-none">
  347. <img class="rounded-circle box-shadow" :src="profile.avatar" width="110px" height="110px" style="margin-top:-60px; border: 5px solid #fff">
  348. </div>
  349. <div class="d-none d-md-block">
  350. <img class="rounded-circle box-shadow" :src="profile.avatar" width="172px" height="172px" style="margin-top:-90px; border: 5px solid #fff">
  351. </div>
  352. </div>
  353. <div class="col-4 text-right mt-2">
  354. <span class="d-none d-md-inline-block pl-4">
  355. <a :href="'/users/'+profile.username+'.atom'" class="fas fa-rss fa-lg text-muted text-decoration-none"></a>
  356. </span>
  357. <span class="pl-md-4 pl-sm-2" v-if="owner">
  358. <a class="fas fa-cog fa-lg text-muted text-decoration-none" href="/settings/home"></a>
  359. </span>
  360. <span class="pl-md-4 pl-sm-2" v-if="profile.id != user.id && user.hasOwnProperty('id')">
  361. <a class="fas fa-cog fa-lg text-muted text-decoration-none" href="#" @click.prevent="visitorMenu"></a>
  362. </span>
  363. <span v-if="profile.id != user.id && user.hasOwnProperty('id')">
  364. <span class="pl-md-4 pl-sm-2" v-if="relationship.following == true">
  365. <button type="button" class="btn btn-outline-secondary font-weight-bold btn-sm" @click.prevent="followProfile()" data-toggle="tooltip" title="Unfollow">Unfollow</button>
  366. </span>
  367. <span class="pl-md-4 pl-sm-2" v-else>
  368. <button type="button" class="btn btn-primary font-weight-bold btn-sm" @click.prevent="followProfile()" data-toggle="tooltip" title="Follow">Follow</button>
  369. </span>
  370. </span>
  371. </div>
  372. </div>
  373. <div class="col-12 text-center">
  374. <div class="profile-details my-3">
  375. <p class="font-weight-ultralight h2 text-center">{{profile.username}}</p>
  376. <div v-if="profile.note" class="text-center text-muted p-3" v-html="profile.note"></div>
  377. <div class="pb-3 text-muted text-center">
  378. <a class="text-lighter" :href="profile.url">
  379. <span class="font-weight-bold">{{profile.statuses_count}}</span>
  380. Posts
  381. </a>
  382. <a v-if="profileSettings.followers.count" class="text-lighter cursor-pointer px-3" v-on:click="followersModal()">
  383. <span class="font-weight-bold">{{profile.followers_count}}</span>
  384. Followers
  385. </a>
  386. <a v-if="profileSettings.following.count" class="text-lighter cursor-pointer" v-on:click="followingModal()">
  387. <span class="font-weight-bold">{{profile.following_count}}</span>
  388. Following
  389. </a>
  390. </div>
  391. </div>
  392. </div>
  393. </div>
  394. </div>
  395. </div>
  396. <div class="container-fluid">
  397. <div class="profile-timeline mt-md-4">
  398. <div class="card-columns" v-if="mode == 'grid'">
  399. <div class="p-sm-2 p-md-3" v-for="(s, index) in timeline">
  400. <a class="card info-overlay card-md-border-0" :href="s.url">
  401. <img :src="previewUrl(s)" class="img-fluid w-100">
  402. </a>
  403. </div>
  404. </div>
  405. <div v-if="timeline.length">
  406. <infinite-loading @infinite="infiniteTimeline">
  407. <div slot="no-more"></div>
  408. <div slot="no-results"></div>
  409. </infinite-loading>
  410. </div>
  411. </div>
  412. </div>
  413. </div>
  414. </div>
  415. <b-modal ref="followingModal"
  416. id="following-modal"
  417. hide-footer
  418. centered
  419. title="Following"
  420. body-class="list-group-flush p-0">
  421. <div class="list-group">
  422. <div class="list-group-item border-0" v-for="(user, index) in following" :key="'following_'+index">
  423. <div class="media">
  424. <a :href="user.url">
  425. <img class="mr-3 rounded-circle box-shadow" :src="user.avatar" :alt="user.username + '’s avatar'" width="30px" loading="lazy">
  426. </a>
  427. <div class="media-body">
  428. <p class="mb-0" style="font-size: 14px">
  429. <a :href="user.url" class="font-weight-bold text-dark">
  430. {{user.username}}
  431. </a>
  432. </p>
  433. <p class="text-muted mb-0" style="font-size: 14px">
  434. {{user.display_name}}
  435. </p>
  436. </div>
  437. <div v-if="owner">
  438. <a class="btn btn-outline-secondary btn-sm" href="#" @click.prevent="followModalAction(user.id, index, 'following')">Unfollow</a>
  439. </div>
  440. </div>
  441. </div>
  442. <div v-if="following.length == 0" class="list-group-item border-0">
  443. <div class="list-group-item border-0">
  444. <p class="p-3 text-center mb-0 lead">You are not following anyone.</p>
  445. </div>
  446. </div>
  447. <div v-if="followingMore" class="list-group-item text-center" v-on:click="followingLoadMore()">
  448. <p class="mb-0 small text-muted font-weight-light cursor-pointer">Load more</p>
  449. </div>
  450. </div>
  451. </b-modal>
  452. <b-modal ref="followerModal"
  453. id="follower-modal"
  454. hide-footer
  455. centered
  456. title="Followers"
  457. body-class="list-group-flush p-0">
  458. <div class="list-group">
  459. <div class="list-group-item border-0" v-for="(user, index) in followers" :key="'follower_'+index">
  460. <div class="media">
  461. <a :href="user.url">
  462. <img class="mr-3 rounded-circle box-shadow" :src="user.avatar" :alt="user.username + '’s avatar'" width="30px" loading="lazy">
  463. </a>
  464. <div class="media-body">
  465. <p class="mb-0" style="font-size: 14px">
  466. <a :href="user.url" class="font-weight-bold text-dark">
  467. {{user.username}}
  468. </a>
  469. </p>
  470. <p class="text-muted mb-0" style="font-size: 14px">
  471. {{user.display_name}}
  472. </p>
  473. </div>
  474. </div>
  475. </div>
  476. <div v-if="followerMore" class="list-group-item text-center" v-on:click="followersLoadMore()">
  477. <p class="mb-0 small text-muted font-weight-light cursor-pointer">Load more</p>
  478. </div>
  479. </div>
  480. </b-modal>
  481. <b-modal ref="visitorContextMenu"
  482. id="visitor-context-menu"
  483. hide-footer
  484. hide-header
  485. centered
  486. size="sm"
  487. body-class="list-group-flush p-0">
  488. <div class="list-group" v-if="relationship">
  489. <div v-if="!owner && !relationship.following" class="list-group-item cursor-pointer text-center font-weight-bold lead rounded text-primary" @click="followProfile">
  490. Follow
  491. </div>
  492. <div v-if="!owner && relationship.following" class="list-group-item cursor-pointer text-center font-weight-bold lead rounded" @click="followProfile">
  493. Unfollow
  494. </div>
  495. <div v-if="!owner && !relationship.muting" class="list-group-item cursor-pointer text-center font-weight-bold lead rounded" @click="muteProfile">
  496. Mute
  497. </div>
  498. <div v-if="!owner && relationship.muting" class="list-group-item cursor-pointer text-center font-weight-bold lead rounded" @click="unmuteProfile">
  499. Unmute
  500. </div>
  501. <div v-if="!owner" class="list-group-item cursor-pointer text-center font-weight-bold lead rounded text-danger" @click="reportProfile">
  502. Report User
  503. </div>
  504. <div v-if="!owner && !relationship.blocking" class="list-group-item cursor-pointer text-center font-weight-bold lead rounded text-danger" @click="blockProfile">
  505. Block
  506. </div>
  507. <div v-if="!owner && relationship.blocking" class="list-group-item cursor-pointer text-center font-weight-bold lead rounded text-danger" @click="unblockProfile">
  508. Unblock
  509. </div>
  510. <div class="list-group-item cursor-pointer text-center font-weight-bold lead rounded text-muted" @click="$refs.visitorContextMenu.hide()">
  511. Close
  512. </div>
  513. </div>
  514. </b-modal>
  515. <b-modal ref="sponsorModal"
  516. id="sponsor-modal"
  517. hide-footer
  518. :title="'Sponsor ' + profileUsername"
  519. centered
  520. size="md"
  521. body-class="px-5">
  522. <div>
  523. <p class="font-weight-bold">External Links</p>
  524. <p v-if="sponsorList.patreon" class="pt-2">
  525. <a :href="'https://' + sponsorList.patreon" rel="nofollow" class="font-weight-bold">{{sponsorList.patreon}}</a>
  526. </p>
  527. <p v-if="sponsorList.liberapay" class="pt-2">
  528. <a :href="'https://' + sponsorList.liberapay" rel="nofollow" class="font-weight-bold">{{sponsorList.liberapay}}</a>
  529. </p>
  530. <p v-if="sponsorList.opencollective" class="pt-2">
  531. <a :href="'https://' + sponsorList.opencollective" rel="nofollow" class="font-weight-bold">{{sponsorList.opencollective}}</a>
  532. </p>
  533. </div>
  534. </b-modal>
  535. </div>
  536. </template>
  537. <style type="text/css" scoped>
  538. .o-square {
  539. max-width: 320px;
  540. }
  541. .o-portrait {
  542. max-width: 320px;
  543. }
  544. .o-landscape {
  545. max-width: 320px;
  546. }
  547. .post-icon {
  548. color: #fff;
  549. position:relative;
  550. margin-top: 10px;
  551. z-index: 9;
  552. opacity: 0.6;
  553. text-shadow: 3px 3px 16px #272634;
  554. }
  555. </style>
  556. <script type="text/javascript">
  557. export default {
  558. props: [
  559. 'profile-id',
  560. 'profile-layout',
  561. 'profile-settings',
  562. 'profile-username'
  563. ],
  564. data() {
  565. return {
  566. ids: [],
  567. profile: {},
  568. user: {},
  569. timeline: [],
  570. timelinePage: 2,
  571. min_id: 0,
  572. max_id: 0,
  573. loading: true,
  574. owner: false,
  575. mode: 'grid',
  576. modes: ['grid', 'list', 'masonry', 'bookmarks'],
  577. modalStatus: false,
  578. relationship: {},
  579. followers: [],
  580. followerCursor: 1,
  581. followerMore: true,
  582. following: [],
  583. followingCursor: 1,
  584. followingMore: true,
  585. warning: false,
  586. sponsorList: [],
  587. bookmarks: [],
  588. bookmarksPage: 2,
  589. collections: [],
  590. collectionsPage: 2
  591. }
  592. },
  593. beforeMount() {
  594. this.fetchRelationships();
  595. this.fetchProfile();
  596. if(window.outerWidth < 576 && window.history.length > 2) {
  597. $('nav.navbar').hide();
  598. $('body').prepend('<div class="bg-white p-3 border-bottom"><div class="d-flex justify-content-between align-items-center"><div onclick="window.history.back();"><i class="fas fa-chevron-left fa-lg"></i></div><div class="font-weight-bold">' + this.profileUsername + '</div><div><i class="fas fa-chevron-right text-white fa-lg"></i></div></div></div>');
  599. }
  600. let u = new URLSearchParams(window.location.search);
  601. if(u.has('ui') && u.get('ui') == 'moment' && this.profileLayout != 'moment') {
  602. this.profileLayout = 'moment';
  603. }
  604. if(u.has('ui') && u.get('ui') == 'metro' && this.profileLayout != 'metro') {
  605. this.profileLayout = 'metro';
  606. }
  607. },
  608. mounted() {
  609. },
  610. updated() {
  611. },
  612. methods: {
  613. fetchProfile() {
  614. axios.get('/api/v1/accounts/' + this.profileId).then(res => {
  615. this.profile = res.data;
  616. });
  617. if(document.querySelectorAll('body')[0].classList.contains('loggedIn') == true) {
  618. axios.get('/api/v1/accounts/verify_credentials').then(res => {
  619. this.user = res.data;
  620. });
  621. }
  622. let apiUrl = '/api/v1/accounts/' + this.profileId + '/statuses';
  623. axios.get(apiUrl, {
  624. params: {
  625. only_media: true,
  626. min_id: 1,
  627. }
  628. })
  629. .then(res => {
  630. let data = res.data.filter(status => status.media_attachments.length > 0);
  631. let ids = data.map(status => status.id);
  632. this.ids = ids;
  633. this.min_id = Math.max(...ids);
  634. this.max_id = Math.min(...ids);
  635. this.modalStatus = _.first(res.data);
  636. this.timeline = data;
  637. this.ownerCheck();
  638. this.loading = false;
  639. this.loadSponsor();
  640. }).catch(err => {
  641. swal(
  642. 'Oops, something went wrong',
  643. 'Please release the page.',
  644. 'error'
  645. );
  646. });
  647. },
  648. ownerCheck() {
  649. this.owner = this.profile.id === this.user.id;
  650. },
  651. infiniteTimeline($state) {
  652. if(this.loading || this.timeline.length < 9) {
  653. $state.complete();
  654. return;
  655. }
  656. let apiUrl = '/api/v1/accounts/' + this.profileId + '/statuses';
  657. axios.get(apiUrl, {
  658. params: {
  659. only_media: true,
  660. max_id: this.max_id
  661. },
  662. }).then(res => {
  663. if (res.data.length && this.loading == false) {
  664. let data = res.data;
  665. let self = this;
  666. data.forEach(d => {
  667. if(self.ids.indexOf(d.id) == -1) {
  668. self.timeline.push(d);
  669. self.ids.push(d.id);
  670. }
  671. });
  672. this.min_id = Math.max(...this.ids);
  673. this.max_id = Math.min(...this.ids);
  674. $state.loaded();
  675. this.loading = false;
  676. } else {
  677. $state.complete();
  678. }
  679. });
  680. },
  681. previewUrl(status) {
  682. return status.sensitive ? '/storage/no-preview.png?v=' + new Date().getTime() : status.media_attachments[0].preview_url;
  683. },
  684. previewBackground(status) {
  685. let preview = this.previewUrl(status);
  686. return 'background-image: url(' + preview + ');';
  687. },
  688. switchMode(mode) {
  689. this.mode = _.indexOf(this.modes, mode) ? mode : 'grid';
  690. if(this.mode == 'bookmarks' && this.bookmarks.length == 0) {
  691. axios.get('/api/local/bookmarks')
  692. .then(res => {
  693. this.bookmarks = res.data
  694. });
  695. }
  696. if(this.mode == 'collections' && this.collections.length == 0) {
  697. axios.get('/api/local/profile/collections/' + this.profileId)
  698. .then(res => {
  699. this.collections = res.data
  700. });
  701. }
  702. },
  703. reportProfile() {
  704. let id = this.profile.id;
  705. window.location.href = '/i/report?type=user&id=' + id;
  706. },
  707. reportUrl(status) {
  708. let type = status.in_reply_to ? 'comment' : 'post';
  709. let id = status.id;
  710. return '/i/report?type=' + type + '&id=' + id;
  711. },
  712. commentFocus(status, $event) {
  713. let el = event.target;
  714. let card = el.parentElement.parentElement.parentElement;
  715. let comments = card.getElementsByClassName('comments')[0];
  716. if(comments.children.length == 0) {
  717. comments.classList.add('mb-2');
  718. this.fetchStatusComments(status, card);
  719. }
  720. let footer = card.querySelectorAll('.card-footer')[0];
  721. let input = card.querySelectorAll('.status-reply-input')[0];
  722. if(footer.classList.contains('d-none') == true) {
  723. footer.classList.remove('d-none');
  724. input.focus();
  725. } else {
  726. footer.classList.add('d-none');
  727. input.blur();
  728. }
  729. },
  730. likeStatus(status, $event) {
  731. if($('body').hasClass('loggedIn') == false) {
  732. return;
  733. }
  734. axios.post('/i/like', {
  735. item: status.id
  736. }).then(res => {
  737. status.favourites_count = res.data.count;
  738. if(status.favourited == true) {
  739. status.favourited = false;
  740. } else {
  741. status.favourited = true;
  742. }
  743. }).catch(err => {
  744. swal('Error', 'Something went wrong, please try again later.', 'error');
  745. });
  746. },
  747. shareStatus(status, $event) {
  748. if($('body').hasClass('loggedIn') == false) {
  749. return;
  750. }
  751. axios.post('/i/share', {
  752. item: status.id
  753. }).then(res => {
  754. status.reblogs_count = res.data.count;
  755. if(status.reblogged == true) {
  756. status.reblogged = false;
  757. } else {
  758. status.reblogged = true;
  759. }
  760. }).catch(err => {
  761. swal('Error', 'Something went wrong, please try again later.', 'error');
  762. });
  763. },
  764. timestampFormat(timestamp) {
  765. let ts = new Date(timestamp);
  766. return ts.toDateString() + ' ' + ts.toLocaleTimeString();
  767. },
  768. editUrl(status) {
  769. return status.url + '/edit';
  770. },
  771. redirect(url) {
  772. window.location.href = url;
  773. return;
  774. },
  775. replyUrl(status) {
  776. let username = this.profile.username;
  777. let id = status.account.id == this.profile.id ? status.id : status.in_reply_to_id;
  778. return '/p/' + username + '/' + id;
  779. },
  780. mentionUrl(status) {
  781. let username = status.account.username;
  782. let id = status.id;
  783. return '/p/' + username + '/' + id;
  784. },
  785. statusOwner(status) {
  786. let sid = status.account.id;
  787. let uid = this.profile.id;
  788. if(sid == uid) {
  789. return true;
  790. } else {
  791. return false;
  792. }
  793. },
  794. fetchStatusComments(status, card) {
  795. axios.get('/api/v2/status/'+status.id+'/replies')
  796. .then(res => {
  797. let comments = card.querySelectorAll('.comments')[0];
  798. let data = res.data;
  799. data.forEach(function(i, k) {
  800. let username = document.createElement('a');
  801. username.classList.add('font-weight-bold');
  802. username.classList.add('text-dark');
  803. username.classList.add('mr-2');
  804. username.setAttribute('href', i.account.url);
  805. username.textContent = i.account.username;
  806. let text = document.createElement('span');
  807. text.innerHTML = i.content;
  808. let comment = document.createElement('p');
  809. comment.classList.add('read-more');
  810. comment.classList.add('mb-0');
  811. comment.appendChild(username);
  812. comment.appendChild(text);
  813. comments.appendChild(comment);
  814. });
  815. }).catch(err => {
  816. })
  817. },
  818. fetchRelationships() {
  819. if(document.querySelectorAll('body')[0].classList.contains('loggedIn') == false) {
  820. return;
  821. }
  822. axios.get('/api/v1/accounts/relationships', {
  823. params: {
  824. 'id[]': this.profileId
  825. }
  826. }).then(res => {
  827. if(res.data.length) {
  828. this.relationship = res.data[0];
  829. if(res.data[0].blocking == true) {
  830. this.warning = true;
  831. }
  832. }
  833. });
  834. },
  835. muteProfile(status = null) {
  836. if($('body').hasClass('loggedIn') == false) {
  837. return;
  838. }
  839. let id = this.profileId;
  840. axios.post('/i/mute', {
  841. type: 'user',
  842. item: id
  843. }).then(res => {
  844. this.fetchRelationships();
  845. this.$refs.visitorContextMenu.hide();
  846. swal('Success', 'You have successfully muted ' + this.profile.acct, 'success');
  847. }).catch(err => {
  848. swal('Error', 'Something went wrong. Please try again later.', 'error');
  849. });
  850. },
  851. unmuteProfile(status = null) {
  852. if($('body').hasClass('loggedIn') == false) {
  853. return;
  854. }
  855. let id = this.profileId;
  856. axios.post('/i/unmute', {
  857. type: 'user',
  858. item: id
  859. }).then(res => {
  860. this.fetchRelationships();
  861. this.$refs.visitorContextMenu.hide();
  862. swal('Success', 'You have successfully unmuted ' + this.profile.acct, 'success');
  863. }).catch(err => {
  864. swal('Error', 'Something went wrong. Please try again later.', 'error');
  865. });
  866. },
  867. blockProfile(status = null) {
  868. if($('body').hasClass('loggedIn') == false) {
  869. return;
  870. }
  871. let id = this.profileId;
  872. axios.post('/i/block', {
  873. type: 'user',
  874. item: id
  875. }).then(res => {
  876. this.warning = true;
  877. this.fetchRelationships();
  878. this.$refs.visitorContextMenu.hide();
  879. swal('Success', 'You have successfully blocked ' + this.profile.acct, 'success');
  880. }).catch(err => {
  881. swal('Error', 'Something went wrong. Please try again later.', 'error');
  882. });
  883. },
  884. unblockProfile(status = null) {
  885. if($('body').hasClass('loggedIn') == false) {
  886. return;
  887. }
  888. let id = this.profileId;
  889. axios.post('/i/unblock', {
  890. type: 'user',
  891. item: id
  892. }).then(res => {
  893. this.fetchRelationships();
  894. this.$refs.visitorContextMenu.hide();
  895. swal('Success', 'You have successfully unblocked ' + this.profile.acct, 'success');
  896. }).catch(err => {
  897. swal('Error', 'Something went wrong. Please try again later.', 'error');
  898. });
  899. },
  900. deletePost(status, index) {
  901. if($('body').hasClass('loggedIn') == false || status.account.id !== this.profile.id) {
  902. return;
  903. }
  904. axios.post('/i/delete', {
  905. type: 'status',
  906. item: status.id
  907. }).then(res => {
  908. this.timeline.splice(index,1);
  909. swal('Success', 'You have successfully deleted this post', 'success');
  910. }).catch(err => {
  911. swal('Error', 'Something went wrong. Please try again later.', 'error');
  912. });
  913. },
  914. commentSubmit(status, $event) {
  915. if($('body').hasClass('loggedIn') == false) {
  916. return;
  917. }
  918. let id = status.id;
  919. let form = $event.target;
  920. let input = $(form).find('input[name="comment"]');
  921. let comment = input.val();
  922. let comments = form.parentElement.parentElement.getElementsByClassName('comments')[0];
  923. axios.post('/i/comment', {
  924. item: id,
  925. comment: comment
  926. }).then(res => {
  927. input.val('');
  928. input.blur();
  929. let username = document.createElement('a');
  930. username.classList.add('font-weight-bold');
  931. username.classList.add('text-dark');
  932. username.classList.add('mr-2');
  933. username.setAttribute('href', this.user.url);
  934. username.textContent = this.user.username;
  935. let text = document.createElement('span');
  936. text.innerHTML = comment;
  937. let wrapper = document.createElement('p');
  938. wrapper.classList.add('read-more');
  939. wrapper.classList.add('mb-0');
  940. wrapper.appendChild(username);
  941. wrapper.appendChild(text);
  942. comments.insertBefore(wrapper, comments.firstChild);
  943. });
  944. },
  945. statusModal(status) {
  946. this.modalStatus = status;
  947. this.$refs.statusModalRef.show();
  948. },
  949. masonryOrientation(status) {
  950. let o = status.media_attachments[0].orientation;
  951. if(!o) {
  952. o = 'square';
  953. }
  954. return o;
  955. },
  956. followProfile() {
  957. if($('body').hasClass('loggedIn') == false) {
  958. return;
  959. }
  960. axios.post('/i/follow', {
  961. item: this.profileId
  962. }).then(res => {
  963. this.$refs.visitorContextMenu.hide();
  964. if(this.relationship.following) {
  965. this.profile.followers_count--;
  966. if(this.profile.locked == true) {
  967. window.location.href = '/';
  968. }
  969. } else {
  970. this.profile.followers_count++;
  971. }
  972. this.relationship.following = !this.relationship.following;
  973. }).catch(err => {
  974. if(err.response.data.message) {
  975. swal('Error', err.response.data.message, 'error');
  976. }
  977. });
  978. },
  979. followingModal() {
  980. if($('body').hasClass('loggedIn') == false) {
  981. window.location.href = encodeURI('/login?next=/' + this.profile.username + '/');
  982. return;
  983. }
  984. if(this.profileSettings.following.list == false) {
  985. return;
  986. }
  987. if(this.following.length > 0) {
  988. this.$refs.followingModal.show();
  989. return;
  990. }
  991. axios.get('/api/v1/accounts/'+this.profile.id+'/following', {
  992. params: {
  993. page: this.followingCursor
  994. }
  995. })
  996. .then(res => {
  997. this.following = res.data;
  998. this.followingCursor++;
  999. if(res.data.length < 10) {
  1000. this.followingMore = false;
  1001. }
  1002. });
  1003. this.$refs.followingModal.show();
  1004. },
  1005. followersModal() {
  1006. if($('body').hasClass('loggedIn') == false) {
  1007. window.location.href = encodeURI('/login?next=/' + this.profile.username + '/');
  1008. return;
  1009. }
  1010. if(this.profileSettings.followers.list == false) {
  1011. return;
  1012. }
  1013. if(this.followers.length > 0) {
  1014. this.$refs.followerModal.show();
  1015. return;
  1016. }
  1017. axios.get('/api/v1/accounts/'+this.profile.id+'/followers', {
  1018. params: {
  1019. page: this.followerCursor
  1020. }
  1021. })
  1022. .then(res => {
  1023. this.followers = res.data;
  1024. this.followerCursor++;
  1025. if(res.data.length < 10) {
  1026. this.followerMore = false;
  1027. }
  1028. })
  1029. this.$refs.followerModal.show();
  1030. },
  1031. followingLoadMore() {
  1032. if($('body').hasClass('loggedIn') == false) {
  1033. window.location.href = encodeURI('/login?next=/' + this.profile.username + '/');
  1034. return;
  1035. }
  1036. axios.get('/api/v1/accounts/'+this.profile.id+'/following', {
  1037. params: {
  1038. page: this.followingCursor
  1039. }
  1040. })
  1041. .then(res => {
  1042. if(res.data.length > 0) {
  1043. this.following.push(...res.data);
  1044. this.followingCursor++;
  1045. }
  1046. if(res.data.length < 10) {
  1047. this.followingMore = false;
  1048. }
  1049. });
  1050. },
  1051. followersLoadMore() {
  1052. if($('body').hasClass('loggedIn') == false) {
  1053. return;
  1054. }
  1055. axios.get('/api/v1/accounts/'+this.profile.id+'/followers', {
  1056. params: {
  1057. page: this.followerCursor
  1058. }
  1059. })
  1060. .then(res => {
  1061. if(res.data.length > 0) {
  1062. this.followers.push(...res.data);
  1063. this.followerCursor++;
  1064. }
  1065. if(res.data.length < 10) {
  1066. this.followerMore = false;
  1067. }
  1068. });
  1069. },
  1070. visitorMenu() {
  1071. if($('body').hasClass('loggedIn') == false) {
  1072. return;
  1073. }
  1074. this.$refs.visitorContextMenu.show();
  1075. },
  1076. followModalAction(id, index, type = 'following') {
  1077. axios.post('/i/follow', {
  1078. item: id
  1079. }).then(res => {
  1080. if(type == 'following') {
  1081. this.following.splice(index, 1);
  1082. this.profile.following_count--;
  1083. }
  1084. }).catch(err => {
  1085. if(err.response.data.message) {
  1086. swal('Error', err.response.data.message, 'error');
  1087. }
  1088. });
  1089. },
  1090. momentBackground() {
  1091. let c = 'w-100 h-100 mt-n3 ';
  1092. if(this.profile.header_bg) {
  1093. c += this.profile.header_bg == 'default' ? 'bg-pixelfed' : 'bg-moment-' + this.profile.header_bg;
  1094. } else {
  1095. c += 'bg-pixelfed';
  1096. }
  1097. return c;
  1098. },
  1099. loadSponsor() {
  1100. axios.get('/api/local/profile/sponsor/' + this.profileId)
  1101. .then(res => {
  1102. this.sponsorList = res.data;
  1103. });
  1104. },
  1105. showSponsorModal() {
  1106. this.$refs.sponsorModal.show();
  1107. }
  1108. }
  1109. }
  1110. </script>