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>
<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
......
......@@ -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>
......
......@@ -8,7 +8,6 @@
v-model="search"
type="text"
class="form-control"
id="exampleFormControlInput1"
:placeholder="$t('recherche.title')" />
</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