From 3d4617bac822b54c04eb2f19509aa77e8c7a3bfd Mon Sep 17 00:00:00 2001
From: Mateja <mail@matejamaric.com>
Date: Sun, 21 Mar 2021 21:18:09 +0100
Subject: Add descriptions to activities call sign filter.

---
 resources/js/components/call-sign-filter.vue | 13 +++++++++++++
 1 file changed, 13 insertions(+)

(limited to 'resources/js/components/call-sign-filter.vue')

diff --git a/resources/js/components/call-sign-filter.vue b/resources/js/components/call-sign-filter.vue
index 16eaae8..0ba8b4d 100644
--- a/resources/js/components/call-sign-filter.vue
+++ b/resources/js/components/call-sign-filter.vue
@@ -5,11 +5,18 @@
       <option value="all">All</option>
       <option v-for="option in options" :key="option.id" :value="option.sign" v-text="option.sign"></option>
     </select>
+
+    <div class="card mb-3" v-if="showDescriptions && (selected !== 'all')">
+      <div class="card-body pb-1">
+        <div class="card-text" v-html="description"></div>
+      </div>
+    </div>
   </div>
 </template>
 
 <script>
 export default {
+  props: ['showDescriptions'],
   mounted() {
     this.$store.dispatch('pullSigns');
   },
@@ -25,6 +32,12 @@ export default {
     },
     options() {
       return this.$store.getters.getSigns;
+    },
+    description() {
+      for (let i = 0; i < this.options.length; i++)
+        if (this.options[i].sign === this.selected)
+          return this.options[i].description;
+      return '';
     }
   }
 }
-- 
cgit v1.2.3

