logo

pleroma-fe

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

bookmark_folder_edit.vue (4308B)


  1. <template>
  2. <div class="panel-default panel BookmarkFolderEdit">
  3. <div
  4. ref="header"
  5. class="panel-heading folder-edit-heading"
  6. >
  7. <button
  8. class="button-unstyled go-back-button"
  9. @click="$router.back"
  10. >
  11. <FAIcon
  12. size="lg"
  13. icon="chevron-left"
  14. />
  15. </button>
  16. <h1 class="title">
  17. <i18n-t
  18. v-if="id"
  19. keypath="bookmark_folders.editing_folder"
  20. scope="global"
  21. >
  22. <template #folderName>
  23. {{ name }}
  24. </template>
  25. </i18n-t>
  26. <i18n-t
  27. v-else
  28. keypath="bookmark_folders.creating_folder"
  29. scope="global"
  30. />
  31. </h1>
  32. </div>
  33. <div class="panel-body">
  34. <div class="input-wrap">
  35. <label for="folder-edit-title">{{ $t('bookmark_folders.emoji') }}</label>
  36. <button
  37. class="input input-emoji"
  38. :title="$t('bookmark_folder.emoji_pick')"
  39. @click="showEmojiPicker"
  40. >
  41. <img
  42. v-if="emojiUrlDraft"
  43. class="iconEmoji iconEmoji-image"
  44. :src="emojiUrlDraft"
  45. :alt="emojiDraft"
  46. :title="emojiDraft"
  47. >
  48. <span
  49. v-else-if="emojiDraft"
  50. class="iconEmoji"
  51. >
  52. <span>
  53. {{ emojiDraft }}
  54. </span>
  55. </span>
  56. </button>
  57. <EmojiPicker
  58. ref="picker"
  59. class="emoji-picker-panel"
  60. @emoji="selectEmoji"
  61. @show="onShowPicker"
  62. @close="onClosePicker"
  63. />
  64. </div>
  65. <div class="input-wrap">
  66. <label for="folder-edit-title">{{ $t('bookmark_folders.name') }}</label>
  67. <input
  68. id="folder-edit-title"
  69. ref="name"
  70. v-model="nameDraft"
  71. class="input"
  72. >
  73. </div>
  74. </div>
  75. <div class="panel-footer">
  76. <span class="spacer" />
  77. <button
  78. v-if="!id"
  79. class="btn button-default footer-button"
  80. @click="createFolder"
  81. >
  82. {{ $t('bookmark_folders.create') }}
  83. </button>
  84. <button
  85. v-else-if="!reallyDelete"
  86. class="btn button-default footer-button"
  87. @click="reallyDelete = true"
  88. >
  89. {{ $t('bookmark_folders.delete') }}
  90. </button>
  91. <template v-else>
  92. {{ $t('bookmark_folders.really_delete') }}
  93. <button
  94. class="btn button-default footer-button"
  95. @click="deleteFolder"
  96. >
  97. {{ $t('general.yes') }}
  98. </button>
  99. <button
  100. class="btn button-default footer-button"
  101. @click="reallyDelete = false"
  102. >
  103. {{ $t('general.no') }}
  104. </button>
  105. </template>
  106. <div
  107. v-if="id && !reallyDelete"
  108. >
  109. <button
  110. class="btn button-default follow-button"
  111. @click="updateFolder"
  112. >
  113. {{ $t('bookmark_folders.update_folder') }}
  114. </button>
  115. </div>
  116. </div>
  117. </div>
  118. </template>
  119. <script src="./bookmark_folder_edit.js"></script>
  120. <style lang="scss">
  121. .BookmarkFolderEdit {
  122. --panel-body-padding: 0.5em;
  123. overflow: hidden;
  124. display: flex;
  125. flex-direction: column;
  126. .folder-edit-heading {
  127. grid-template-columns: auto minmax(50%, 1fr);
  128. }
  129. .panel-body {
  130. display: flex;
  131. gap: 0.5em;
  132. }
  133. .emoji-picker-panel {
  134. position: absolute;
  135. z-index: 20;
  136. margin-top: 2px;
  137. &.hide {
  138. display: none;
  139. }
  140. }
  141. .input-emoji {
  142. height: 2.5em;
  143. width: 2.5em;
  144. padding: 0;
  145. .iconEmoji {
  146. display: inline-block;
  147. text-align: center;
  148. object-fit: contain;
  149. vertical-align: middle;
  150. height: 2.5em;
  151. width: 2.5em;
  152. > span {
  153. font-size: 1.5rem;
  154. line-height: 2.5rem;
  155. }
  156. }
  157. img.iconEmoji {
  158. padding: 0.25em;
  159. box-sizing: border-box;
  160. }
  161. }
  162. .input-wrap {
  163. display: flex;
  164. flex-direction: column;
  165. gap: 0.5em;
  166. }
  167. .go-back-button {
  168. text-align: center;
  169. line-height: 1;
  170. height: 100%;
  171. align-self: start;
  172. width: var(--__panel-heading-height-inner);
  173. }
  174. .btn {
  175. margin: 0 0.5em;
  176. }
  177. .panel-footer {
  178. grid-template-columns: minmax(10%, 1fr);
  179. .footer-button {
  180. min-width: 9em;
  181. }
  182. }
  183. }
  184. </style>