add favicon setting and add compact layout for AttachmentSetting

This commit is contained in:
Henry Jameson 2023-11-01 22:10:46 +02:00
parent b6a4b62058
commit ce109c38f3
3 changed files with 40 additions and 5 deletions

View File

@ -6,6 +6,10 @@
<li> <li>
<StringSetting path=":pleroma.:instance.:name" /> <StringSetting path=":pleroma.:instance.:name" />
</li> </li>
<!-- See https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3963 -->
<li v-if="adminDraft[':pleroma'][':instance'][':favicon'] !== undefined">
<AttachmentSetting compact path=":pleroma.:instance.:favicon" />
</li>
<li> <li>
<StringSetting path=":pleroma.:instance.:email" /> <StringSetting path=":pleroma.:instance.:email" />
</li> </li>
@ -16,7 +20,7 @@
<StringSetting path=":pleroma.:instance.:short_description" /> <StringSetting path=":pleroma.:instance.:short_description" />
</li> </li>
<li> <li>
<AttachmentSetting path=":pleroma.:instance.:instance_thumbnail" /> <AttachmentSetting compact path=":pleroma.:instance.:instance_thumbnail" />
</li> </li>
<li> <li>
<AttachmentSetting path=":pleroma.:instance.:background_image" /> <AttachmentSetting path=":pleroma.:instance.:background_image" />

View File

@ -7,6 +7,7 @@ export default {
...Setting, ...Setting,
props: { props: {
...Setting.props, ...Setting.props,
compact: Boolean,
acceptTypes: { acceptTypes: {
type: String, type: String,
required: false, required: false,

View File

@ -2,6 +2,7 @@
<span <span
v-if="matchesExpertLevel" v-if="matchesExpertLevel"
class="AttachmentSetting" class="AttachmentSetting"
:class="{ '-compact': compact }"
> >
<label <label
:for="path" :for="path"
@ -24,8 +25,8 @@
{{ backendDescriptionDescription + ' ' }} {{ backendDescriptionDescription + ' ' }}
</p> </p>
<div class="attachment-input"> <div class="attachment-input">
<div>{{ $t('settings.url') }}</div> <div class="controls control-field">
<div class="controls"> <label for="path">{{ $t('settings.url') }}</label>
<input <input
:id="path" :id="path"
class="string-input" class="string-input"
@ -40,7 +41,7 @@
/> />
<ProfileSettingIndicator :is-profile="isProfileSetting" /> <ProfileSettingIndicator :is-profile="isProfileSetting" />
</div> </div>
<div>{{ $t('settings.preview') }}</div> <div v-if="!compact">{{ $t('settings.preview') }}</div>
<Attachment <Attachment
class="attachment" class="attachment"
:compact="compact" :compact="compact"
@ -50,7 +51,7 @@
@setMedia="onMedia" @setMedia="onMedia"
@naturalSizeLoad="onNaturalSizeLoad" @naturalSizeLoad="onNaturalSizeLoad"
/> />
<div class="controls"> <div class="controls control-upload">
<MediaUpload <MediaUpload
ref="mediaUpload" ref="mediaUpload"
class="media-upload-icon" class="media-upload-icon"
@ -84,6 +85,35 @@
width: 20em; width: 20em;
} }
&.-compact {
.attachment-input {
flex-direction: row;
align-items: flex-end;
}
.attachment {
flex: 0;
order: 0;
display: block;
min-width: 4em;
height: 4em;
align-self: center;
margin-bottom: 0;
}
.control-field {
order: 1;
min-width: 12em;
margin-left: 0.5em;
}
.control-upload {
order: 2;
min-width: 12em;
padding: 0 0.5em;
}
}
.controls { .controls {
margin-bottom: 0.5em; margin-bottom: 0.5em;