peter преди 5 години
родител
ревизия
78abe78903
променени са 2 файла, в които са добавени 35 реда и са изтрити 2 реда
  1. 15
    2
      src/frontend/src/app/frontcraft/pages/raid/raid.component.html
  2. 20
    0
      src/frontend/src/app/frontcraft/pages/raid/raid.component.ts

+ 15
- 2
src/frontend/src/app/frontcraft/pages/raid/raid.component.html Целия файл

72
                                 <nb-card-header>Tanks ({{raid.tanks.length}})</nb-card-header>
72
                                 <nb-card-header>Tanks ({{raid.tanks.length}})</nb-card-header>
73
                                 <nb-card-body>
73
                                 <nb-card-body>
74
                                     <div *ngFor="let participant of raid.tanks">
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
                                         <button (click)="setBench(participant)" *ngIf="manageRaid" nbButton outline
79
                                         <button (click)="setBench(participant)" *ngIf="manageRaid" nbButton outline
76
                                             status="warning" size="tiny">
80
                                             status="warning" size="tiny">
77
                                             B
81
                                             B
122
                                 <nb-card-header>Healers ({{raid.healers.length}})</nb-card-header>
126
                                 <nb-card-header>Healers ({{raid.healers.length}})</nb-card-header>
123
                                 <nb-card-body>
127
                                 <nb-card-body>
124
                                     <div *ngFor="let participant of raid.healers">
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
                                         <button (click)="setBench(participant)" *ngIf="manageRaid" nbButton outline
133
                                         <button (click)="setBench(participant)" *ngIf="manageRaid" nbButton outline
126
                                             status="warning" size="tiny">
134
                                             status="warning" size="tiny">
127
                                             B
135
                                             B
171
                                     <nb-card-header>{{group.key}} ({{group.value.length}})</nb-card-header>
179
                                     <nb-card-header>{{group.key}} ({{group.value.length}})</nb-card-header>
172
                                     <nb-card-body>
180
                                     <nb-card-body>
173
                                         <div *ngFor="let participant of group.value">
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
                                             <button (click)="setBench(participant)" *ngIf="manageRaid" nbButton outline
186
                                             <button (click)="setBench(participant)" *ngIf="manageRaid" nbButton outline
175
                                                 status="warning" size="tiny">
187
                                                 status="warning" size="tiny">
176
                                                 B
188
                                                 B
206
                                                     </p>
218
                                                     </p>
207
                                                 </div>
219
                                                 </div>
208
                                             </ng-template>
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
                                             </nb-icon>
224
                                             </nb-icon>
212
                                             <span *ngIf="participant.rank=='Trial'" style="font-size: 9px;">
225
                                             <span *ngIf="participant.rank=='Trial'" style="font-size: 9px;">
213
                                                 Trial
226
                                                 Trial

+ 20
- 0
src/frontend/src/app/frontcraft/pages/raid/raid.component.ts Целия файл

247
       .then(_ => this.refresh())
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
 }

Loading…
Отказ
Запис