Parcourir la source

adminSetAbsent

master
peter il y a 5 ans
Parent
révision
78abe78903

+ 15
- 2
src/frontend/src/app/frontcraft/pages/raid/raid.component.html Voir le fichier

@@ -72,6 +72,10 @@
72 72
                                 <nb-card-header>Tanks ({{raid.tanks.length}})</nb-card-header>
73 73
                                 <nb-card-body>
74 74
                                     <div *ngFor="let participant of raid.tanks">
75
+                                        <button (click)="adminSetAbsent(participant)" *ngIf="manageRaid" nbButton outline
76
+                                            status="info" size="tiny">
77
+                                            A
78
+                                        </button>
75 79
                                         <button (click)="setBench(participant)" *ngIf="manageRaid" nbButton outline
76 80
                                             status="warning" size="tiny">
77 81
                                             B
@@ -122,6 +126,10 @@
122 126
                                 <nb-card-header>Healers ({{raid.healers.length}})</nb-card-header>
123 127
                                 <nb-card-body>
124 128
                                     <div *ngFor="let participant of raid.healers">
129
+                                        <button (click)="adminSetAbsent(participant)" *ngIf="manageRaid" nbButton
130
+                                            outline status="info" size="tiny">
131
+                                            A
132
+                                        </button>
125 133
                                         <button (click)="setBench(participant)" *ngIf="manageRaid" nbButton outline
126 134
                                             status="warning" size="tiny">
127 135
                                             B
@@ -171,6 +179,10 @@
171 179
                                     <nb-card-header>{{group.key}} ({{group.value.length}})</nb-card-header>
172 180
                                     <nb-card-body>
173 181
                                         <div *ngFor="let participant of group.value">
182
+                                            <button (click)="adminSetAbsent(participant)" *ngIf="manageRaid" nbButton
183
+                                                outline status="info" size="tiny">
184
+                                                A
185
+                                            </button>
174 186
                                             <button (click)="setBench(participant)" *ngIf="manageRaid" nbButton outline
175 187
                                                 status="warning" size="tiny">
176 188
                                                 B
@@ -206,8 +218,9 @@
206 218
                                                     </p>
207 219
                                                 </div>
208 220
                                             </ng-template>
209
-                                            <nb-icon *ngIf="participant.memo" [nbPopover]="memoBox" nbPopoverTrigger="hover"
210
-                                                style="width: 0.75em; height: 0.75em;" icon="message-circle-outline">
221
+                                            <nb-icon *ngIf="participant.memo" [nbPopover]="memoBox"
222
+                                                nbPopoverTrigger="hover" style="width: 0.75em; height: 0.75em;"
223
+                                                icon="message-circle-outline">
211 224
                                             </nb-icon>
212 225
                                             <span *ngIf="participant.rank=='Trial'" style="font-size: 9px;">
213 226
                                                 Trial

+ 20
- 0
src/frontend/src/app/frontcraft/pages/raid/raid.component.ts Voir le fichier

@@ -247,4 +247,24 @@ export class FrontcraftRaidComponent
247 247
       .then(_ => this.refresh())
248 248
     }
249 249
   }
250
+
251
+  adminSetAbsent(signup: Signup) {
252
+
253
+    const manageRaid = this.api.get('manageRaid')
254
+    if(manageRaid){
255
+      const signupUpdated:Signup = {
256
+        benched: false,
257
+        absent: !signup.absent,
258
+        late: false,
259
+        characterid: signup.characterid,
260
+        raidid: signup.raidid,
261
+        timestamp: signup.timestamp,
262
+        id: signup.id,
263
+        memo: signup.memo
264
+      }
265
+      manageRaid.updateSignup(signupUpdated)
266
+      .then(_ => this.refresh())
267
+    }
268
+  }
269
+
250 270
 }

Chargement…
Annuler
Enregistrer