diff --git a/assets/css/_bootstrap.scss b/assets/css/_bootstrap.scss index 814bf81b38172f5319e714fdab2e2902eae44561..46f8b766818acec840e3d82fa21fdad6ec0f58c6 100644 --- a/assets/css/_bootstrap.scss +++ b/assets/css/_bootstrap.scss @@ -36,7 +36,7 @@ @import "~bootstrap/scss/buttons"; @import "~bootstrap/scss/transitions"; // @import "~bootstrap/scss/dropdown"; -// @import "~bootstrap/scss/button-group"; +@import "~bootstrap/scss/button-group"; @import "~bootstrap/scss/nav"; @import "~bootstrap/scss/navbar"; @import "~bootstrap/scss/card"; diff --git a/components/member/Filter.vue b/components/member/Filter.vue new file mode 100644 index 0000000000000000000000000000000000000000..94e5f40161be0390bdc1078c2643dd42f5b54b47 --- /dev/null +++ b/components/member/Filter.vue @@ -0,0 +1,74 @@ +<template> + <div class="text-muted"> + <p id="filterStatutTitle">{{ $t("filter.statut") }} :</p> + <ul class="p-0" aria-labelledby="filterStatutTitle" role="group"> + <li class="form-check form-check-inline"> + <input + class="form-check-input" + v-model="checkedStatus" + type="checkbox" + id="check-newcomer" + value="NEWCOMER" /> + <label class="form-check-label" for="check-newcomer">{{ + $t("statut.newcomer") + }}</label> + </li> + <li class="form-check form-check-inline"> + <input + class="form-check-input" + v-model="checkedStatus" + type="checkbox" + id="check-member" + value="MEMBER" /> + <label class="form-check-label" for="check-member">{{ + $t("statut.member") + }}</label> + </li> + <li class="form-check form-check-inline"> + <input + class="form-check-input" + v-model="checkedStatus" + type="checkbox" + id="check-missing" + value="MISSING" /> + <label class="form-check-label" for="check-missing">{{ + $t("statut.missing") + }}</label> + </li> + <li class="form-check form-check-inline"> + <input + class="form-check-input" + v-model="checkedStatus" + type="checkbox" + id="check-revoked" + value="REVOKED" /> + <label class="form-check-label" for="check-revoked">{{ + $t("statut.revoked") + }}</label> + </li> + </ul> + </div> +</template> + +<script> +export default { + data() { + return { + checkedStatus: this.selectedStatus + } + }, + props: { + selectedStatus: { + type: Array, + required: true + } + }, + watch: { + checkedStatus: { + handler(n, o) { + this.$emit("update:selectedStatus", n) + } + } + } +} +</script> diff --git a/i18n/locales/de.json b/i18n/locales/de.json index 1aec3d93c717220b35b1293ffe6f7316a6ef0d59..c4e5b3040777e2fbd6ae79050f7e5672ed17e48f 100644 --- a/i18n/locales/de.json +++ b/i18n/locales/de.json @@ -117,6 +117,9 @@ "title": "Meine Favoriten", "use": "Nur meine Favoriten" }, + "filter": { + "statut": "Nach Status filtern" + }, "infos": "Informationen", "inout": "Bei- und Austritte des Vertrauensnetz in den 2 letzten Tagen", "inpreparation": "In Vorbereitung", diff --git a/i18n/locales/en.json b/i18n/locales/en.json index 519cac0cd262f4be3e5a3e3ce549b8f8de93b1e7..94005d3b51d85b4aff5123458007dcf050f88dbc 100644 --- a/i18n/locales/en.json +++ b/i18n/locales/en.json @@ -118,6 +118,9 @@ "title": "My favourites", "use": "My favorites only" }, + "filter": { + "statut": "Filter by status" + }, "infos": "Informations", "inout": "Entries and exits of the web of trust for the last 2 days", "inpreparation": "In preparation", diff --git a/i18n/locales/es.json b/i18n/locales/es.json index a2a705c4cebeecb1070e23dfc42ead0974695d7e..9eb7d503687dc7fb3d89b57c79e908d8844c79b2 100644 --- a/i18n/locales/es.json +++ b/i18n/locales/es.json @@ -118,6 +118,9 @@ "title": "Mis favoritos", "use": "Solo mis favoritos" }, + "filter": { + "statut": "Filtrar por estado" + }, "infos": "Informaciones", "inout": "Entradas y salidas de la red de confianza en los últimos 2 dÃas", "inpreparation": "En preparación", diff --git a/i18n/locales/fr.json b/i18n/locales/fr.json index 6d21732878058edcc042f8f18ccd084a0c0a65e2..142b23f6f7bd83a18accf51eaf92f267744d90f3 100644 --- a/i18n/locales/fr.json +++ b/i18n/locales/fr.json @@ -118,6 +118,9 @@ "title": "Mes favoris", "use": "Mes favoris uniquement" }, + "filter": { + "statut": "Filtrer par statut" + }, "infos": "Informations", "inout": "Entrées et sorties de la toile de confiance des 2 derniers jours", "inpreparation": "En préparation", diff --git a/pages/favoris.vue b/pages/favoris.vue index eecb2b357b7de10a8ca873af46d512a12cf0f950..24c68bb4849256efadc48e6a886888fe178b2a41 100644 --- a/pages/favoris.vue +++ b/pages/favoris.vue @@ -22,6 +22,7 @@ v-model="search" :help="$t('recherche.desc.favourites')" class="col-sm-7 col-md-6 col-lg-5 col-xl-4 mx-auto mb-4" /> + <MemberFilter :selectedStatus.sync="filterStatus" /> <MemberList defaultSort="date_membership" :members="filteredFavoris" @@ -59,13 +60,16 @@ export default { } ], search: "", - error: null + error: null, + filterStatus: ["NEWCOMER", "MEMBER", "MISSING", "REVOKED"] } }, computed: { filteredFavoris() { - return this.favoris.filter((el) => - el.uid.toLowerCase().includes(this.search.toLowerCase()) + return this.favoris.filter( + (el) => + el.uid.toLowerCase().includes(this.search.toLowerCase()) && + this.filterStatus.includes(el.status) ) } },