2017-12-05 10:02:41 +00:00
|
|
|
<template>
|
2018-01-26 14:11:34 +00:00
|
|
|
<div class="chat-panel">
|
2018-03-31 18:14:36 +00:00
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading timeline-heading">
|
2018-01-26 14:11:34 +00:00
|
|
|
<div class="title">
|
|
|
|
{{$t('chat.title')}}
|
|
|
|
</div>
|
2017-12-05 10:02:41 +00:00
|
|
|
</div>
|
2018-01-26 14:11:34 +00:00
|
|
|
<div class="chat-window" v-chat-scroll>
|
2017-12-05 13:20:34 +00:00
|
|
|
<div class="chat-message" v-for="message in messages" :key="message.id">
|
2017-12-05 10:02:41 +00:00
|
|
|
<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">
|
2017-12-05 11:09:54 +00:00
|
|
|
<form @submit.prevent="submit(currentMessage)">
|
|
|
|
<input v-model="currentMessage" type="text" >
|
|
|
|
</form>
|
2017-12-05 10:02:41 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2018-01-26 14:11:34 +00:00
|
|
|
<script src="./chat_panel.js"></script>
|
2017-12-05 10:02:41 +00:00
|
|
|
|
|
|
|
<style lang="scss">
|
2018-04-01 19:07:25 +00:00
|
|
|
@import '../../_variables.scss';
|
|
|
|
|
|
|
|
.chat-window {
|
2018-04-07 16:30:27 +00:00
|
|
|
max-height: 200px;
|
|
|
|
overflow-y: auto;
|
|
|
|
overflow-x: hidden;
|
2018-04-01 19:07:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.chat-message {
|
2018-04-07 16:30:27 +00:00
|
|
|
padding: 0.2em 0.5em
|
2018-04-01 19:07:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.chat-avatar {
|
2018-04-07 16:30:27 +00:00
|
|
|
img {
|
|
|
|
height: 32px;
|
|
|
|
width: 32px;
|
|
|
|
border-radius: $fallback--avatarRadius;
|
|
|
|
border-radius: var(--avatarRadius, $fallback--avatarRadius);
|
|
|
|
margin-right: 0.5em;
|
|
|
|
}
|
2018-04-01 19:07:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.chat-input {
|
2018-04-07 16:30:27 +00:00
|
|
|
display: flex;
|
|
|
|
form {
|
|
|
|
flex: auto;
|
|
|
|
input {
|
|
|
|
margin: 0.5em;
|
|
|
|
width: fill-available;
|
2018-04-01 19:07:25 +00:00
|
|
|
}
|
2018-04-07 16:30:27 +00:00
|
|
|
}
|
2018-04-01 19:07:25 +00:00
|
|
|
}
|
2017-12-05 10:02:41 +00:00
|
|
|
</style>
|