mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
modal addPerson design, search field: focus and position fixed
This commit is contained in:
parent
3d45b6687f
commit
a1bb9ea352
@ -28,7 +28,7 @@
|
|||||||
// @import "bootstrap/scss/card";
|
// @import "bootstrap/scss/card";
|
||||||
// @import "bootstrap/scss/breadcrumb";
|
// @import "bootstrap/scss/breadcrumb";
|
||||||
// @import "bootstrap/scss/pagination";
|
// @import "bootstrap/scss/pagination";
|
||||||
// @import "bootstrap/scss/badge";
|
@import "bootstrap/scss/badge";
|
||||||
// @import "bootstrap/scss/jumbotron";
|
// @import "bootstrap/scss/jumbotron";
|
||||||
// @import "bootstrap/scss/alert";
|
// @import "bootstrap/scss/alert";
|
||||||
// @import "bootstrap/scss/progress";
|
// @import "bootstrap/scss/progress";
|
||||||
|
@ -66,7 +66,7 @@ div.vue-component {
|
|||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background-color: rgba(0, 0, 0, 0.6);
|
background-color: rgba(0, 0, 0, 0.75);
|
||||||
display: table;
|
display: table;
|
||||||
transition: opacity 0.3s ease;
|
transition: opacity 0.3s ease;
|
||||||
}
|
}
|
||||||
@ -95,12 +95,29 @@ div.vue-component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//// AddPersons modal
|
//// AddPersons modal
|
||||||
ul.results {
|
div.results {
|
||||||
list-style-type: none;
|
padding: 0 1.3em;
|
||||||
padding-left: 1em;
|
div.list-item {
|
||||||
&.suggestions {
|
line-height: 26pt;
|
||||||
li {
|
display: flex;
|
||||||
line-height: 26pt;
|
flex-direction: row;
|
||||||
|
div.right_actions {
|
||||||
|
margin: 0 0 0 auto;
|
||||||
|
& > * {
|
||||||
|
margin-left: 0.5em;
|
||||||
|
}
|
||||||
|
a.sc-button {
|
||||||
|
border: 1px solid lightgrey;
|
||||||
|
font-size: 70%;
|
||||||
|
padding: 4px;
|
||||||
|
}
|
||||||
|
span {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a.discret {
|
||||||
|
color: grey;
|
||||||
|
margin-right: 1em;
|
||||||
|
}
|
||||||
|
@ -28,13 +28,14 @@ const messages = {
|
|||||||
remove: "Enlever",
|
remove: "Enlever",
|
||||||
delete: "Supprimer",
|
delete: "Supprimer",
|
||||||
save: "Enregistrer",
|
save: "Enregistrer",
|
||||||
|
add: "Ajouter",
|
||||||
show_modal: "Ouvrir une modale",
|
show_modal: "Ouvrir une modale",
|
||||||
ok: "OK",
|
ok: "OK",
|
||||||
cancel: "Annuler",
|
cancel: "Annuler",
|
||||||
close: "Fermer",
|
close: "Fermer",
|
||||||
next: "Suivant",
|
next: "Suivant",
|
||||||
previous: "Précédent",
|
previous: "Précédent",
|
||||||
back: "Retour"
|
back: "Retour",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -42,6 +42,9 @@ let getDataPromise = getAccompanyingCourse(id)
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
|
removeParticipation({ commit }, payload) {
|
||||||
|
commit('removeParticipation', payload);
|
||||||
|
},
|
||||||
addParticipation({ commit }, payload) {
|
addParticipation({ commit }, payload) {
|
||||||
commit('addParticipation', payload);
|
commit('addParticipation', payload);
|
||||||
postParticipation(id, payload.id).catch((error) => {
|
postParticipation(id, payload.id).catch((error) => {
|
||||||
|
@ -1,31 +1,36 @@
|
|||||||
<template>
|
<template>
|
||||||
<button class="sc-button bt-create centered mt-4"
|
<button class="sc-button bt-create centered mt-4" @click="openModal">
|
||||||
@click="modal.showModal = true">
|
|
||||||
{{ $t('add_persons.search_add_others_persons') }}
|
{{ $t('add_persons.search_add_others_persons') }}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<teleport to="body">
|
<teleport to="body">
|
||||||
<modal v-if="modal.showModal" :modalDialogClass="modal.modalDialogClass" @close="modal.showModal = false">
|
<modal v-if="modal.showModal" :modalDialogClass="modal.modalDialogClass"
|
||||||
|
@close="modal.showModal = false">
|
||||||
<template v-slot:header>
|
<template v-slot:header>
|
||||||
|
|
||||||
<h3 class="modal-title">{{ $t('add_persons.title') }}</h3>
|
<h3 class="modal-title">{{ $t('add_persons.title') }}</h3>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
<template v-slot:body-fixed>
|
||||||
|
|
||||||
|
<label style="float: right;">{{ $tc('add_persons.counter', counter) }}</label>
|
||||||
|
<input class="my-4" v-model="query" name="query" ref="search"
|
||||||
|
:placeholder="$t('add_persons.search_some_persons')" />
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:body>
|
<template v-slot:body>
|
||||||
|
|
||||||
<label style="float: right;">{{ $tc('add_persons.counter', counter) }}</label>
|
<div class="results">
|
||||||
|
|
||||||
<input class="my-4" v-model="query" name="query"
|
|
||||||
:placeholder="$t('add_persons.search_some_persons')" />
|
|
||||||
|
|
||||||
<ul class="results suggestions">
|
|
||||||
<person-suggestion v-for="item in suggested.results"
|
<person-suggestion v-for="item in suggested.results"
|
||||||
v-bind:item="item"
|
v-bind:item="item"
|
||||||
v-bind:key="item.id">
|
v-bind:key="item.id">
|
||||||
</person-suggestion>
|
</person-suggestion>
|
||||||
</ul>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:footer>
|
<template v-slot:footer>
|
||||||
<button class="sc-button green" @click="modal.showModal = false">{{ $t('action.save')}}</button>
|
<button class="sc-button green" @click="AddPersons">
|
||||||
|
<i class="fa fa-plus fa-fw"></i>{{ $t('action.add')}}</button>
|
||||||
</template>
|
</template>
|
||||||
</modal>
|
</modal>
|
||||||
</teleport>
|
</teleport>
|
||||||
@ -50,6 +55,14 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
methods: {
|
||||||
|
openModal() {
|
||||||
|
this.modal.showModal = true;
|
||||||
|
this.$nextTick(function() {
|
||||||
|
this.$refs.search.focus();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['add_persons']),
|
...mapState(['add_persons']),
|
||||||
query: {
|
query: {
|
||||||
@ -66,6 +79,9 @@ export default {
|
|||||||
counter() {
|
counter() {
|
||||||
if (! this.add_persons.suggested.results) { return 0; }
|
if (! this.add_persons.suggested.results) { return 0; }
|
||||||
return this.add_persons.suggested.results.length;
|
return this.add_persons.suggested.results.length;
|
||||||
|
},
|
||||||
|
AddPersons() {
|
||||||
|
console.log('add persons');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,9 @@
|
|||||||
<button class="close sc-button grey" @click="$emit('close')">
|
<button class="close sc-button grey" @click="$emit('close')">
|
||||||
<i class="fa fa-times" aria-hidden="true"></i></button>
|
<i class="fa fa-times" aria-hidden="true"></i></button>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="modal-body" style="overflow-y: unset;">
|
||||||
|
<slot name="body-fixed"></slot>
|
||||||
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<slot name="body"></slot>
|
<slot name="body"></slot>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,13 +1,30 @@
|
|||||||
<template>
|
<template>
|
||||||
<li>
|
<div class="list-item">
|
||||||
{{ item.text }}
|
<div>
|
||||||
{{ item.id }}
|
<a class="discret" target="_blank" :href="url.show">{{ item.id }}</a>
|
||||||
</li>
|
{{ item.text }}
|
||||||
|
</div>
|
||||||
|
<div class="right_actions">
|
||||||
|
<span class="badge badge-pill badge-secondary" :title="item.id">
|
||||||
|
{{ $t('item.type_person') }}
|
||||||
|
</span>
|
||||||
|
<a class="sc-button bt-show" target="_blank" :title="item.id" :href="url.show"></a>
|
||||||
|
<input class="" type="checkbox" name="" value="" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'PersonSuggestion',
|
name: 'PersonSuggestion',
|
||||||
props: ['item'],
|
props: ['item'],
|
||||||
}
|
data() {
|
||||||
|
return {
|
||||||
|
url: {
|
||||||
|
show: '/fr/person/' + this.item.id + '/general',
|
||||||
|
edit: '/fr/person/' + this.item.id + '/general/edit'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -5,6 +5,12 @@ const personMessages = {
|
|||||||
title: "Ajouter des usagers",
|
title: "Ajouter des usagers",
|
||||||
counter: "Pas de résultats | 1 résultat | {count} résultats",
|
counter: "Pas de résultats | 1 résultat | {count} résultats",
|
||||||
search_some_persons: "Rechercher des personnes..",
|
search_some_persons: "Rechercher des personnes..",
|
||||||
|
},
|
||||||
|
item: {
|
||||||
|
type_person: "Usager",
|
||||||
|
type_tms: "TMS",
|
||||||
|
type_3rdparty: "Tiers",
|
||||||
|
type_menage: "Ménage"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user