changeset 3005:870d2a0e866b

import_overview: improved style calculus
author Thomas Junk <thomas.junk@intevation.de>
date Thu, 11 Apr 2019 10:11:59 +0200
parents 0d74727725d3
children 44493664d40e
files client/src/components/importoverview/LogEntry.vue
diffstat 1 files changed, 12 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/importoverview/LogEntry.vue	Thu Apr 11 10:00:03 2019 +0200
+++ b/client/src/components/importoverview/LogEntry.vue	Thu Apr 11 10:11:59 2019 +0200
@@ -21,16 +21,8 @@
     <div style="width: 105px;" class="table-cell truncate">
       {{ entry.signer }}
     </div>
-    <div style="width: 72px;" class="table-cell center">
-      <span v-if="entry.state === 'failed'" class="text-danger">
-        {{ entry.state }}
-      </span>
-      <span v-if="entry.state === 'running'" class="text-bold">
-        {{ entry.state }}
-      </span>
-      <span v-if="entry.state !== 'running' && entry.state !== 'failed'">{{
-        entry.state
-      }}</span>
+    <div style="width: 72px;" :class="stateStyle">
+      {{ entry.state }}
     </div>
     <div style="width: 44px;" class="table-cell center">
       <font-awesome-icon
@@ -117,6 +109,16 @@
   },
   computed: {
     ...mapState("imports", ["show"]),
+    stateStyle() {
+      return [
+        "table-cell",
+        "center",
+        {
+          "text-danger": this.entry.state === "failed",
+          "text-bold": this.entry.state === "running"
+        }
+      ];
+    },
     needsApproval() {
       return this.entry.status === STATES.NEEDSAPPROVAL;
     },