Change the way headers of group of settings are displayed

This commit is contained in:
Angelina Filippova 2020-02-14 22:56:59 +03:00
parent 50ed2adf17
commit 0d991135fa
7 changed files with 31 additions and 38 deletions

View file

@ -359,7 +359,11 @@ export default {
metadatLowerCase: 'metadata', metadatLowerCase: 'metadata',
files: 'files', files: 'files',
successfullyRemoved: 'Setting removed successfully!', successfullyRemoved: 'Setting removed successfully!',
seeDocs: 'See Documentation' seeDocs: 'See Documentation',
assets: 'Assets',
emoji: 'Emoji',
markup: 'Markup settings',
corsPlug: 'CORS plug config'
}, },
invites: { invites: {
inviteTokens: 'Invite tokens', inviteTokens: 'Invite tokens',

View file

@ -4,12 +4,16 @@
<setting :setting-group="frontend" :data="frontendData"/> <setting :setting-group="frontend" :data="frontendData"/>
</el-form> </el-form>
<el-form ref="assetsData" :model="assetsData" :label-width="labelWidth"> <el-form ref="assetsData" :model="assetsData" :label-width="labelWidth">
<el-form-item label="Assets:" class="settings-input"/> <el-form-item class="grouped-settings-header">
<span class="label-font">{{ $t('settings.assets') }}</span>
</el-form-item>
<setting :setting-group="assets" :data="assetsData"/> <setting :setting-group="assets" :data="assetsData"/>
</el-form> </el-form>
<div class="line"/> <div class="line"/>
<el-form ref="emojiData" :model="emojiData" :label-width="labelWidth"> <el-form ref="emojiData" :model="emojiData" :label-width="labelWidth">
<el-form-item label="Emoji:" class="settings-input"/> <el-form-item class="grouped-settings-header">
<span class="label-font">{{ $t('settings.emoji') }}</span>
</el-form-item>
<setting :setting-group="emoji" :data="emojiData"/> <setting :setting-group="emoji" :data="emojiData"/>
</el-form> </el-form>
<div class="line"/> <div class="line"/>
@ -18,7 +22,9 @@
</el-form> </el-form>
<div class="line"/> <div class="line"/>
<el-form ref="markupData" :model="markupData" :label-width="labelWidth"> <el-form ref="markupData" :model="markupData" :label-width="labelWidth">
<el-form-item label="Markup settings:" class="settings-input"/> <el-form-item class="grouped-settings-header">
<span class="label-font">{{ $t('settings.markup') }}</span>
</el-form-item>
<setting :setting-group="markup" :data="markupData"/> <setting :setting-group="markup" :data="markupData"/>
</el-form> </el-form>
<div class="submit-button-container"> <div class="submit-button-container">

View file

@ -4,7 +4,9 @@
<setting :setting-group="http" :data="httpData"/> <setting :setting-group="http" :data="httpData"/>
</el-form> </el-form>
<el-form ref="corsPlugData" :model="corsPlugData" :label-width="labelWidth"> <el-form ref="corsPlugData" :model="corsPlugData" :label-width="labelWidth">
<el-form-item label="Cors plug config:" class="settings-input"/> <el-form-item class="grouped-settings-header">
<span class="label-font">{{ $t('settings.corsPlug') }}</span>
</el-form-item>
<setting :setting-group="corsPlug" :data="corsPlugData"/> <setting :setting-group="corsPlug" :data="corsPlugData"/>
</el-form> </el-form>
<div class="line"/> <div class="line"/>

View file

@ -16,8 +16,7 @@
:setting="subSetting" :setting="subSetting"
:data="data[setting.key]" :data="data[setting.key]"
:custom-label-width="isDesktop ? '120px' : '100px'" :custom-label-width="isDesktop ? '120px' : '100px'"
:label-class="'center-label'" :label-class="subSetting.type === 'keyword' ? 'center-label' : ''"
:input-class="'keyword-inner-input'"
:margin="isDesktop ? margin + 15 : margin + 8" :margin="isDesktop ? margin + 15 : margin + 8"
:nested="true"/> :nested="true"/>
</el-form-item> </el-form-item>
@ -76,20 +75,6 @@
@input="update($event, settingGroup.group, settingGroup.key, settingParent, setting.key, setting.type, nested)"> @input="update($event, settingGroup.group, settingGroup.key, settingParent, setting.key, setting.type, nested)">
<template slot="prepend">:</template> <template slot="prepend">:</template>
</el-input> </el-input>
<div v-if="setting.type === 'keyword'">
<div v-for="subSetting in setting.children" :key="subSetting.key">
<!-- {{ [...settingParent, subSetting].map(s => s.label) }} -->
<inputs
:setting-group="settingGroup"
:setting-parent="[...settingParent, subSetting]"
:setting="subSetting"
:data="data[setting.key]"
:custom-label-width="isDesktop ? '140px' : '100px'"
:label-class="'center-label'"
:input-class="'keyword-inner-input'"
:nested="true"/>
</div>
</div>
<!-- special inputs --> <!-- special inputs -->
<auto-linker-input v-if="settingGroup.group === ':auto_linker'" :data="data" :setting-group="settingGroup" :setting="setting"/> <auto-linker-input v-if="settingGroup.group === ':auto_linker'" :data="data" :setting-group="settingGroup" :setting="setting"/>
<mascots-input v-if="setting.key === ':mascots'" :data="keywordData" :setting-group="settingGroup" :setting="setting"/> <mascots-input v-if="setting.key === ':mascots'" :data="keywordData" :setting-group="settingGroup" :setting="setting"/>
@ -145,13 +130,6 @@ export default {
return {} return {}
} }
}, },
inputClass: {
type: String,
default: function() {
return 'input-class'
},
required: false
},
labelClass: { labelClass: {
type: String, type: String,
default: function() { default: function() {

View file

@ -38,13 +38,13 @@
</div> </div>
<div v-else> <div v-else>
<div class="input-container"> <div class="input-container">
<el-form-item class="settings-input"> <el-form-item class="grouped-settings-header">
<span slot="label"> <span slot="label">
{{ setting.label }}:
<el-tooltip v-if="isDesktop && canBeDeleted(setting.key)" :content="$t('settings.removeFromDB')" placement="bottom-end"> <el-tooltip v-if="isDesktop && canBeDeleted(setting.key)" :content="$t('settings.removeFromDB')" placement="bottom-end">
<el-button icon="el-icon-delete" circle size="mini" style="margin-left:5px" @click="removeSetting(setting.key)"/> <el-button icon="el-icon-delete" circle size="mini" style="margin-left:5px" @click="removeSetting(setting.key)"/>
</el-tooltip> </el-tooltip>
</span> </span>
<span class="label-font">{{ setting.label }}</span>
</el-form-item> </el-form-item>
<el-tooltip v-if="isMobile && canBeDeleted(setting.key)" :content="$t('settings.removeFromDB')" placement="bottom-end"> <el-tooltip v-if="isMobile && canBeDeleted(setting.key)" :content="$t('settings.removeFromDB')" placement="bottom-end">
<el-button icon="el-icon-delete" circle size="mini" class="settings-delete-button" @click="removeSetting(setting.key)"/> <el-button icon="el-icon-delete" circle size="mini" class="settings-delete-button" @click="removeSetting(setting.key)"/>

View file

@ -4,8 +4,8 @@
<setting :setting-group="upload" :data="uploadData"/> <setting :setting-group="upload" :data="uploadData"/>
</el-form> </el-form>
<el-form v-if="showUploadersLocal" ref="uploadersLocal" :model="uploadersLocalData" :label-width="labelWidth"> <el-form v-if="showUploadersLocal" ref="uploadersLocal" :model="uploadersLocalData" :label-width="labelWidth">
<el-form-item class="description-container description settings-input"> <el-form-item class="grouped-settings-header">
<span class="description"><p>Pleroma.Uploaders.Local</p></span> <span class="label-font">Pleroma.Uploaders.Local</span>
</el-form-item> </el-form-item>
<setting :setting-group="uploadersLocal" :data="uploadersLocalData"/> <setting :setting-group="uploadersLocal" :data="uploadersLocalData"/>
<div class="line"/> <div class="line"/>

View file

@ -63,6 +63,9 @@
.form-container { .form-container {
margin-bottom: 80px; margin-bottom: 80px;
} }
.grouped-settings-header {
margin: 0 0 14px 0;
}
.highlight { .highlight {
background-color: #e6e6e6; background-color: #e6e6e6;
} }
@ -111,13 +114,16 @@
width: 100%; width: 100%;
} }
} }
.keyword-inner-input {
margin-bottom: 22px;
}
label { label {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.label-font {
font-size: 14px;
color: #606266;
font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei";
font-weight: 700;
}
.limit-button-container { .limit-button-container {
display: flex; display: flex;
align-items: baseline; align-items: baseline;
@ -377,9 +383,6 @@
.icons-button-container { .icons-button-container {
line-height: 24px; line-height: 24px;
} }
.keyword-inner-input {
margin-bottom: 10px;
}
.line { .line {
margin-bottom: 10px; margin-bottom: 10px;
} }