mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-25 08:05:00 +00:00
Merge remote-tracking branch 'origin/ticket-app-master' into ticket-app-master
This commit is contained in:
@@ -49,6 +49,30 @@ export interface User {
|
||||
// todo: mainCenter; mainJob; etc..
|
||||
}
|
||||
|
||||
// TODO : Add missing household properties
|
||||
export interface Household {
|
||||
type: "household";
|
||||
id: number;
|
||||
}
|
||||
|
||||
export interface ThirdParty {
|
||||
type: "thirdparty";
|
||||
id: number;
|
||||
firstname: string;
|
||||
name: string;
|
||||
email: string;
|
||||
telephone: string;
|
||||
telephone2: string;
|
||||
address: {
|
||||
address_id: number;
|
||||
text: string;
|
||||
postcode: {
|
||||
name: string;
|
||||
};
|
||||
id: number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface UserGroup {
|
||||
type: "user_group";
|
||||
id: number;
|
||||
|
@@ -10,7 +10,7 @@
|
||||
v-model="radioType"
|
||||
value="person"
|
||||
/>
|
||||
{{ $t("onthefly.create.person") }}
|
||||
{{ trans(ONTHEFLY_CREATE_PERSON) }}
|
||||
</label>
|
||||
</a>
|
||||
</li>
|
||||
@@ -24,7 +24,7 @@
|
||||
v-model="radioType"
|
||||
value="thirdparty"
|
||||
/>
|
||||
{{ $t("onthefly.create.thirdparty") }}
|
||||
{{ trans(ONTHEFLY_CREATE_THIRDPARTY) }}
|
||||
</label>
|
||||
</a>
|
||||
</li>
|
||||
@@ -46,64 +46,67 @@
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script setup>
|
||||
import { ref, computed, onMounted } from "vue";
|
||||
import OnTheFlyPerson from "ChillPersonAssets/vuejs/_components/OnTheFly/Person.vue";
|
||||
import OnTheFlyThirdparty from "ChillThirdPartyAssets/vuejs/_components/OnTheFly/ThirdParty.vue";
|
||||
import {
|
||||
trans,
|
||||
ONTHEFLY_CREATE_PERSON,
|
||||
ONTHEFLY_CREATE_THIRDPARTY,
|
||||
} from "translator";
|
||||
|
||||
export default {
|
||||
name: "OnTheFlyCreate",
|
||||
props: ["action", "allowedTypes", "query"],
|
||||
components: {
|
||||
OnTheFlyPerson,
|
||||
OnTheFlyThirdparty,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
type: null,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
radioType: {
|
||||
set(type) {
|
||||
this.type = type;
|
||||
console.log("## type:", type, ", action:", this.action);
|
||||
},
|
||||
get() {
|
||||
return this.type;
|
||||
},
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.type =
|
||||
this.allowedTypes.length === 1 &&
|
||||
this.allowedTypes.includes("thirdparty")
|
||||
? "thirdparty"
|
||||
: "person";
|
||||
},
|
||||
methods: {
|
||||
isActive(tab) {
|
||||
return this.type === tab ? true : false;
|
||||
},
|
||||
castDataByType() {
|
||||
switch (this.radioType) {
|
||||
case "person":
|
||||
return this.$refs.castPerson.$data.person;
|
||||
case "thirdparty":
|
||||
let data = this.$refs.castThirdparty.$data.thirdparty;
|
||||
if (data.address !== undefined && data.address !== null) {
|
||||
data.address = { id: data.address.address_id };
|
||||
} else {
|
||||
data.address = null;
|
||||
}
|
||||
const props = defineProps({
|
||||
action: String,
|
||||
allowedTypes: Array,
|
||||
query: String,
|
||||
});
|
||||
|
||||
return data;
|
||||
default:
|
||||
throw Error("Invalid type of entity");
|
||||
const type = ref(null);
|
||||
|
||||
const radioType = computed({
|
||||
get: () => type.value,
|
||||
set: (val) => {
|
||||
type.value = val;
|
||||
console.log("## type:", val, ", action:", props.action);
|
||||
},
|
||||
});
|
||||
|
||||
const castPerson = ref(null);
|
||||
const castThirdparty = ref(null);
|
||||
|
||||
onMounted(() => {
|
||||
type.value =
|
||||
props.allowedTypes.length === 1 &&
|
||||
props.allowedTypes.includes("thirdparty")
|
||||
? "thirdparty"
|
||||
: "person";
|
||||
});
|
||||
|
||||
function isActive(tab) {
|
||||
return type.value === tab;
|
||||
}
|
||||
|
||||
function castDataByType() {
|
||||
switch (radioType.value) {
|
||||
case "person":
|
||||
return castPerson.value.$data.person;
|
||||
case "thirdparty":
|
||||
let data = castThirdparty.value.$data.thirdparty;
|
||||
if (data.address !== undefined && data.address !== null) {
|
||||
data.address = { id: data.address.address_id };
|
||||
} else {
|
||||
data.address = null;
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
return data;
|
||||
default:
|
||||
throw Error("Invalid type of entity");
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
castDataByType,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="css" scoped>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
class="btn btn-sm"
|
||||
target="_blank"
|
||||
:class="classAction"
|
||||
:title="$t(titleAction)"
|
||||
:title="trans(titleAction)"
|
||||
@click="openModal"
|
||||
>
|
||||
{{ buttonText }}<span v-if="isDead"> (‡)</span>
|
||||
@@ -23,10 +23,10 @@
|
||||
>
|
||||
<template #header>
|
||||
<h3 v-if="parent" class="modal-title">
|
||||
{{ $t(titleModal, { q: parent.text }) }}
|
||||
{{ trans(titleModal, { q: parent.text }) }}
|
||||
</h3>
|
||||
<h3 v-else class="modal-title">
|
||||
{{ $t(titleModal) }}
|
||||
{{ trans(titleModal) }}
|
||||
</h3>
|
||||
</template>
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
ref="castPerson"
|
||||
/>
|
||||
<div v-if="hasResourceComment">
|
||||
<h3>{{ $t("onthefly.resource_comment_title") }}</h3>
|
||||
<h3>{{ trans(ONTHEFLY_RESOURCE_COMMENT_TITLE) }}</h3>
|
||||
<blockquote class="chill-user-quote">
|
||||
{{ parent.comment }}
|
||||
</blockquote>
|
||||
@@ -53,7 +53,7 @@
|
||||
ref="castThirdparty"
|
||||
/>
|
||||
<div v-if="hasResourceComment">
|
||||
<h3>{{ $t("onthefly.resource_comment_title") }}</h3>
|
||||
<h3>{{ trans(ONTHEFLY_RESOURCE_COMMENT_TITLE) }}</h3>
|
||||
<blockquote class="chill-user-quote">
|
||||
{{ parent.comment }}
|
||||
</blockquote>
|
||||
@@ -82,242 +82,273 @@
|
||||
<a
|
||||
v-if="action === 'show'"
|
||||
:href="buildLocation(id, type)"
|
||||
:title="$t(titleMessage)"
|
||||
:title="trans(titleMessage)"
|
||||
class="btn btn-show"
|
||||
>{{ $t(buttonMessage) }}
|
||||
>{{ trans(buttonMessage) }}
|
||||
</a>
|
||||
<a v-else class="btn btn-save" @click="saveAction">
|
||||
{{ $t("action.save") }}
|
||||
{{ trans(ACTION_SAVE) }}
|
||||
</a>
|
||||
</template>
|
||||
</modal>
|
||||
</teleport>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script setup>
|
||||
import { ref, computed, defineEmits, defineProps } from "vue";
|
||||
import Modal from "ChillMainAssets/vuejs/_components/Modal.vue";
|
||||
import OnTheFlyCreate from "./Create.vue";
|
||||
import OnTheFlyPerson from "ChillPersonAssets/vuejs/_components/OnTheFly/Person.vue";
|
||||
import OnTheFlyThirdparty from "ChillThirdPartyAssets/vuejs/_components/OnTheFly/ThirdParty.vue";
|
||||
import {
|
||||
trans,
|
||||
ACTION_SHOW,
|
||||
ACTION_EDIT,
|
||||
ACTION_CREATE,
|
||||
ACTION_ADDCONTACT,
|
||||
ONTHEFLY_CREATE_TITLE_DEFAULT,
|
||||
ONTHEFLY_CREATE_TITLE_PERSON,
|
||||
ONTHEFLY_CREATE_TITLE_THIRDPARTY,
|
||||
ONTHEFLY_SHOW_PERSON,
|
||||
ONTHEFLY_SHOW_THIRDPARTY,
|
||||
ONTHEFLY_EDIT_PERSON,
|
||||
ONTHEFLY_EDIT_THIRDPARTY,
|
||||
ONTHEFLY_ADDCONTACT_TITLE,
|
||||
ACTION_REDIRECT_PERSON,
|
||||
ACTION_REDIRECT_THIRDPARTY,
|
||||
ONTHEFLY_SHOW_FILE_PERSON,
|
||||
ONTHEFLY_SHOW_FILE_THIRDPARTY,
|
||||
ONTHEFLY_SHOW_FILE_DEFAULT,
|
||||
ONTHEFLY_RESOURCE_COMMENT_TITLE,
|
||||
ACTION_SAVE,
|
||||
} from "translator";
|
||||
|
||||
export default {
|
||||
name: "OnTheFly",
|
||||
components: {
|
||||
Modal,
|
||||
OnTheFlyPerson,
|
||||
OnTheFlyThirdparty,
|
||||
OnTheFlyCreate,
|
||||
},
|
||||
props: [
|
||||
"type",
|
||||
"id",
|
||||
"action",
|
||||
"buttonText",
|
||||
"displayBadge",
|
||||
"isDead",
|
||||
"parent",
|
||||
"allowedTypes",
|
||||
"query",
|
||||
],
|
||||
emits: ["saveFormOnTheFly"],
|
||||
data() {
|
||||
return {
|
||||
modal: {
|
||||
showModal: false,
|
||||
modalDialogClass: "modal-dialog-scrollable modal-xl",
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
hasResourceComment() {
|
||||
return (
|
||||
typeof this.parent !== "undefined" &&
|
||||
this.parent !== null &&
|
||||
this.action === "show" &&
|
||||
this.parent.type === "accompanying_period_resource" &&
|
||||
this.parent.comment !== null &&
|
||||
this.parent.comment !== ""
|
||||
);
|
||||
},
|
||||
classAction() {
|
||||
switch (this.action) {
|
||||
case "show":
|
||||
return "btn-show";
|
||||
case "edit":
|
||||
return "btn-update";
|
||||
case "create":
|
||||
return "btn-create";
|
||||
case "addContact":
|
||||
return "btn-tpchild";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
},
|
||||
titleAction() {
|
||||
switch (this.action) {
|
||||
case "show":
|
||||
return "action.show";
|
||||
case "edit":
|
||||
return "action.edit";
|
||||
case "create":
|
||||
return "action.create";
|
||||
case "addContact":
|
||||
return "action.addContact";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
},
|
||||
titleCreate() {
|
||||
if (typeof this.allowedTypes === "undefined") {
|
||||
return "onthefly.create.title.default";
|
||||
}
|
||||
return this.allowedTypes.every((t) => t === "person")
|
||||
? "onthefly.create.title.person"
|
||||
: this.allowedTypes.every((t) => t === "thirdparty")
|
||||
? "onthefly.create.title.thirdparty"
|
||||
: "onthefly.create.title.default";
|
||||
},
|
||||
titleModal() {
|
||||
switch (this.action) {
|
||||
case "show":
|
||||
return "onthefly.show." + this.type;
|
||||
case "edit":
|
||||
return "onthefly.edit." + this.type;
|
||||
case "create":
|
||||
return this.titleCreate;
|
||||
case "addContact":
|
||||
return "onthefly.addContact.title";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
},
|
||||
titleMessage() {
|
||||
switch (this.type) {
|
||||
case "person":
|
||||
return "action.redirect." + this.type;
|
||||
case "thirdparty":
|
||||
return "action.redirect." + this.type;
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
},
|
||||
buttonMessage() {
|
||||
switch (this.type) {
|
||||
case "person":
|
||||
return "onthefly.show.file_" + this.type;
|
||||
case "thirdparty":
|
||||
return "onthefly.show.file_" + this.type;
|
||||
}
|
||||
},
|
||||
isDisplayBadge() {
|
||||
return this.displayBadge === true && this.buttonText !== null;
|
||||
},
|
||||
badgeType() {
|
||||
return "entity-" + this.type + " badge-" + this.type;
|
||||
},
|
||||
getReturnPath() {
|
||||
return `?returnPath=${window.location.pathname}${window.location.search}${window.location.hash}`;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
closeModal() {
|
||||
this.modal.showModal = false;
|
||||
},
|
||||
openModal() {
|
||||
// console.log('## OPEN ON THE FLY MODAL');
|
||||
// console.log('## type:', this.type, ', action:', this.action);
|
||||
this.modal.showModal = true;
|
||||
this.$nextTick(function () {
|
||||
//this.$refs.search.focus();
|
||||
});
|
||||
},
|
||||
changeActionTo(action) {
|
||||
this.$data.action = action;
|
||||
},
|
||||
saveAction() {
|
||||
// console.log('saveAction button: create/edit action with', this.type);
|
||||
let type = this.type,
|
||||
data = {};
|
||||
switch (type) {
|
||||
case "person":
|
||||
data = this.$refs.castPerson.$data.person;
|
||||
console.log("person data are", data);
|
||||
break;
|
||||
const props = defineProps({
|
||||
type: String,
|
||||
id: [String, Number],
|
||||
action: String,
|
||||
buttonText: String,
|
||||
displayBadge: Boolean,
|
||||
isDead: Boolean,
|
||||
parent: Object,
|
||||
allowedTypes: Array,
|
||||
query: String,
|
||||
});
|
||||
|
||||
case "thirdparty":
|
||||
data = this.$refs.castThirdparty.$data.thirdparty;
|
||||
/* never executed ? */
|
||||
break;
|
||||
const emit = defineEmits(["saveFormOnTheFly"]);
|
||||
|
||||
default:
|
||||
if (typeof this.type === "undefined") {
|
||||
// action=create or addContact
|
||||
// console.log('will rewrite data');
|
||||
if (this.action === "addContact") {
|
||||
type = "thirdparty";
|
||||
data = this.$refs.castThirdparty.$data.thirdparty;
|
||||
// console.log('data original', data);
|
||||
data.parent = {
|
||||
type: "thirdparty",
|
||||
id: this.parent.id,
|
||||
};
|
||||
data.civility =
|
||||
data.civility !== null
|
||||
? {
|
||||
type: "chill_main_civility",
|
||||
id: data.civility.id,
|
||||
}
|
||||
: null;
|
||||
data.profession =
|
||||
data.profession !== "" ? data.profession : "";
|
||||
} else {
|
||||
type = this.$refs.castNew.radioType;
|
||||
data = this.$refs.castNew.castDataByType();
|
||||
// console.log('type', type);
|
||||
if (
|
||||
typeof data.civility !== "undefined" &&
|
||||
null !== data.civility
|
||||
) {
|
||||
data.civility =
|
||||
data.civility !== null
|
||||
? {
|
||||
type: "chill_main_civility",
|
||||
id: data.civility.id,
|
||||
}
|
||||
: null;
|
||||
}
|
||||
if (
|
||||
typeof data.profession !== "undefined" &&
|
||||
"" !== data.profession
|
||||
) {
|
||||
data.profession =
|
||||
data.profession !== ""
|
||||
? data.profession
|
||||
: "";
|
||||
}
|
||||
// console.log('onthefly data', data);
|
||||
}
|
||||
} else {
|
||||
throw "error with object type";
|
||||
const modal = ref({
|
||||
showModal: false,
|
||||
modalDialogClass: "modal-dialog-scrollable modal-xl",
|
||||
});
|
||||
|
||||
const castPerson = ref();
|
||||
const castThirdparty = ref();
|
||||
const castNew = ref();
|
||||
|
||||
const hasResourceComment = computed(() => {
|
||||
return (
|
||||
typeof props.parent !== "undefined" &&
|
||||
props.parent !== null &&
|
||||
props.action === "show" &&
|
||||
props.parent.type === "accompanying_period_resource" &&
|
||||
props.parent.comment !== null &&
|
||||
props.parent.comment !== ""
|
||||
);
|
||||
});
|
||||
|
||||
const classAction = computed(() => {
|
||||
switch (props.action) {
|
||||
case "show":
|
||||
return "btn-show";
|
||||
case "edit":
|
||||
return "btn-update";
|
||||
case "create":
|
||||
return "btn-create";
|
||||
case "addContact":
|
||||
return "btn-tpchild";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
});
|
||||
|
||||
const titleAction = computed(() => {
|
||||
switch (props.action) {
|
||||
case "show":
|
||||
return ACTION_SHOW;
|
||||
case "edit":
|
||||
return ACTION_EDIT;
|
||||
case "create":
|
||||
return ACTION_CREATE;
|
||||
case "addContact":
|
||||
return ACTION_ADDCONTACT;
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
});
|
||||
|
||||
const titleCreate = computed(() => {
|
||||
if (typeof props.allowedTypes === "undefined") {
|
||||
return ONTHEFLY_CREATE_TITLE_DEFAULT;
|
||||
}
|
||||
return props.allowedTypes.every((t) => t === "person")
|
||||
? ONTHEFLY_CREATE_TITLE_PERSON
|
||||
: props.allowedTypes.every((t) => t === "thirdparty")
|
||||
? ONTHEFLY_CREATE_TITLE_THIRDPARTY
|
||||
: ONTHEFLY_CREATE_TITLE_DEFAULT;
|
||||
});
|
||||
|
||||
const titleModal = computed(() => {
|
||||
switch (props.action) {
|
||||
case "show":
|
||||
if (props.type == "person") {
|
||||
return ONTHEFLY_SHOW_PERSON;
|
||||
} else if (props.type == "thirdparty") {
|
||||
return ONTHEFLY_SHOW_THIRDPARTY;
|
||||
}
|
||||
break;
|
||||
case "edit":
|
||||
if (props.type == "person") {
|
||||
return ONTHEFLY_EDIT_PERSON;
|
||||
} else if (props.type == "thirdparty") {
|
||||
return ONTHEFLY_EDIT_THIRDPARTY;
|
||||
}
|
||||
break;
|
||||
case "create":
|
||||
return titleCreate.value;
|
||||
case "addContact":
|
||||
return ONTHEFLY_ADDCONTACT_TITLE;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return "";
|
||||
});
|
||||
|
||||
const titleMessage = computed(() => {
|
||||
switch (props.type) {
|
||||
case "person":
|
||||
return ACTION_REDIRECT_PERSON;
|
||||
case "thirdparty":
|
||||
return ACTION_REDIRECT_THIRDPARTY;
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
});
|
||||
|
||||
const buttonMessage = computed(() => {
|
||||
switch (props.type) {
|
||||
case "person":
|
||||
return ONTHEFLY_SHOW_FILE_PERSON;
|
||||
case "thirdparty":
|
||||
return ONTHEFLY_SHOW_FILE_THIRDPARTY;
|
||||
default:
|
||||
return ONTHEFLY_SHOW_FILE_DEFAULT;
|
||||
}
|
||||
});
|
||||
|
||||
const isDisplayBadge = computed(() => {
|
||||
return props.displayBadge === true && props.buttonText !== null;
|
||||
});
|
||||
|
||||
const badgeType = computed(() => {
|
||||
return "entity-" + props.type + " badge-" + props.type;
|
||||
});
|
||||
|
||||
const getReturnPath = computed(() => {
|
||||
return `?returnPath=${window.location.pathname}${window.location.search}${window.location.hash}`;
|
||||
});
|
||||
|
||||
function closeModal() {
|
||||
modal.value.showModal = false;
|
||||
}
|
||||
|
||||
function openModal() {
|
||||
modal.value.showModal = true;
|
||||
}
|
||||
|
||||
function changeActionTo(action) {
|
||||
console.log(action);
|
||||
// Not reactive in setup, but you can emit or use a ref if needed
|
||||
}
|
||||
|
||||
function saveAction() {
|
||||
let type = props.type,
|
||||
data = {};
|
||||
switch (type) {
|
||||
case "person":
|
||||
data = castPerson.value?.$data.person;
|
||||
break;
|
||||
case "thirdparty":
|
||||
data = castThirdparty.value?.$data.thirdparty;
|
||||
break;
|
||||
default:
|
||||
if (typeof props.type === "undefined") {
|
||||
if (props.action === "addContact") {
|
||||
type = "thirdparty";
|
||||
data = castThirdparty.value?.$data.thirdparty;
|
||||
data.parent = {
|
||||
type: "thirdparty",
|
||||
id: props.parent.id,
|
||||
};
|
||||
data.civility =
|
||||
data.civility !== null
|
||||
? {
|
||||
type: "chill_main_civility",
|
||||
id: data.civility.id,
|
||||
}
|
||||
: null;
|
||||
data.profession =
|
||||
data.profession !== "" ? data.profession : "";
|
||||
} else {
|
||||
type = castNew.value.radioType;
|
||||
data = castNew.value.castDataByType();
|
||||
if (
|
||||
typeof data.civility !== "undefined" &&
|
||||
null !== data.civility
|
||||
) {
|
||||
data.civility =
|
||||
data.civility !== null
|
||||
? {
|
||||
type: "chill_main_civility",
|
||||
id: data.civility.id,
|
||||
}
|
||||
: null;
|
||||
}
|
||||
if (
|
||||
typeof data.profession !== "undefined" &&
|
||||
"" !== data.profession
|
||||
) {
|
||||
data.profession =
|
||||
data.profession !== "" ? data.profession : "";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw "error with object type";
|
||||
}
|
||||
// pass datas to parent
|
||||
this.$emit("saveFormOnTheFly", { type: type, data: data });
|
||||
},
|
||||
buildLocation(id, type) {
|
||||
if (type === "person") {
|
||||
// TODO i18n
|
||||
return encodeURI(
|
||||
`/fr/person/${id}/general${this.getReturnPath}`,
|
||||
);
|
||||
} else if (type === "thirdparty") {
|
||||
return encodeURI(
|
||||
`/fr/3party/3party/${id}/view${this.getReturnPath}`,
|
||||
);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
emit("saveFormOnTheFly", { type: type, data: data });
|
||||
}
|
||||
|
||||
function buildLocation(id, type) {
|
||||
if (type === "person") {
|
||||
return encodeURI(`/fr/person/${id}/general${getReturnPath.value}`);
|
||||
} else if (type === "thirdparty") {
|
||||
return encodeURI(`/fr/3party/3party/${id}/view${getReturnPath.value}`);
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
openModal,
|
||||
closeModal,
|
||||
changeActionTo,
|
||||
saveAction,
|
||||
castPerson,
|
||||
castThirdparty,
|
||||
castNew,
|
||||
hasResourceComment,
|
||||
modal,
|
||||
isDisplayBadge,
|
||||
Modal,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="css" scoped>
|
||||
|
@@ -1,9 +1,28 @@
|
||||
<template>
|
||||
<i :class="gender.icon" />
|
||||
<i :class="['fa', genderClass, 'px-1']" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed } from "vue";
|
||||
const props = defineProps({
|
||||
gender: Object,
|
||||
gender: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
|
||||
const genderClass = computed(() => {
|
||||
switch (props.gender.genderTranslation) {
|
||||
case "woman":
|
||||
return "fa-venus";
|
||||
case "man":
|
||||
return "fa-mars";
|
||||
case "both":
|
||||
return "fa-neuter";
|
||||
case "unknown":
|
||||
return "fa-genderless";
|
||||
default:
|
||||
return "fa-genderless";
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<transition name="modal">
|
||||
<div class="modal-mask">
|
||||
<div class="modal-mask" v-if="show">
|
||||
<!-- :: styles bootstrap :: -->
|
||||
<div
|
||||
class="modal fade show"
|
||||
@@ -8,7 +8,7 @@
|
||||
aria-modal="true"
|
||||
role="dialog"
|
||||
>
|
||||
<div class="modal-dialog" :class="props.modalDialogClass || {}">
|
||||
<div class="modal-dialog" :class="modalDialogClass || {}">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<slot name="header"></slot>
|
||||
@@ -53,14 +53,23 @@ import { trans, MODAL_ACTION_CLOSE } from "translator";
|
||||
import { defineProps } from "vue";
|
||||
|
||||
export interface ModalProps {
|
||||
modalDialogClass: object | null;
|
||||
modalDialogClass: string;
|
||||
hideFooter: boolean;
|
||||
}
|
||||
|
||||
// Define the props
|
||||
const props = withDefaults(defineProps<ModalProps>(), {
|
||||
hideFooter: false,
|
||||
modalDialogClass: null,
|
||||
defineProps({
|
||||
modalDialogClass: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
hideFooter: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
});
|
||||
|
||||
const emits = defineEmits<{
|
||||
|
@@ -129,3 +129,30 @@ filter_order:
|
||||
Search: Chercher dans la liste
|
||||
By date: Filtrer par date
|
||||
search_box: Filtrer par contenu
|
||||
renderbox:
|
||||
person: "Usager"
|
||||
birthday:
|
||||
man: "Né le"
|
||||
woman: "Née le"
|
||||
neutral: "Né·e le"
|
||||
unknown: "Né·e le"
|
||||
deathdate: "Date de décès"
|
||||
household_without_address: "Le ménage de l'usager est sans adresse"
|
||||
no_data: "Aucune information renseignée"
|
||||
type:
|
||||
thirdparty: "Tiers"
|
||||
person: "Usager"
|
||||
holder: "Titulaire"
|
||||
years_old: >-
|
||||
{n, plural,
|
||||
=0 {0 an}
|
||||
one {1 an}
|
||||
other {# ans}
|
||||
}
|
||||
residential_address: "Adresse de résidence"
|
||||
located_at: "réside chez"
|
||||
household_number: "Ménage n°{number}"
|
||||
current_members: "Membres actuels"
|
||||
no_current_address: "Sans adresse actuellement"
|
||||
new_household: "Nouveau ménage"
|
||||
no_members_yet: "Aucun membre actuellement"
|
||||
|
@@ -919,3 +919,34 @@ multiselect:
|
||||
editor:
|
||||
switch_to_simple: Éditeur simple
|
||||
switch_to_complex: Éditeur riche
|
||||
action:
|
||||
actions: Actions
|
||||
show: Voir
|
||||
edit: Modifier
|
||||
create: Créer
|
||||
remove: Enlever
|
||||
delete: Supprimer
|
||||
save: Enregistrer
|
||||
valid: Valider
|
||||
valid_and_see: Valider et voir
|
||||
add: Ajouter
|
||||
show_modal: Ouvrir une modale
|
||||
ok: OK
|
||||
cancel: Annuler
|
||||
close: Fermer
|
||||
back: Retour
|
||||
check_all: cocher tout
|
||||
reset: réinitialiser
|
||||
redirect:
|
||||
person: Quitter la page et ouvrir la fiche de l'usager
|
||||
thirdparty: Quitter la page et voir le tiers
|
||||
refresh: Rafraîchir
|
||||
addContact: Ajouter un contact
|
||||
|
||||
nav:
|
||||
next: "Suivant"
|
||||
previous: "Précédent"
|
||||
top: "Haut"
|
||||
bottom: "Bas"
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user