From ebb3b55613c6fff28ec225e589370cb54ab1a31a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Poussard?= <tpoussard@neogeo.fr> Date: Tue, 7 Sep 2021 17:06:00 +0200 Subject: [PATCH] fix footer stick to bottom, remove pagination temporary --- src/App.vue | 30 +++++++++++++++---- src/views/feature/Feature_list.vue | 44 +++++++++++++++++++--------- src/views/project/Project_detail.vue | 1 - 3 files changed, 54 insertions(+), 21 deletions(-) diff --git a/src/App.vue b/src/App.vue index e70b202a..3525c510 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,5 +1,5 @@ <template> - <body> + <div v-frag> <header class="header-menu"> <div class="ui container"> <div class="ui inverted icon menu"> @@ -131,16 +131,21 @@ <p class="item">Version {{ PACKAGE_VERSION }}</p> </div> </footer> - </body> + </div> </template> <script> +import frag from "vue-frag"; import { mapState } from "vuex"; import { mapGetters } from "vuex"; export default { name: "App", + directives: { + frag, + }, + data() { return { menuIsOpen: false, @@ -184,15 +189,28 @@ export default { .header-menu { min-width: 560px; - height: 61px; } -main { - height: calc(100vh - 61px - 40px); +body { + height: 100vh; + margin: 0; +} + +header { + min-height: 61px; +} +footer { + min-height: 40px; +} + +/* Trick */ +body { + display: flex; + flex-direction: column; } footer { - height: 40px; + margin-top: auto; } .vertical { diff --git a/src/views/feature/Feature_list.vue b/src/views/feature/Feature_list.vue index e18f7271..c6c6658e 100644 --- a/src/views/feature/Feature_list.vue +++ b/src/views/feature/Feature_list.vue @@ -138,7 +138,7 @@ </thead> <tbody> <tr - v-for="(feature, index) in paginatedFeatures" + v-for="(feature, index) in filteredFeatures" :key="feature.feature_id + index" > <td class="dt-center" :data-order="feature.get_status_display"> @@ -201,7 +201,7 @@ </tr> </tbody> </table> - <div + <!-- <div class="dataTables_info" id="table-features_info" role="status" @@ -209,20 +209,21 @@ > Affichage de l'élément {{ pagination.start + 1 }} à {{ pagination.end + 1 }} sur {{ filteredFeatures.length }} éléments - </div> - <div + </div> --> + <!-- <div class="dataTables_paginate paging_simple_numbers" id="table-features_paginate" - > - <a + > --> + <!-- <a + @click="toPreviousPage" class="paginate_button previous disabled" aria-controls="table-features" data-dt-idx="0" tabindex="0" id="table-features_previous" >Précédent</a - ><span - ><a + ><span> --> + <!-- <a v-for="(page, index) in filteredFeatures.length" :key="'page' + index" class="paginate_button current" @@ -230,18 +231,19 @@ data-dt-idx="1" tabindex="0" >1</a - > - <span class="ellipsis">…</span> - <a + > --> + <!-- <span class="ellipsis">…</span> --> + <!-- <a class="paginate_button next" aria-controls="table-features" data-dt-idx="7" tabindex="0" id="table-features_next" + @click="toNextPage" >Suivant</a - > - </span> - </div> + > --> + <!-- </span> + </div> --> </div> </div> </template> @@ -332,6 +334,20 @@ export default { ); }, }, + methods: { + toPreviousPage() { + if (this.pagination.start > 0) { + this.pagination.start = this.pagination.start - 15; + this.pagination.end += 15; + } + }, + toNextPage() { + if (this.pagination.end < this.filteredFeatures.length) { + this.pagination.start += 15; + this.pagination.end = this.pagination.end - 15; + } + }, + }, created() { if (!this.project) { diff --git a/src/views/project/Project_detail.vue b/src/views/project/Project_detail.vue index 58a2b35a..66dd987f 100644 --- a/src/views/project/Project_detail.vue +++ b/src/views/project/Project_detail.vue @@ -449,7 +449,6 @@ </template> <script> -// import axios from 'axios'; import frag from "vue-frag"; import { mapGetters, mapState } from "vuex"; -- GitLab