mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
change from review
This commit is contained in:
parent
60303b172b
commit
cbedf6f046
@ -17,15 +17,12 @@
|
|||||||
autofocus
|
autofocus
|
||||||
:placeholder="`${$t('group.name')} …`"
|
:placeholder="`${$t('group.name')} …`"
|
||||||
/>
|
/>
|
||||||
<ds-text align="right">
|
|
||||||
<ds-chip size="base" :color="errors && errors.name && 'danger'">
|
<ds-chip size="base" :color="errors && errors.name && 'danger'">
|
||||||
{{ `${formData.name.length} / ${formSchema.name.max}` }}
|
{{ `${formData.name.length} / ${formSchema.name.min}–${formSchema.name.max}` }}
|
||||||
<base-icon v-if="errors && errors.name" name="warning" />
|
<base-icon v-if="errors && errors.name" name="warning" />
|
||||||
</ds-chip>
|
</ds-chip>
|
||||||
</ds-text>
|
|
||||||
|
|
||||||
<!-- Group Slug -->
|
<!-- Group Slug -->
|
||||||
<ds-space margin-top="large">
|
|
||||||
<ds-input
|
<ds-input
|
||||||
v-if="update"
|
v-if="update"
|
||||||
:label="$t('group.labelSlug')"
|
:label="$t('group.labelSlug')"
|
||||||
@ -33,14 +30,13 @@
|
|||||||
icon="at"
|
icon="at"
|
||||||
:placeholder="`${$t('group.labelSlug')} …`"
|
:placeholder="`${$t('group.labelSlug')} …`"
|
||||||
></ds-input>
|
></ds-input>
|
||||||
</ds-space>
|
|
||||||
|
|
||||||
<!-- groupType -->
|
<!-- groupType -->
|
||||||
<ds-space margin-top="large">
|
|
||||||
<ds-text class="select-label">
|
<ds-text class="select-label">
|
||||||
{{ $t('group.type') }}
|
{{ $t('group.type') }}
|
||||||
</ds-text>
|
</ds-text>
|
||||||
{{ formData.groupType }}
|
<!-- TODO: change it has to be implemented later -->
|
||||||
|
<!-- TODO: move 'ds-select' from styleguide to main code and implement missen translation etc. functionality -->
|
||||||
<select
|
<select
|
||||||
class="select ds-input appearance--auto"
|
class="select ds-input appearance--auto"
|
||||||
:value="formData.groupType"
|
:value="formData.groupType"
|
||||||
@ -53,26 +49,23 @@
|
|||||||
{{ $t(`group.types.${groupType}`) }}
|
{{ $t(`group.types.${groupType}`) }}
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
<ds-text align="right">
|
<ds-chip v-if="formData.groupType === ''" size="base" :color="formData.groupType === '' ? 'danger' : 'medium'">
|
||||||
<ds-chip size="base" :color="formData.groupType === '' ? 'danger' : 'medium'">
|
|
||||||
<base-icon v-if="formData.groupType === ''" name="warning" />
|
<base-icon v-if="formData.groupType === ''" name="warning" />
|
||||||
</ds-chip>
|
</ds-chip>
|
||||||
</ds-text>
|
|
||||||
</ds-space>
|
|
||||||
|
|
||||||
<!-- goal -->
|
<!-- goal -->
|
||||||
<ds-space margin-top="large">
|
|
||||||
<ds-input
|
<ds-input
|
||||||
:label="$t('group.goal')"
|
:label="$t('group.goal')"
|
||||||
v-model="formData.goal"
|
v-model="formData.about"
|
||||||
:placeholder="$t('group.goal') + ' …'"
|
:placeholder="$t('group.goal') + ' …'"
|
||||||
name="goal"
|
name="about"
|
||||||
rows="3"
|
rows="3"
|
||||||
/>
|
/>
|
||||||
</ds-space>
|
|
||||||
|
<ds-space margin-top="small" />
|
||||||
|
|
||||||
<!-- description -->
|
<!-- description -->
|
||||||
<ds-space margin-top="large">
|
|
||||||
<ds-text class="select-label">
|
<ds-text class="select-label">
|
||||||
{{ $t('group.description') }}
|
{{ $t('group.description') }}
|
||||||
</ds-text>
|
</ds-text>
|
||||||
@ -84,19 +77,17 @@
|
|||||||
name="description"
|
name="description"
|
||||||
@input="updateEditorDescription"
|
@input="updateEditorDescription"
|
||||||
/>
|
/>
|
||||||
<ds-text align="right">
|
|
||||||
<ds-chip size="base" :color="errors && errors.description && 'danger'">
|
<ds-chip size="base" :color="errors && errors.description && 'danger'">
|
||||||
{{ `${descriptionLength} / ${formSchema.description.min}` }}
|
{{ `${descriptionLength} / ${formSchema.description.min}` }}
|
||||||
<base-icon v-if="errors && errors.description" name="warning" />
|
<base-icon v-if="errors && errors.description" name="warning" />
|
||||||
</ds-chip>
|
</ds-chip>
|
||||||
</ds-text>
|
|
||||||
</ds-space>
|
|
||||||
|
|
||||||
<!-- actionRadius -->
|
<!-- actionRadius -->
|
||||||
<ds-space margin-top="large">
|
|
||||||
<ds-text class="select-label">
|
<ds-text class="select-label">
|
||||||
{{ $t('group.actionRadius') }}
|
{{ $t('group.actionRadius') }}
|
||||||
</ds-text>
|
</ds-text>
|
||||||
|
<!-- TODO: change it has to be implemented later -->
|
||||||
|
<!-- TODO: move 'ds-select' from styleguide to main code and implement missen translation etc. functionality -->
|
||||||
<select
|
<select
|
||||||
class="select ds-input appearance--auto"
|
class="select ds-input appearance--auto"
|
||||||
:options="actionRadiusOptions"
|
:options="actionRadiusOptions"
|
||||||
@ -113,15 +104,11 @@
|
|||||||
{{ $t(`group.actionRadii.${actionRadius}`) }}
|
{{ $t(`group.actionRadii.${actionRadius}`) }}
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
<ds-text align="right">
|
<ds-chip v-if="formData.actionRadius === ''" size="base" :color="formData.actionRadius === '' ? 'danger' : 'medium'">
|
||||||
<ds-chip size="base" :color="formData.actionRadius === '' ? 'danger' : 'medium'">
|
|
||||||
<base-icon v-if="formData.actionRadius === ''" name="warning" />
|
<base-icon v-if="formData.actionRadius === ''" name="warning" />
|
||||||
</ds-chip>
|
</ds-chip>
|
||||||
</ds-text>
|
|
||||||
</ds-space>
|
|
||||||
|
|
||||||
<!-- location -->
|
<!-- location -->
|
||||||
<ds-space margin-top="large">
|
|
||||||
<ds-select
|
<ds-select
|
||||||
id="city"
|
id="city"
|
||||||
:label="$t('settings.data.labelCity')"
|
:label="$t('settings.data.labelCity')"
|
||||||
@ -141,10 +128,11 @@
|
|||||||
@click="formData.locationName = ''"
|
@click="formData.locationName = ''"
|
||||||
style="position: relative; display: inline-block; right: -93%; top: -45px"
|
style="position: relative; display: inline-block; right: -93%; top: -45px"
|
||||||
></base-button>
|
></base-button>
|
||||||
</ds-space>
|
|
||||||
|
|
||||||
|
<ds-space margin-top="small" />
|
||||||
|
|
||||||
<!-- category -->
|
<!-- category -->
|
||||||
<ds-space margin-top="large">
|
|
||||||
<categories-select
|
<categories-select
|
||||||
v-if="categoriesActive"
|
v-if="categoriesActive"
|
||||||
model="categoryIds"
|
model="categoryIds"
|
||||||
@ -161,7 +149,8 @@
|
|||||||
<base-icon v-if="errors && errors.categoryIds" name="warning" />
|
<base-icon v-if="errors && errors.categoryIds" name="warning" />
|
||||||
</ds-chip>
|
</ds-chip>
|
||||||
</ds-text>
|
</ds-text>
|
||||||
</ds-space>
|
|
||||||
|
<!-- Submit -->
|
||||||
<ds-space margin-top="large">
|
<ds-space margin-top="large">
|
||||||
<nuxt-link to="/my-groups">
|
<nuxt-link to="/my-groups">
|
||||||
<ds-button>{{ $t('actions.cancel') }}</ds-button>
|
<ds-button>{{ $t('actions.cancel') }}</ds-button>
|
||||||
@ -208,7 +197,7 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
const { name, slug, groupType, goal, description, actionRadius, locationName, categories } =
|
const { name, slug, groupType, about, description, actionRadius, locationName, categories } =
|
||||||
this.group
|
this.group
|
||||||
return {
|
return {
|
||||||
categoriesActive: this.$env.CATEGORIES_ACTIVE,
|
categoriesActive: this.$env.CATEGORIES_ACTIVE,
|
||||||
@ -222,7 +211,7 @@ export default {
|
|||||||
name: name || '',
|
name: name || '',
|
||||||
slug: slug || '',
|
slug: slug || '',
|
||||||
groupType: groupType || '',
|
groupType: groupType || '',
|
||||||
goal: goal || '',
|
about: about || '',
|
||||||
description: description || '',
|
description: description || '',
|
||||||
locationName: locationName || '',
|
locationName: locationName || '',
|
||||||
actionRadius: actionRadius || '',
|
actionRadius: actionRadius || '',
|
||||||
@ -232,7 +221,7 @@ export default {
|
|||||||
name: { required: true, min: NAME_LENGTH_MIN, max: NAME_LENGTH_MAX },
|
name: { required: true, min: NAME_LENGTH_MIN, max: NAME_LENGTH_MAX },
|
||||||
slug: { required: false, min: NAME_LENGTH_MIN },
|
slug: { required: false, min: NAME_LENGTH_MIN },
|
||||||
groupType: { required: true },
|
groupType: { required: true },
|
||||||
goal: { required: false },
|
about: { required: false },
|
||||||
description: { required: true, min: DESCRIPTION_WITHOUT_HTML_LENGTH_MIN },
|
description: { required: true, min: DESCRIPTION_WITHOUT_HTML_LENGTH_MIN },
|
||||||
actionRadius: { required: true },
|
actionRadius: { required: true },
|
||||||
locationName: { required: false },
|
locationName: { required: false },
|
||||||
@ -268,11 +257,11 @@ export default {
|
|||||||
this.$refs.groupForm.update('description', value)
|
this.$refs.groupForm.update('description', value)
|
||||||
},
|
},
|
||||||
submit() {
|
submit() {
|
||||||
const { name, goal, description, groupType, actionRadius, locationName, categoryIds } =
|
const { name, about, description, groupType, actionRadius, locationName, categoryIds } =
|
||||||
this.formData
|
this.formData
|
||||||
const variables = {
|
const variables = {
|
||||||
name,
|
name,
|
||||||
goal,
|
about,
|
||||||
description,
|
description,
|
||||||
groupType,
|
groupType,
|
||||||
actionRadius,
|
actionRadius,
|
||||||
@ -333,9 +322,39 @@ export default {
|
|||||||
-moz-appearance: auto;
|
-moz-appearance: auto;
|
||||||
appearance: auto;
|
appearance: auto;
|
||||||
}
|
}
|
||||||
|
.select-label {
|
||||||
|
margin-bottom: 0;
|
||||||
|
padding-bottom: 4px;
|
||||||
|
color: #70677e;
|
||||||
|
font-size: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.textarea-label {
|
||||||
|
padding-bottom: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group-form > .base-card {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
> .ds-form-item {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
> .ds-chip {
|
||||||
|
align-self: flex-end;
|
||||||
|
margin: $space-xx-small 0 $space-base;
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
|
> .select-field {
|
||||||
|
align-self: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
> .buttons {
|
||||||
|
align-self: flex-end;
|
||||||
|
margin-top: $space-base;
|
||||||
|
}
|
||||||
|
|
||||||
ds-chip {
|
|
||||||
position: absolute;
|
|
||||||
right: 0px;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user