From f41fb9862b3d76de3d9cb9082fefb2227a3997f5 Mon Sep 17 00:00:00 2001
From: Arne Schauf <git@asw.io>
Date: Sun, 4 Mar 2018 03:47:01 +0100
Subject: add tags on upload create

---
 src/pages/UploadCreate.vue | 29 +++++++++++++++++++----------
 1 file changed, 19 insertions(+), 10 deletions(-)

(limited to 'src/pages/UploadCreate.vue')

diff --git a/src/pages/UploadCreate.vue b/src/pages/UploadCreate.vue
index e1d027d..26e7703 100644
--- a/src/pages/UploadCreate.vue
+++ b/src/pages/UploadCreate.vue
@@ -8,16 +8,23 @@
           <div class="text-negative" v-if="errors.slug">
             {{ errors.slug }}
           </div>
-          <q-field :error="errors.title !== undefined"
-                   :error-label="errors.title"
-                   icon="fa-pencil">
-            <q-input v-model="title" float-label="Title" />
-          </q-field>
-          <q-field :error="errors.description !== undefined"
-                   :error-label="errors.description"
-                   icon="fa-bars">
-            <q-input v-model="description" type="textarea" float-label="Description" />
-          </q-field>
+          <div class="group">
+            <q-field :error="errors.title !== undefined"
+                     :error-label="errors.title"
+                     icon="fa-pencil">
+              <q-input v-model="title" float-label="Title" />
+            </q-field>
+            <q-field :error="errors.description !== undefined"
+                     :error-label="errors.description"
+                     icon="fa-bars">
+              <q-input v-model="description" type="textarea" float-label="Description" />
+            </q-field>
+            <q-field :error="errors.tags !== undefined"
+                     :error-label="errors.tags"
+                     icon="fa-tags">
+              <q-chips-input v-model="tags" float-label="Tags"></q-chips-input>
+            </q-field>
+          </div>
           <q-stepper-navigation>
             <q-btn color="primary" :disabled="!description || !title" @click="$refs.stepper.next()">Next</q-btn>
           </q-stepper-navigation>
@@ -133,6 +140,7 @@
     data () {
       return {
         files: [],
+        tags: [],
         title: '',
         description: '',
         slug: '',
@@ -229,6 +237,7 @@
           description: this.description,
           files: this.files.map(el => el._id),
           pic: this.pic,
+          tags: this.tags,
         }
         this.$http.post('/uploads', params)
           .then((response) => {
-- 
cgit v1.2.3-54-g00ecf

