From a607f59c29499600805b751a63dc5e6b2bc55da1 Mon Sep 17 00:00:00 2001
From: paidge <paidge_cs@hotmail.com>
Date: Fri, 24 Dec 2021 03:30:18 +0100
Subject: [PATCH] meilleur affichage du manque de certifications

---
 pages/hash/_hash.vue | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/pages/hash/_hash.vue b/pages/hash/_hash.vue
index 8021a8d..562e948 100644
--- a/pages/hash/_hash.vue
+++ b/pages/hash/_hash.vue
@@ -9,11 +9,8 @@
       </div>
       <div class="row mt-3" v-if="idFromHash.status != 'REVOKED' && idFromHash.status != 'NEWCOMER'">
         <div class="col-12 col-md-6 mb-3">
-          <h3>Certifications reçues
-            <span :class="{
-              'text-danger' : $options.filters.dateStatus(idFromHash.received_certifications.limit) == 'danger',
-              'text-warning' : $options.filters.dateStatus(idFromHash.received_certifications.limit) == 'warning'
-            }" v-if="($options.filters.dateStatus(idFromHash.received_certifications.limit) == 'warning')">âš 
+          <h3>Certifications reçues 
+            <span :class="classWarning" v-if="($options.filters.dateStatus(idFromHash.received_certifications.limit) == 'warning') || (!idFromHash.received_certifications.limit)">âš 
               <span class="sr-only" v-if="$options.filters.dateStatus(idFromHash.received_certifications.limit) == 'danger'">En manque de certifications</span>
               <span class="sr-only" v-else>Bientôt en manque de certifications</span>
             </span>
@@ -107,6 +104,14 @@ export default {
       },
     },
   },
+  computed: {
+    classWarning: function() {
+      return {
+        'text-danger' : !this.idFromHash.received_certifications.limit,
+        'text-warning' : this.$options.filters.dateStatus(this.idFromHash.received_certifications.limit) == 'warning'
+      }
+    }
+  },
   watch: {
     idFromHash: {
       handler(n,o) {
-- 
GitLab