blob: 9113211eb94d9a84d921ed04a25807c0403c7df3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
<template>
<div
v-if="!collapsed || !floating"
class="shout-panel"
>
<div class="panel panel-default">
<div
class="panel-heading"
:class="{ 'shout-heading': floating }"
@click.stop.prevent="togglePanel"
>
<div class="title">
{{ $t('shoutbox.title') }}
<FAIcon
v-if="floating"
icon="times"
class="close-icon"
/>
</div>
</div>
<div class="panel-body shout-window">
<div
v-for="message in messages"
:key="message.id"
class="shout-message"
>
<span class="shout-avatar">
<img :src="message.author.avatar">
</span>
<div class="shout-content">
<router-link
class="shout-name"
:to="userProfileLink(message.author)"
>
{{ message.author.username }}
</router-link>
<br>
<span class="shout-text">
{{ message.text }}
</span>
</div>
</div>
</div>
<div class="panel-body shout-input">
<textarea
v-model="currentMessage"
class="shout-input-textarea input"
rows="1"
@keyup.enter="submit(currentMessage)"
/>
</div>
</div>
</div>
<div
v-else
class="shout-panel"
>
<div class="panel panel-default">
<div
class="panel-heading -stub timeline-heading shout-heading"
@click.stop.prevent="togglePanel"
>
<div class="title">
<FAIcon
class="icon"
icon="bullhorn"
/>
{{ $t('shoutbox.title') }}
</div>
</div>
</div>
</div>
</template>
<script src="./shout_panel.js"></script>
<style lang="scss">
.floating-shout {
position: fixed;
bottom: 0.5em;
z-index: var(--ZI_popovers);
max-width: 25em;
&.-left {
left: 0.5em;
}
&:not(.-left) {
right: 0.5em;
}
}
.shout-panel {
.shout-heading {
cursor: pointer;
.icon {
color: var(--text);
margin-right: 0.5em;
}
.title {
display: flex;
justify-content: space-between;
align-items: center;
}
}
.shout-window {
overflow-y: auto;
overflow-x: hidden;
max-height: 20em;
}
.shout-window-container {
height: 100%;
}
.shout-message {
display: flex;
padding: 0.2em 0.5em;
}
.shout-avatar {
img {
height: 24px;
width: 24px;
border-radius: var(--roundness);
margin-right: 0.5em;
margin-top: 0.25em;
}
}
.shout-input {
display: flex;
textarea {
flex: 1;
margin: 0.6em;
min-height: 3.5em;
resize: none;
}
}
.shout-panel {
.title {
display: flex;
justify-content: space-between;
}
}
}
</style>
|