logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://anongit.hacktivis.me/git/pleroma-fe.git/

user_card.vue (10140B)


  1. <template>
  2. <div
  3. class="user-card"
  4. :class="classes"
  5. >
  6. <div
  7. :class="{ 'hide-bio': hideBio }"
  8. :style="style"
  9. class="background-image"
  10. />
  11. <div :class="onClose ? '' : 'panel-heading -flexible-height'">
  12. <div class="user-info">
  13. <div class="container">
  14. <a
  15. v-if="avatarAction === 'zoom'"
  16. class="user-info-avatar -link"
  17. @click="zoomAvatar"
  18. >
  19. <UserAvatar :user="user" />
  20. <div class="user-info-avatar -link -overlay">
  21. <FAIcon
  22. class="fa-scale-110 fa-old-padding"
  23. icon="search-plus"
  24. />
  25. </div>
  26. </a>
  27. <UserAvatar
  28. v-else-if="typeof avatarAction === 'function'"
  29. class="user-info-avatar"
  30. :user="user"
  31. @click="avatarAction"
  32. />
  33. <router-link
  34. v-else
  35. :to="userProfileLink(user)"
  36. >
  37. <UserAvatar :user="user" />
  38. </router-link>
  39. <div class="user-summary">
  40. <div class="top-line">
  41. <router-link
  42. :to="userProfileLink(user)"
  43. class="user-name"
  44. >
  45. <RichContent
  46. :title="user.name"
  47. :html="user.name"
  48. :emoji="user.emoji"
  49. />
  50. </router-link>
  51. <button
  52. v-if="!isOtherUser && user.is_local"
  53. class="button-unstyled edit-profile-button"
  54. @click.stop="openProfileTab"
  55. >
  56. <FAIcon
  57. fixed-width
  58. class="icon"
  59. icon="edit"
  60. :title="$t('user_card.edit_profile')"
  61. />
  62. </button>
  63. <a
  64. v-if="isOtherUser && !user.is_local"
  65. :href="user.statusnet_profile_url"
  66. target="_blank"
  67. class="button-unstyled external-link-button"
  68. >
  69. <FAIcon
  70. class="icon"
  71. icon="external-link-alt"
  72. />
  73. </a>
  74. <AccountActions
  75. v-if="isOtherUser && loggedIn"
  76. :user="user"
  77. :relationship="relationship"
  78. />
  79. <router-link
  80. v-if="onClose"
  81. :to="userProfileLink(user)"
  82. class="button-unstyled external-link-button"
  83. @click="onClose"
  84. >
  85. <FAIcon
  86. class="icon"
  87. icon="expand-alt"
  88. />
  89. </router-link>
  90. <button
  91. v-if="onClose"
  92. class="button-unstyled external-link-button"
  93. @click="onClose"
  94. >
  95. <FAIcon
  96. class="icon"
  97. icon="times"
  98. />
  99. </button>
  100. </div>
  101. <div class="bottom-line">
  102. <user-link
  103. class="user-screen-name"
  104. :user="user"
  105. />
  106. <template v-if="!hideBio">
  107. <span
  108. v-if="user.deactivated"
  109. class="alert neutral user-role"
  110. >
  111. {{ $t('user_card.deactivated') }}
  112. </span>
  113. <span
  114. v-if="!!visibleRole"
  115. class="alert neutral user-role"
  116. >
  117. {{ $t(`general.role.${visibleRole}`) }}
  118. </span>
  119. <span
  120. v-if="user.actor_type === 'Service'"
  121. class="alert neutral user-role"
  122. >
  123. {{ $t('user_card.bot') }}
  124. </span>
  125. <span
  126. v-if="user.actor_type === 'Group'"
  127. class="alert user-role"
  128. >
  129. {{ $t('user_card.group') }}
  130. </span>
  131. </template>
  132. <span v-if="user.locked">
  133. <FAIcon
  134. class="lock-icon"
  135. icon="lock"
  136. size="sm"
  137. />
  138. </span>
  139. <span
  140. v-if="!mergedConfig.hideUserStats && !hideBio"
  141. class="dailyAvg"
  142. >{{ dailyAvg }} {{ $t('user_card.per_day') }}</span>
  143. </div>
  144. </div>
  145. </div>
  146. <div class="user-meta">
  147. <div
  148. v-if="relationship.followed_by && loggedIn && isOtherUser"
  149. class="following"
  150. >
  151. {{ $t('user_card.follows_you') }}
  152. </div>
  153. <div
  154. v-if="isOtherUser && (loggedIn || !switcher)"
  155. class="highlighter"
  156. >
  157. <!-- id's need to be unique, otherwise vue confuses which user-card checkbox belongs to -->
  158. <input
  159. v-if="userHighlightType !== 'disabled'"
  160. :id="'userHighlightColorTx'+user.id"
  161. v-model="userHighlightColor"
  162. class="input userHighlightText"
  163. type="text"
  164. >
  165. <input
  166. v-if="userHighlightType !== 'disabled'"
  167. :id="'userHighlightColor'+user.id"
  168. v-model="userHighlightColor"
  169. class="input userHighlightCl"
  170. type="color"
  171. >
  172. {{ ' ' }}
  173. <Select
  174. :id="'userHighlightSel'+user.id"
  175. v-model="userHighlightType"
  176. class="userHighlightSel"
  177. >
  178. <option value="disabled">
  179. {{ $t('user_card.highlight.disabled') }}
  180. </option>
  181. <option value="solid">
  182. {{ $t('user_card.highlight.solid') }}
  183. </option>
  184. <option value="striped">
  185. {{ $t('user_card.highlight.striped') }}
  186. </option>
  187. <option value="side">
  188. {{ $t('user_card.highlight.side') }}
  189. </option>
  190. </Select>
  191. </div>
  192. </div>
  193. <div
  194. v-if="loggedIn && isOtherUser"
  195. class="user-interactions"
  196. >
  197. <div class="btn-group">
  198. <FollowButton
  199. :relationship="relationship"
  200. :user="user"
  201. />
  202. <template v-if="relationship.following">
  203. <ProgressButton
  204. v-if="!relationship.notifying"
  205. class="btn button-default"
  206. :click="subscribeUser"
  207. :title="$t('user_card.subscribe')"
  208. >
  209. <FAIcon icon="bell" />
  210. </ProgressButton>
  211. <ProgressButton
  212. v-else
  213. class="btn button-default toggled"
  214. :click="unsubscribeUser"
  215. :title="$t('user_card.unsubscribe')"
  216. >
  217. <FALayers>
  218. <FAIcon
  219. icon="rss"
  220. transform="left-5 shrink-6 up-3 rotate-20"
  221. flip="horizontal"
  222. />
  223. <FAIcon
  224. icon="rss"
  225. transform="right-5 shrink-6 up-3 rotate-20"
  226. />
  227. <FAIcon icon="bell" />
  228. </FALayers>
  229. </ProgressButton>
  230. </template>
  231. </div>
  232. <div>
  233. <button
  234. v-if="relationship.muting"
  235. class="btn button-default btn-block toggled"
  236. :disabled="user.deactivated"
  237. @click="unmuteUser"
  238. >
  239. {{ $t('user_card.muted') }}
  240. </button>
  241. <button
  242. v-else
  243. class="btn button-default btn-block"
  244. :disabled="user.deactivated"
  245. @click="muteUser"
  246. >
  247. {{ $t('user_card.mute') }}
  248. </button>
  249. </div>
  250. <div>
  251. <button
  252. class="btn button-default btn-block"
  253. :disabled="user.deactivated"
  254. @click="mentionUser"
  255. >
  256. {{ $t('user_card.mention') }}
  257. </button>
  258. </div>
  259. <ModerationTools
  260. v-if="showModerationMenu"
  261. :user="user"
  262. />
  263. </div>
  264. <div
  265. v-if="!loggedIn && user.is_local"
  266. class="user-interactions"
  267. >
  268. <RemoteFollow :user="user" />
  269. </div>
  270. <UserNote
  271. v-if="loggedIn && isOtherUser && (hasNote || (hasNoteEditor && supportsNote))"
  272. :user="user"
  273. :relationship="relationship"
  274. :editable="hasNoteEditor"
  275. />
  276. </div>
  277. </div>
  278. <div v-if="!hideBio">
  279. <div
  280. v-if="!mergedConfig.hideUserStats && switcher"
  281. class="user-counts"
  282. >
  283. <div
  284. class="user-count"
  285. @click.prevent="setProfileView('statuses')"
  286. >
  287. <h5>{{ $t('user_card.statuses') }}</h5>
  288. <span>{{ user.statuses_count }} <br></span>
  289. </div>
  290. <div
  291. class="user-count"
  292. @click.prevent="setProfileView('friends')"
  293. >
  294. <h5>{{ $t('user_card.followees') }}</h5>
  295. <span>{{ hideFollowsCount ? $t('user_card.hidden') : user.friends_count }}</span>
  296. </div>
  297. <div
  298. class="user-count"
  299. @click.prevent="setProfileView('followers')"
  300. >
  301. <h5>{{ $t('user_card.followers') }}</h5>
  302. <span>{{ hideFollowersCount ? $t('user_card.hidden') : user.followers_count }}</span>
  303. </div>
  304. </div>
  305. <RichContent
  306. v-if="!hideBio"
  307. class="user-card-bio"
  308. :html="user.description_html"
  309. :emoji="user.emoji"
  310. :handle-links="true"
  311. />
  312. </div>
  313. <teleport to="#modal">
  314. <mute-confirm
  315. ref="confirmation"
  316. type="user"
  317. :user="user"
  318. />
  319. </teleport>
  320. </div>
  321. </template>
  322. <script src="./user_card.js"></script>
  323. <style lang="scss" src="./user_card.scss" />