logo

pleroma-fe

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

settings_modal.vue (5304B)


  1. <template>
  2. <Modal
  3. :is-open="modalActivated"
  4. class="settings-modal"
  5. :class="{ peek: modalPeeked }"
  6. :no-background="modalPeeked"
  7. >
  8. <div class="settings-modal-panel panel">
  9. <div class="panel-heading">
  10. <span class="title">
  11. {{ modalMode === 'user' ? $t('settings.settings') : $t('admin_dash.window_title') }}
  12. </span>
  13. <transition name="fade">
  14. <div
  15. v-if="currentSaveStateNotice"
  16. class="alert"
  17. :class="{ success: !currentSaveStateNotice.error, error: currentSaveStateNotice.error}"
  18. @click.prevent
  19. >
  20. {{ currentSaveStateNotice.error ? $t('settings.saving_err') : $t('settings.saving_ok') }}
  21. </div>
  22. </transition>
  23. <button
  24. class="btn button-default"
  25. :title="$t('general.peek')"
  26. @click="peekModal"
  27. >
  28. <FAIcon
  29. :icon="['far', 'window-minimize']"
  30. fixed-width
  31. />
  32. </button>
  33. <button
  34. class="btn button-default"
  35. :title="$t('general.close')"
  36. @click="closeModal"
  37. >
  38. <FAIcon
  39. icon="times"
  40. fixed-width
  41. />
  42. </button>
  43. </div>
  44. <div class="panel-body">
  45. <SettingsModalUserContent v-if="modalMode === 'user' && modalOpenedOnceUser" />
  46. <SettingsModalAdminContent v-if="modalMode === 'admin' && modalOpenedOnceAdmin" />
  47. </div>
  48. <div class="panel-footer settings-footer -flexible-height">
  49. <Popover
  50. v-if="modalMode === 'user'"
  51. class="export"
  52. trigger="click"
  53. placement="top"
  54. :offset="{ y: 5, x: 5 }"
  55. :bound-to="{ x: 'container' }"
  56. remove-padding
  57. >
  58. <template #trigger>
  59. <button
  60. class="btn button-default"
  61. :title="$t('general.close')"
  62. >
  63. <span>{{ $t("settings.file_export_import.backup_restore") }}</span>
  64. {{ ' ' }}
  65. <FAIcon
  66. icon="chevron-down"
  67. />
  68. </button>
  69. </template>
  70. <template #content="{close}">
  71. <div class="dropdown-menu">
  72. <button
  73. class="menu-item dropdown-item dropdown-item-icon"
  74. @click.prevent="backup"
  75. @click="close"
  76. >
  77. <FAIcon
  78. icon="file-download"
  79. fixed-width
  80. /><span>{{ $t("settings.file_export_import.backup_settings") }}</span>
  81. </button>
  82. <button
  83. class="menu-item dropdown-item dropdown-item-icon"
  84. @click.prevent="backupWithTheme"
  85. @click="close"
  86. >
  87. <FAIcon
  88. icon="file-download"
  89. fixed-width
  90. /><span>{{ $t("settings.file_export_import.backup_settings_theme") }}</span>
  91. </button>
  92. <button
  93. class="menu-item dropdown-item dropdown-item-icon"
  94. @click.prevent="restore"
  95. @click="close"
  96. >
  97. <FAIcon
  98. icon="file-upload"
  99. fixed-width
  100. /><span>{{ $t("settings.file_export_import.restore_settings") }}</span>
  101. </button>
  102. </div>
  103. </template>
  104. </Popover>
  105. <Checkbox
  106. :model-value="!!expertLevel"
  107. @update:modelValue="expertLevel = Number($event)"
  108. >
  109. {{ $t("settings.expert_mode") }}
  110. </Checkbox>
  111. <span v-if="modalMode === 'admin'">
  112. <i18n-t keypath="admin_dash.wip_notice">
  113. <template #adminFeLink>
  114. <a
  115. href="/pleroma/admin/#/login-pleroma"
  116. target="_blank"
  117. >
  118. {{ $t("admin_dash.old_ui_link") }}
  119. </a>
  120. </template>
  121. </i18n-t>
  122. </span>
  123. <span
  124. id="unscrolled-content"
  125. class="extra-content"
  126. />
  127. <span
  128. v-if="modalMode === 'admin'"
  129. class="admin-buttons"
  130. >
  131. <button
  132. class="button-default btn"
  133. :disabled="!adminDraftAny"
  134. @click="resetAdminDraft"
  135. >
  136. {{ $t("admin_dash.reset_all") }}
  137. </button>
  138. {{ ' ' }}
  139. <button
  140. class="button-default btn"
  141. :disabled="!adminDraftAny"
  142. @click="pushAdminDraft"
  143. >
  144. {{ $t("admin_dash.commit_all") }}
  145. </button>
  146. </span>
  147. </div>
  148. </div>
  149. <teleport to="#modal">
  150. <ConfirmModal
  151. v-if="$store.state.interface.temporaryChangesTimeoutId"
  152. :title="$t('settings.confirm_new_setting')"
  153. :cancel-text="$t('settings.revert')"
  154. :confirm-text="$t('settings.confirm')"
  155. @cancelled="$store.state.interface.temporaryChangesRevert"
  156. @accepted="$store.state.interface.temporaryChangesConfirm"
  157. >
  158. {{ $t('settings.confirm_new_question') }}
  159. </ConfirmModal>
  160. </teleport>
  161. </Modal>
  162. </template>
  163. <script src="./settings_modal.js"></script>
  164. <style src="./settings_modal.scss" lang="scss"></style>