1
1
<template >
2
- <div class =" container-fluid" ref =" window" >
2
+ <div
3
+ ref =" window"
4
+ class =" container-fluid"
5
+ >
3
6
<div class =" row" >
4
7
<div class =" col-12" >
5
8
<span class =" title text-default mb-2" >
6
9
{{ translate('menu.registry') }}
7
- <small ><fa icon =" angle-right" /></small >
10
+ <small ><fa icon =" angle-right" /></small >
8
11
{{ translate('menu.goals') }}
9
12
</span >
10
13
</div >
11
14
</div >
12
15
13
- <panel cards search @search =" search = $event" >
14
- <template v-slot :left >
15
- <button-with-icon class =" btn-primary btn-reverse" icon =" plus" href =" #/registry/goals/edit" >{{translate('registry.goals.addGoalGroup')}}</button-with-icon >
16
+ <panel
17
+ cards
18
+ search
19
+ @search =" search = $event"
20
+ >
21
+ <template #left >
22
+ <button-with-icon
23
+ class =" btn-primary btn-reverse"
24
+ icon =" plus"
25
+ href =" #/registry/goals/edit"
26
+ >
27
+ {{ translate('registry.goals.addGoalGroup') }}
28
+ </button-with-icon >
16
29
</template >
17
30
</panel >
18
31
19
- <div class =" card-deck" v-for =" (chunk, index) of chunk(orderBy(groupsFiltered, 'createdAt', 'desc'), itemsPerPage)" :key =" index" >
20
- <div class =" card mb-2 p-0" :class =" ['col-' + (12 / itemsPerPage)]" v-for =" group of chunk" :key =" group.id" >
32
+ <div
33
+ v-for =" (chunk, index) of chunk(orderBy(groupsFiltered, 'createdAt', 'desc'), itemsPerPage)"
34
+ :key =" index"
35
+ class =" card-deck"
36
+ >
37
+ <div
38
+ v-for =" group of chunk"
39
+ :key =" group.id"
40
+ class =" card mb-2 p-0"
41
+ :class =" ['col-' + (12 / itemsPerPage)]"
42
+ >
21
43
<div class =" card-header" >
22
- <strong >{{group.name}}</strong > <small class =" text-muted" >{{group.id}}</small >
44
+ <strong >{{ group.name }}</strong > <small class =" text-muted" >{{ group.id }}</small >
23
45
</div >
24
46
<div class =" card-body" >
25
47
<dl class =" row" >
26
- <dt class =" col-6" >{{translate('registry.goals.input.displayAs.title')}}</dt >
27
- <dd class =" col-6" >{{group.display.type}}</dd >
48
+ <dt class =" col-6" >
49
+ {{ translate('registry.goals.input.displayAs.title') }}
50
+ </dt >
51
+ <dd class =" col-6" >
52
+ {{ group.display.type }}
53
+ </dd >
28
54
<template v-if =" group .display .type === ' fade' " >
29
- <dt class =" col-6" >{{translate('registry.goals.input.durationMs.title')}}</dt >
30
- <dd class =" col-6" >{{group.display.durationMs}}ms</dd >
31
- <dt class =" col-6" >{{translate('registry.goals.input.animationInMs.title')}}</dt >
32
- <dd class =" col-6" >{{group.display.animationInMs}}ms</dd >
33
- <dt class =" col-6" >{{translate('registry.goals.input.animationOutMs.title')}}</dt >
34
- <dd class =" col-6" >{{group.display.animationOutMs}}ms</dd >
55
+ <dt class =" col-6" >
56
+ {{ translate('registry.goals.input.durationMs.title') }}
57
+ </dt >
58
+ <dd class =" col-6" >
59
+ {{ group.display.durationMs }}ms
60
+ </dd >
61
+ <dt class =" col-6" >
62
+ {{ translate('registry.goals.input.animationInMs.title') }}
63
+ </dt >
64
+ <dd class =" col-6" >
65
+ {{ group.display.animationInMs }}ms
66
+ </dd >
67
+ <dt class =" col-6" >
68
+ {{ translate('registry.goals.input.animationOutMs.title') }}
69
+ </dt >
70
+ <dd class =" col-6" >
71
+ {{ group.display.animationOutMs }}ms
72
+ </dd >
35
73
</template >
36
74
</dl >
37
75
<ul class =" list-group list-group-flush border-top-0" >
38
- <li v-for =" goal of group.goals" :key =" goal.id" class =" list-group-item" >
76
+ <li
77
+ v-for =" goal of group.goals"
78
+ :key =" goal.id"
79
+ class =" list-group-item"
80
+ >
39
81
<dl class =" row" >
40
- <h5 class =" col-12" >{{goal.name}}</h5 >
41
- <dt class =" col-6" >{{translate('registry.goals.input.type.title')}}</dt >
42
- <dd class =" col-6" >{{goal.type}}</dd >
82
+ <h5 class =" col-12" >
83
+ {{ goal.name }}
84
+ </h5 >
85
+ <dt class =" col-6" >
86
+ {{ translate('registry.goals.input.type.title') }}
87
+ </dt >
88
+ <dd class =" col-6" >
89
+ {{ goal.type }}
90
+ </dd >
43
91
44
- <dt class =" col-6" v-if =" goal.type === 'tips'" >{{translate('registry.goals.input.countBitsAsTips.title')}}</dt >
45
- <dd class =" col-6" v-if =" goal.type === 'tips'" >{{!!goal.countBitsAsTips}}</dd >
92
+ <dt
93
+ v-if =" goal.type === 'tips'"
94
+ class =" col-6"
95
+ >
96
+ {{ translate('registry.goals.input.countBitsAsTips.title') }}
97
+ </dt >
98
+ <dd
99
+ v-if =" goal.type === 'tips'"
100
+ class =" col-6"
101
+ >
102
+ {{ !!goal.countBitsAsTips }}
103
+ </dd >
46
104
47
- <dt class =" col-6" >{{translate('registry.goals.input.goalAmount.title')}}</dt >
48
- <dd class =" col-6" >{{goal.goalAmount}}</dd >
105
+ <dt class =" col-6" >
106
+ {{ translate('registry.goals.input.goalAmount.title') }}
107
+ </dt >
108
+ <dd class =" col-6" >
109
+ {{ goal.goalAmount }}
110
+ </dd >
49
111
50
- <dt class =" col-6" >{{translate('registry.goals.input.endAfter.title')}}</dt >
112
+ <dt class =" col-6" >
113
+ {{ translate('registry.goals.input.endAfter.title') }}
114
+ </dt >
51
115
<dd class =" col-6" >
52
- <fa icon =" infinity" fixed-width v-if =" goal.endAfterIgnore" ></fa >
53
- <template v-else >{{new Date(goal.endAfter).toLocaleString()}}</template >
116
+ <fa
117
+ v-if =" goal.endAfterIgnore"
118
+ icon =" infinity"
119
+ fixed-width
120
+ />
121
+ <template v-else >
122
+ {{ new Date(goal.endAfter).toLocaleString() }}
123
+ </template >
54
124
</dd >
55
125
</dl >
56
126
</li >
57
127
</ul >
58
128
</div >
59
129
<div class =" card-footer text-right" >
60
- <button-with-icon class =" btn-only-icon btn-secondary btn-reverse" icon =" clone" @click =" clone(group)" />
61
- <hold-button class =" btn-danger btn-only-icon" @trigger =" removeGoal(group)" icon =" trash" >
62
- <template slot="title">{{translate('dialog.buttons.delete')}}</template >
63
- <template slot="onHoldTitle">{{translate('dialog.buttons.hold-to-delete')}}</template >
130
+ <button-with-icon
131
+ class =" btn-only-icon btn-secondary btn-reverse"
132
+ icon =" clone"
133
+ @click =" clone(group)"
134
+ />
135
+ <hold-button
136
+ class =" btn-danger btn-only-icon"
137
+ icon =" trash"
138
+ @trigger =" removeGoal(group)"
139
+ >
140
+ <template slot="title">
141
+ {{ translate('dialog.buttons.delete') }}
142
+ </template >
143
+ <template slot="onHoldTitle">
144
+ {{ translate('dialog.buttons.hold-to-delete') }}
145
+ </template >
64
146
</hold-button >
65
147
<button-with-icon
66
148
:text =" '/overlays/goals/' + group.id"
67
149
:href =" '/overlays/goals/' + group.id"
68
150
class =" btn-dark btn-only-icon"
69
151
icon =" link"
70
152
target =" _blank"
71
- />
153
+ />
72
154
<button-with-icon
73
155
:text =" translate('dialog.buttons.edit')"
74
156
:href =" '#/registry/goals/edit/' + group.id"
75
157
class =" btn-primary btn-only-icon"
76
158
icon =" edit"
77
- />
159
+ />
78
160
</div >
79
161
</div >
80
162
81
163
<!-- add empty cards -->
82
164
<template v-if =" chunk .length !== itemsPerPage " >
83
- <div class =" card col-4" style =" visibility : hidden " v-for =" i in itemsPerPage - (chunk.length % itemsPerPage)" v-bind:key =" i" ></div >
165
+ <div
166
+ v-for =" i in itemsPerPage - (chunk.length % itemsPerPage)"
167
+ :key =" i"
168
+ class =" card col-4"
169
+ style =" visibility : hidden "
170
+ />
84
171
</template >
85
172
</div >
86
173
</div >
90
177
import { library } from ' @fortawesome/fontawesome-svg-core' ;
91
178
import { faClone } from ' @fortawesome/free-solid-svg-icons' ;
92
179
import {
93
- chunk , filter , orderBy ,
180
+ chunk , filter , orderBy ,
94
181
} from ' lodash-es' ;
95
182
import { v4 as uuid } from ' uuid' ;
96
183
import Vue from ' vue' ;
@@ -187,7 +274,7 @@ export default Vue.extend({
187
274
id: clonedGroupId ,
188
275
name: group .name + ' (clone)' ,
189
276
goals: group .goals .map (goal => ({
190
- ... goal , id: uuid (), groupId: clonedGroupId ,
277
+ ... goal , id: uuid (), groupId: clonedGroupId ,
191
278
})),
192
279
};
193
280
this .socket .emit (' goals::save' , clonedGroup , (err : string | null ) => {
@@ -204,7 +291,7 @@ export default Vue.extend({
204
291
if (err ) {
205
292
console .error (err );
206
293
} else {
207
- this .groups = this .groups .filter (o => o .id != group .id );
294
+ this .groups = this .groups .filter (o => o .id != group .id );
208
295
}
209
296
});
210
297
},
0 commit comments