Skip to content
Snippets Groups Projects
Commit 48689a10 authored by Pierre-Jean CHANCELLIER's avatar Pierre-Jean CHANCELLIER
Browse files

add input search in CertifList

parent 9bc2bf9e
No related branches found
No related tags found
No related merge requests found
<template> <template>
<div class="table-responsive"> <div class="table-responsive" v-if="certifs.length > 0">
<table <input
class="table table-striped table-hover" type="text"
v-if="certifsTriees.length > 0"> 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"> <thead class="thead-light sortable">
<th class="position-relative" @click="sort('uid')"> <th class="position-relative" @click="sort('uid')">
<BtnSort <BtnSort
...@@ -68,7 +71,8 @@ ...@@ -68,7 +71,8 @@
<BtnPagination <BtnPagination
:currentPage.sync="currentPage" :currentPage.sync="currentPage"
:pageSize="pageSize" :pageSize="pageSize"
:arrayLength="certifs.length" /> :arrayLength="certifsFiltrees.length"
v-if="certifsFiltrees.length > pageSize" />
</div> </div>
</template> </template>
...@@ -76,6 +80,7 @@ ...@@ -76,6 +80,7 @@
export default { export default {
data() { data() {
return { return {
search: "",
currentSort: "expires_on", currentSort: "expires_on",
currentSortDir: "asc", currentSortDir: "asc",
currentPage: 1, currentPage: 1,
...@@ -94,8 +99,16 @@ export default { ...@@ -94,8 +99,16 @@ export default {
} }
}, },
computed: { computed: {
certifsFiltrees() {
return this.certifs.filter((row, index) => {
return (
this.search == "" ||
row.uid.toLowerCase().includes(this.search.toLowerCase())
)
})
},
certifsTriees() { certifsTriees() {
return this.certifs return this.certifsFiltrees
.sort((a, b) => { .sort((a, b) => {
let modifier = this.currentSortDir === "desc" ? -1 : 1 let modifier = this.currentSortDir === "desc" ? -1 : 1
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<img :src="$icon(512)" alt="Accueil" class="logo" /> <img :src="$icon(512)" alt="Accueil" class="logo" />
<div> <div>
<h1 class="h3"> <h1 class="h3">
Wotwizard <small><span class="small">v0.14</span></small> Wotwizard <small><span class="small">v0.15</span></small>
</h1> </h1>
<small class="text-muted">{{ $t("slogan") }}</small> <small class="text-muted">{{ $t("slogan") }}</small>
</div> </div>
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
v-model="search" v-model="search"
type="text" type="text"
class="form-control" class="form-control"
id="exampleFormControlInput1"
:placeholder="$t('recherche.title')" /> :placeholder="$t('recherche.title')" />
</div> </div>
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment