diff --git a/components/certif/List.vue b/components/certif/List.vue index 52f89b646b7859cb132111586db496a6af1ddcc6..e8d5206d2e4407a5c38707134f001c4ceb1debc1 100644 --- a/components/certif/List.vue +++ b/components/certif/List.vue @@ -1,8 +1,11 @@ <template> - <div class="table-responsive"> - <table - class="table table-striped table-hover" - v-if="certifsTriees.length > 0"> + <div class="table-responsive" v-if="certifs.length > 0"> + <input + type="text" + v-model="search" + class="form-control w-75 mx-auto mb-2" + :placeholder="$t('recherche.title')" /> + <table class="table table-striped table-hover"> <thead class="thead-light sortable"> <th class="position-relative" @click="sort('uid')"> <BtnSort @@ -68,7 +71,8 @@ <BtnPagination :currentPage.sync="currentPage" :pageSize="pageSize" - :arrayLength="certifs.length" /> + :arrayLength="certifsFiltrees.length" + v-if="certifsFiltrees.length > pageSize" /> </div> </template> @@ -76,6 +80,7 @@ export default { data() { return { + search: "", currentSort: "expires_on", currentSortDir: "asc", currentPage: 1, @@ -94,8 +99,16 @@ export default { } }, computed: { + certifsFiltrees() { + return this.certifs.filter((row, index) => { + return ( + this.search == "" || + row.uid.toLowerCase().includes(this.search.toLowerCase()) + ) + }) + }, certifsTriees() { - return this.certifs + return this.certifsFiltrees .sort((a, b) => { let modifier = this.currentSortDir === "desc" ? -1 : 1 diff --git a/components/navigation/menu/Sidebar.vue b/components/navigation/menu/Sidebar.vue index 26f8368a3db8b855313ab2558da8191d1e67a828..b7b9406342debcf703a5914768aadf77828f8eee 100644 --- a/components/navigation/menu/Sidebar.vue +++ b/components/navigation/menu/Sidebar.vue @@ -5,7 +5,7 @@ <img :src="$icon(512)" alt="Accueil" class="logo" /> <div> <h1 class="h3"> - Wotwizard <small><span class="small">v0.14</span></small> + Wotwizard <small><span class="small">v0.15</span></small> </h1> <small class="text-muted">{{ $t("slogan") }}</small> </div> diff --git a/pages/lexique.vue b/pages/lexique.vue index c4e16296eadbbe4e10148cb471d803c2abcf5893..a40cfc2175745802f422c420a71ba788dd1e3c90 100644 --- a/pages/lexique.vue +++ b/pages/lexique.vue @@ -8,7 +8,6 @@ v-model="search" type="text" class="form-control" - id="exampleFormControlInput1" :placeholder="$t('recherche.title')" /> </div> </div>