logo

pleroma-fe

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

attachment_setting.vue (2567B)


  1. <template>
  2. <span
  3. v-if="matchesExpertLevel"
  4. class="AttachmentSetting"
  5. :class="{ '-compact': compact }"
  6. >
  7. <label
  8. :for="path"
  9. :class="{ 'faint': shouldBeDisabled }"
  10. >
  11. <template v-if="backendDescriptionLabel">
  12. {{ backendDescriptionLabel + ' ' }}
  13. </template>
  14. <template v-else-if="source === 'admin'">
  15. MISSING LABEL FOR {{ path }}
  16. </template>
  17. <slot v-else />
  18. </label>
  19. <p
  20. v-if="backendDescriptionDescription"
  21. class="setting-description"
  22. :class="{ 'faint': shouldBeDisabled }"
  23. >
  24. {{ backendDescriptionDescription + ' ' }}
  25. </p>
  26. <div class="attachment-input">
  27. <div class="controls control-field">
  28. <label for="path">{{ $t('settings.url') }}</label>
  29. <input
  30. :id="path"
  31. class="input string-input"
  32. :disabled="shouldBeDisabled"
  33. :value="realDraftMode ? draft : state"
  34. @change="update"
  35. >
  36. {{ ' ' }}
  37. <ModifiedIndicator
  38. :changed="isChanged"
  39. :onclick="reset"
  40. />
  41. <ProfileSettingIndicator :is-profile="isProfileSetting" />
  42. </div>
  43. <div v-if="!compact">{{ $t('settings.preview') }}</div>
  44. <Attachment
  45. class="attachment"
  46. :compact="compact"
  47. :attachment="attachment"
  48. size="small"
  49. hide-description
  50. />
  51. <div class="controls control-upload">
  52. <MediaUpload
  53. ref="mediaUpload"
  54. class="media-upload-icon"
  55. normal-button
  56. :accept-types="acceptTypes"
  57. @uploaded="setMediaFile"
  58. />
  59. </div>
  60. </div>
  61. <DraftButtons />
  62. </span>
  63. </template>
  64. <script src="./attachment_setting.js"></script>
  65. <style lang="scss">
  66. .AttachmentSetting {
  67. .attachment {
  68. display: block;
  69. width: 100%;
  70. height: 15em;
  71. margin-bottom: 0.5em;
  72. }
  73. .attachment-input {
  74. margin-left: 1em;
  75. display: flex;
  76. flex-direction: column;
  77. width: 20em;
  78. }
  79. &.-compact {
  80. .attachment-input {
  81. flex-direction: row;
  82. align-items: flex-end;
  83. }
  84. .attachment {
  85. flex: 0;
  86. order: 0;
  87. display: block;
  88. min-width: 4em;
  89. height: 4em;
  90. align-self: center;
  91. margin-bottom: 0;
  92. }
  93. .control-field {
  94. order: 1;
  95. min-width: 12em;
  96. margin-left: 0.5em;
  97. }
  98. .control-upload {
  99. order: 2;
  100. min-width: 12em;
  101. padding: 0 0.5em;
  102. }
  103. }
  104. .controls {
  105. margin-bottom: 0.5em;
  106. input,
  107. button {
  108. width: 100%;
  109. }
  110. }
  111. }
  112. </style>