feat: modal
This commit is contained in:
@@ -1,18 +1,14 @@
|
|||||||
<ng-template #rotationsModal let-modal>
|
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h4 class="modal-title">Edit Player Roles</h4>
|
<h4 class="modal-title">{{ player.name }}</h4>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="btn-close"
|
class="btn-close"
|
||||||
(click)="modal.dismiss()"
|
(click)="activeModal.dismiss()"
|
||||||
aria-label="Close"
|
aria-label="Close"
|
||||||
></button>
|
></button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<form>
|
<form>
|
||||||
<div class="mb-3">
|
|
||||||
<label class="form-label">{{ player.name }}</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<input
|
<input
|
||||||
class="form-check-input"
|
class="form-check-input"
|
||||||
@@ -66,20 +62,12 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
class="btn btn-secondary"
|
|
||||||
(click)="modal.dismiss()"
|
|
||||||
>
|
|
||||||
Cancel
|
|
||||||
</button>
|
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="btn btn-primary"
|
class="btn btn-primary"
|
||||||
(click)="savePlayer(); modal.close()"
|
(click)="savePlayer(); activeModal.close()"
|
||||||
>
|
>
|
||||||
Save
|
Save
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ export class Player{
|
|||||||
name: string;
|
name: string;
|
||||||
outside: boolean = false;
|
outside: boolean = false;
|
||||||
middle: boolean = false;
|
middle: boolean = false;
|
||||||
opposite: boolean = false;
|
opposite: boolean = false; // dia
|
||||||
setter: boolean = false;
|
setter: boolean = false;
|
||||||
libero: boolean = false;
|
libero: boolean = false;
|
||||||
constructor( name: string){
|
constructor( name: string){
|
||||||
|
|||||||
@@ -4,12 +4,9 @@
|
|||||||
<ul class="list-group mb-3">
|
<ul class="list-group mb-3">
|
||||||
@for (player of players; track $index) {
|
@for (player of players; track $index) {
|
||||||
<li class="list-group-item">{{ player.name }}</li>
|
<li class="list-group-item">{{ player.name }}</li>
|
||||||
<button
|
<button class="btn btn-outline-primary" (click)="open(player)">
|
||||||
class="btn btn-sm btn-primary"
|
<div>Edit Roles</div>
|
||||||
(click)="openPlayerDialog(player)"
|
</button>
|
||||||
>
|
|
||||||
Edit Roles
|
|
||||||
</button>
|
|
||||||
}
|
}
|
||||||
</ul>
|
</ul>
|
||||||
<div class="input-group mb-3">
|
<div class="input-group mb-3">
|
||||||
|
|||||||
@@ -34,5 +34,9 @@ export class ScreenRotationsComponent {
|
|||||||
console.log('Modal dismissed');
|
console.log('Modal dismissed');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
open(player: Player){
|
||||||
|
const modalRef = this.modalService.open(ModalRotationsComponent);
|
||||||
|
modalRef.componentInstance.player = player;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user