From 92289e545a62bd28ea336c5d712a05445e0e20ab Mon Sep 17 00:00:00 2001
From: Roger Braun <roger@rogerbraun.net>
Date: Fri, 26 Jan 2018 15:11:34 +0100
Subject: Move chat to sidebar.

---
 src/components/chat_panel/chat_panel.vue | 58 ++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)
 create mode 100644 src/components/chat_panel/chat_panel.vue

(limited to 'src/components/chat_panel/chat_panel.vue')

diff --git a/src/components/chat_panel/chat_panel.vue b/src/components/chat_panel/chat_panel.vue
new file mode 100644
index 00000000..ec379db5
--- /dev/null
+++ b/src/components/chat_panel/chat_panel.vue
@@ -0,0 +1,58 @@
+<template>
+  <div class="chat-panel">
+    <div class="panel panel-default base01-background">
+      <div class="panel-heading timeline-heading base02-background base04">
+        <div class="title">
+          {{$t('chat.title')}}
+        </div>
+      </div>
+      <div class="chat-window" v-chat-scroll>
+        <div class="chat-message" v-for="message in messages" :key="message.id">
+          <span class="chat-avatar">
+            <img :src="message.author.avatar" />
+            {{message.author.username}}:
+          </span>
+          <span class="chat-text">
+            {{message.text}}
+          </span>
+        </div>
+      </div>
+      <div class="chat-input">
+        <form @submit.prevent="submit(currentMessage)">
+          <input v-model="currentMessage" type="text" >
+        </form>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script src="./chat_panel.js"></script>
+
+<style lang="scss">
+ .chat-window {
+   max-height: 200px;
+   overflow-y: auto;
+   overflow-x: hidden;
+ }
+ .chat-message {
+   padding: 0.2em 0.5em
+ }
+ .chat-avatar {
+     img {
+         height: 32px;
+         width: 32px;
+         border-radius: 5px;
+         margin-right: 0.5em;
+     }
+ }
+ .chat-input {
+     display: flex;
+     form {
+         flex: auto;
+         input {
+             margin: 0.5em;
+             width: fill-available;
+         }
+     }
+ }
+</style>
-- 
cgit v1.2.3-70-g09d2

