wip: player modal

This commit is contained in:
eneller
2026-01-30 22:51:09 +01:00
parent 51414f5a99
commit 3b8e5145c3
12 changed files with 238 additions and 3 deletions

View File

@@ -0,0 +1,85 @@
<ng-template #rotationsModal let-modal>
<div class="modal-header">
<h4 class="modal-title">Edit Player Roles</h4>
<button
type="button"
class="btn-close"
(click)="modal.dismiss()"
aria-label="Close"
></button>
</div>
<div class="modal-body">
<form>
<div class="mb-3">
<label class="form-label">{{ player.name }}</label>
</div>
<div class="form-check">
<input
class="form-check-input"
type="checkbox"
[(ngModel)]="player.outside"
name="outside"
id="outside"
/>
<label class="form-check-label" for="outside">Outside</label>
</div>
<div class="form-check">
<input
class="form-check-input"
type="checkbox"
[(ngModel)]="player.middle"
name="middle"
id="middle"
/>
<label class="form-check-label" for="middle">Middle</label>
</div>
<div class="form-check">
<input
class="form-check-input"
type="checkbox"
[(ngModel)]="player.opposite"
name="opposite"
id="opposite"
/>
<label class="form-check-label" for="opposite">Opposite</label>
</div>
<div class="form-check">
<input
class="form-check-input"
type="checkbox"
[(ngModel)]="player.setter"
name="setter"
id="setter"
/>
<label class="form-check-label" for="setter">Setter</label>
</div>
<div class="form-check">
<input
class="form-check-input"
type="checkbox"
[(ngModel)]="player.libero"
name="libero"
id="libero"
/>
<label class="form-check-label" for="libero">Libero</label>
</div>
</form>
</div>
<div class="modal-footer">
<button
type="button"
class="btn btn-secondary"
(click)="modal.dismiss()"
>
Cancel
</button>
<button
type="button"
class="btn btn-primary"
(click)="savePlayer(); modal.close()"
>
Save
</button>
</div>
</ng-template>

View File

@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ModalRotationsComponent } from './modal-rotations.component';
describe('ModalRotationsComponent', () => {
let component: ModalRotationsComponent;
let fixture: ComponentFixture<ModalRotationsComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [ModalRotationsComponent]
})
.compileComponents();
fixture = TestBed.createComponent(ModalRotationsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -0,0 +1,21 @@
import { Component, Input } from '@angular/core';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { Player} from '../model';
import { FormsModule } from '@angular/forms';
@Component({
selector: 'app-modal-rotations',
imports: [FormsModule],
templateUrl: './modal-rotations.component.html',
styleUrl: './modal-rotations.component.less'
})
export class ModalRotationsComponent {
@Input() player!: Player;
constructor(public activeModal: NgbActiveModal) {}
savePlayer() {
// You can emit an event or handle the save logic here
this.activeModal.close(this.player);
}
}