File tree Expand file tree Collapse file tree 6 files changed +128
-9
lines changed Expand file tree Collapse file tree 6 files changed +128
-9
lines changed Original file line number Diff line number Diff line change 54
54
this .$refs .input .focus ();
55
55
})
56
56
},
57
+ },
58
+ computed: {
57
59
inputId () {
58
60
if (this .id ) {
59
61
return this .id ;
60
62
}
61
63
return ' edit-input' ;
62
- }
63
- },
64
+ },
65
+ }
64
66
}
65
67
</script >
66
68
67
69
<style scoped>
68
70
input {
69
71
text-align : center ;
70
72
}
73
+
71
74
label {
72
75
margin-bottom : 0 ;
73
76
}
Original file line number Diff line number Diff line change 1
1
<template >
2
- <div >
2
+ <span >
3
3
<a >{{teamState.fouls.length}}</a >
4
- </div >
4
+ </span >
5
5
</template >
6
6
7
7
<script >
8
8
import EditableLabelNumber from " ../common/EditableLabelNumber" ;
9
9
10
10
export default {
11
- name: " TeamFoulCounter " ,
11
+ name: " TeamFouls " ,
12
12
components: {EditableLabelNumber},
13
13
props: {
14
14
teamColor: String ,
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <span class =" edit-link" >
3
+ <a v-b-modal =" modalId" v-if =" editMode.active" >
4
+ <img alt =" pen" src =" @/assets/img/icons8-ball-point-pen-16.png" >
5
+ </a >
6
+ <b-modal :id =" modalId"
7
+ :title =" 'Fouls for team ' + teamColor"
8
+ :lazy =" true" >
9
+ <TeamFoulsEditTable :edit-mode =" {active: true}" :team-color =" teamColor" />
10
+ <div slot =" modal-footer" >
11
+ <!-- hide modal buttons -->
12
+ </div >
13
+ </b-modal >
14
+ </span >
15
+ </template >
16
+
17
+ <script >
18
+ import {TEAM_BLUE , TEAM_YELLOW } from " ../../refereeState" ;
19
+ import EditableLabelDuration from " ../common/EditableLabelDuration" ;
20
+ import TeamFoulsEditTable from " ./TeamFoulsEditTable" ;
21
+
22
+ export default {
23
+ name: " TeamFoulsEdit" ,
24
+ components: {TeamFoulsEditTable, EditableLabelDuration},
25
+ props: {
26
+ teamColor: String ,
27
+ editMode: Object ,
28
+ },
29
+ data () {
30
+ return {
31
+ TEAM_YELLOW : TEAM_YELLOW ,
32
+ TEAM_BLUE : TEAM_BLUE
33
+ }
34
+ },
35
+ computed: {
36
+ modalId () {
37
+ return ` fouls-${ this .teamColor } -modal` ;
38
+ },
39
+ }
40
+ }
41
+ </script >
42
+
43
+ <style scoped>
44
+ .edit-link {
45
+ margin-left : 0.3em ;
46
+ }
47
+ </style >
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div >
3
+ <table >
4
+ <tr >
5
+ <th >Id</th >
6
+ <th >Cause</th >
7
+ <th >Remove</th >
8
+ </tr >
9
+ <tr v-for =" foul of team.fouls" v-bind:key =" foul.id" >
10
+ <td >
11
+ {{foul.id}}
12
+ </td >
13
+ <td >
14
+ <span v-if =" foul.causedByGameEvent" >
15
+ {{foul.causedByGameEvent.type}}
16
+ </span >
17
+ <span v-else >
18
+ -
19
+ </span >
20
+ </td >
21
+ <td >
22
+ <a class =" btn-remove" v-on:click =" removeFoul(foul.id)" >
23
+ <font-awesome-icon
24
+ class =" fa-xs"
25
+ icon =" times-circle" />
26
+ </a >
27
+ </td >
28
+ </tr >
29
+ </table >
30
+ </div >
31
+ </template >
32
+
33
+ <script >
34
+ import {submitChange } from " ../../submit" ;
35
+
36
+ export default {
37
+ name: " TeamFoulsEditTable" ,
38
+ props: {
39
+ teamColor: String ,
40
+ editMode: Object ,
41
+ },
42
+ methods: {
43
+ removeFoul (id ) {
44
+ submitChange ({
45
+ updateTeamState: {
46
+ forTeam: this .teamColor ,
47
+ removeFoul: id
48
+ }
49
+ });
50
+ }
51
+ },
52
+ computed: {
53
+ team () {
54
+ return this .$store .state .matchState .teamState [this .teamColor ]
55
+ }
56
+ }
57
+ }
58
+ </script >
59
+
60
+ <style scoped>
61
+ table {
62
+ width : 100% ;
63
+ }
64
+ </style >
Original file line number Diff line number Diff line change 81
81
</tr >
82
82
<tr >
83
83
<td >
84
- <TeamFoulCounter :team-color =" TEAM_YELLOW" />
84
+ <TeamFouls :team-color =" TEAM_YELLOW" />
85
+ <TeamFoulsEdit :edit-mode =" editMode" :team-color =" TEAM_YELLOW" />
85
86
</td >
86
87
<td class =" label-column" >Fouls</td >
87
88
<td >
88
- <TeamFoulCounter :team-color =" TEAM_BLUE" />
89
+ <TeamFouls :team-color =" TEAM_BLUE" />
90
+ <TeamFoulsEdit :edit-mode =" editMode" :team-color =" TEAM_BLUE" />
89
91
</td >
90
92
</tr >
91
93
<tr >
131
133
import TeamRedCards from " ./TeamRedCards" ;
132
134
import TeamBotSubstitution from " ./TeamBotSubstitution" ;
133
135
import TeamConnection from " ./TeamConnection" ;
134
- import TeamFoulCounter from " ./TeamFoulCounter " ;
136
+ import TeamFouls from " ./TeamFouls " ;
135
137
import TeamPlacementFailures from " ./TeamPlacementFailures" ;
136
138
import TeamTimeoutTime from " ./TeamTimeoutTime" ;
137
139
import TeamYellowCardNextDue from " ./TeamYellowCardNextDue" ;
138
140
import TeamYellowCardsActive from " ./TeamYellowCardsActive" ;
139
141
import {TEAM_BLUE , TEAM_YELLOW } from " ../../refereeState" ;
140
142
import TeamYellowCardsEdit from " ./TeamYellowCardsEdit" ;
141
143
import TeamRedCardsEdit from " ./TeamRedCardsEdit" ;
144
+ import TeamFoulsEdit from " ./TeamFoulsEdit" ;
142
145
143
146
export default {
144
147
name: " TeamOverviewView" ,
145
148
components: {
149
+ TeamFoulsEdit,
146
150
TeamRedCardsEdit,
147
151
TeamYellowCardsActive,
148
152
TeamTimeoutTime,
149
153
TeamPlacementFailures,
150
- TeamFoulCounter ,
154
+ TeamFouls ,
151
155
TeamConnection,
152
156
TeamBotSubstitution,
153
157
TeamRedCards,
Original file line number Diff line number Diff line change 13
13
</td >
14
14
<td >
15
15
<EditableLabelText
16
+ :id =" 'yellow-card-' + card.id"
16
17
:edit-mode =" editMode"
17
18
:value =" card.timeRemaining"
18
19
:callback =" (v) => updateCardTime(v, card.id)" />
You can’t perform that action at this time.
0 commit comments