#258 add scss asset to manage suggestions lists (add/remove)

This commit is contained in:
Mathieu Jaumotte 2021-11-25 13:21:55 +01:00
parent b09f32b1c2
commit 33c7a495c7
6 changed files with 76 additions and 37 deletions

View File

@ -1,36 +1,33 @@
<template>
<teleport to="#add-persons" v-if="isComponentVisible">
<teleport to="#add-persons" v-if="isComponentVisible">
<div class="flex-bloc concerned-groups" :class="getContext">
<persons-bloc
v-for="bloc in contextPersonsBlocs"
v-bind:key="bloc.key"
v-bind:bloc="bloc"
v-bind:blocWidth="getBlocWidth"
v-bind:setPersonsInBloc="setPersonsInBloc">
</persons-bloc>
</div>
<div v-if="getContext === 'accompanyingCourse' && suggestedEntities.length > 0">
<ul class="list-unstyled">
<li v-for="p in suggestedEntities" @click="addSuggestedEntity(p)">
<span class="badge bg-primary" style="cursor: pointer;">
<i class="fa fa-plus fa-fw text-success"></i>
{{ p.text }}
</span>
</li>
</ul>
</div>
<div class="flex-bloc concerned-groups" :class="getContext">
<persons-bloc
v-for="bloc in contextPersonsBlocs"
v-bind:key="bloc.key"
v-bind:bloc="bloc"
v-bind:blocWidth="getBlocWidth"
v-bind:setPersonsInBloc="setPersonsInBloc">
</persons-bloc>
</div>
<div v-if="getContext === 'accompanyingCourse' && suggestedEntities.length > 0">
<ul class="list-suggest add-items">
<li v-for="p in suggestedEntities" @click="addSuggestedEntity(p)">
<span>{{ p.text }}</span>
</li>
</ul>
</div>
<add-persons
buttonTitle="activity.add_persons"
modalTitle="activity.add_persons"
v-bind:key="addPersons.key"
v-bind:options="addPersonsOptions"
@addNewPersons="addNewPersons"
ref="addPersons">
</add-persons>
<add-persons
buttonTitle="activity.add_persons"
modalTitle="activity.add_persons"
v-bind:key="addPersons.key"
v-bind:options="addPersonsOptions"
@addNewPersons="addNewPersons"
ref="addPersons">
</add-persons>
</teleport>
</teleport>
</template>
<script>

View File

@ -1,12 +1,8 @@
<template>
<li>
<span class="badge bg-primary" :title="person.text">
<span class="chill_denomination">
{{ textCutted }}
</span>
<a class="fa fa-fw fa-times text-danger text-decoration-none"
@click.prevent="$emit('remove', person)">
</a>
<span :title="person.text">
<span class="chill_denomination">{{ textCutted }}</span>
<a @click.prevent="$emit('remove', person)"></a>
</span>
</li>
</template>

View File

@ -5,7 +5,7 @@
<h4>{{ $t(bloc.title) }}</h4>
</div>
<div class="item-col">
<ul class="list-content">
<ul class="list-suggest remove-items">
<person-badge
v-for="person in bloc.persons"
v-bind:key="person.id"

View File

@ -10,6 +10,9 @@
// Chill buttons
@import './scss/buttons';
// Chill badges
@import './scss/badge';
// Chill forms
@import './scss/forms';

View File

@ -0,0 +1,34 @@
///
/// A specific list of badges used to manage suggestions
/// use bootstrap badge styles, cfr. src/Bundle/ChillMainBundle/Resources/public/module/bootstrap/_custom.scss
///
ul.list-suggest {
list-style-type: none;
padding-left: 0;
&.add-items {
li {
cursor: pointer;
& > span:before {
font: normal normal normal 14px/1 ForkAwesome;
margin-right: 0.5em;
content: "\f067"; // fa-plus
color: var(--bs-success);
}
}
}
&.remove-items {
li {
a {
cursor: pointer;
&:before {
font: normal normal normal 14px/1 ForkAwesome;
margin-left: 0.5em;
content: "\f00d"; // fa-times
color: var(--bs-danger);
text-decoration: none;
}
}
}
}
}

View File

@ -4,3 +4,12 @@
*/
/// A specific list of badges, use bootstrap badge styles
/// cfr. src/Bundle/ChillMainBundle/Resources/public/chill/scss/badge.scss
ul.list-suggest {
li > span {
@extend .badge;
@extend .bg-primary;
}
}