diff options
| author | Henry Jameson <me@hjkos.com> | 2023-04-13 01:11:20 +0300 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2023-04-13 01:11:20 +0300 |
| commit | 9aaa8a86f52bc97838c768a8859919a3ad6fd54f (patch) | |
| tree | 0b17c009f4151eb567fdf1d9ccb472be09130dfd /src/components/settings_modal/helpers/attachment_setting.vue | |
| parent | d8ed541d12382ec58ea1ab75acb1ca153e22f2e4 (diff) | |
initial implementation of attachmentsetting
Diffstat (limited to 'src/components/settings_modal/helpers/attachment_setting.vue')
| -rw-r--r-- | src/components/settings_modal/helpers/attachment_setting.vue | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/src/components/settings_modal/helpers/attachment_setting.vue b/src/components/settings_modal/helpers/attachment_setting.vue new file mode 100644 index 00000000..3a933511 --- /dev/null +++ b/src/components/settings_modal/helpers/attachment_setting.vue @@ -0,0 +1,70 @@ +<template> + <span + v-if="matchesExpertLevel" + class="AttachmentSetting" + > + <label :for="path" :class="{ 'faint': shouldBeDisabled }"> + <template v-if="backendDescriptionLabel"> + {{ backendDescriptionLabel + ' ' }} + </template> + <template v-else> + <slot /> + </template> + + </label> + <p + v-if="backendDescriptionDescription" + class="setting-description" + :class="{ 'faint': shouldBeDisabled }" + > + {{ backendDescriptionDescription + ' ' }} + </p> + <div class="attachment-input"> + <Attachment + class="attachment" + :compact="compact" + :attachment="attachment" + size="small" + hide-description + @setMedia="onMedia" + @naturalSizeLoad="onNaturalSizeLoad" + /> + <div class="controls"> + <media-upload + normal-button + ref="mediaUpload" + class="media-upload-icon" + :drop-files="dropFiles" + @uploaded="setMediaFile" + @upload-failed="uploadFailed" + /> + <input + :id="path" + class="string-input" + :disabled="shouldBeDisabled" + :value="realDraftMode ? draft : state" + @change="update" + > + {{ ' ' }} + <ModifiedIndicator + :changed="isChanged" + :onclick="reset" + /> + <ProfileSettingIndicator :is-profile="isProfileSetting" /> + </div> + </div> + <DraftButtons /> + </span> +</template> + +<script src="./attachment_setting.js"></script> + +<style lang="scss"> +.AttachmentSetting { + .attachment { + display: block; + width: 20em; + height: 15em; + } +} +</style> |
