Add add-player modal and player bar button setup.
This commit is contained in:
@@ -12,11 +12,23 @@
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<div class="btn-group btn-group-lg" role="group">
|
||||
<button type="button" class="btn btn-outline-secondary text-danger py-1 px-3"><i class="bi bi-person-dash fs-4"></i></button>
|
||||
<button type="button" class="btn btn-outline-secondary text-primary py-1 px-3"><i class="bi bi-person-gear fs-4"></i></button>
|
||||
<button type="button" class="btn btn-outline-secondary text-success py-1 px-3"><i class="bi bi-person-add fs-4"></i></button>
|
||||
<button type="button" class="btn btn-outline-secondary text-danger py-1 px-3" id="home-player-delete" disabled>
|
||||
<i class="bi bi-person-dash fs-4"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-outline-secondary text-primary py-1 px-3" id="home-player-edit" disabled>
|
||||
<i class="bi bi-person-gear fs-4"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-outline-secondary text-success py-1 px-3" id="home-player-add" data-bs-toggle="modal" data-bs-list="#home-player-list" data-bs-target="#addPlayerModal" disabled>
|
||||
<i class="bi bi-person-add fs-4"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script lang="javascript">
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
setupPlayerButtons('home-clan', 'home-player-list', 'home-player-delete', 'home-player-edit', 'home-player-add');
|
||||
});
|
||||
</script>
|
||||
|
||||
{{ end }}
|
||||
@@ -12,11 +12,23 @@
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<div class="btn-group btn-group-lg" role="group">
|
||||
<button type="button" class="btn btn-outline-secondary text-danger py-1 px-3"><i class="bi bi-person-dash fs-4"></i></button>
|
||||
<button type="button" class="btn btn-outline-secondary text-primary py-1 px-3"><i class="bi bi-person-gear fs-4"></i></button>
|
||||
<button type="button" class="btn btn-outline-secondary text-success py-1 px-3"><i class="bi bi-person-add fs-4"></i></button>
|
||||
<button type="button" class="btn btn-outline-secondary text-danger py-1 px-3" id="opponent-player-delete" disabled>
|
||||
<i class="bi bi-person-dash fs-4"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-outline-secondary text-primary py-1 px-3" id="opponent-player-edit" disabled>
|
||||
<i class="bi bi-person-gear fs-4"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-outline-secondary text-success py-1 px-3" id="opponent-player-add" data-bs-toggle="modal" data-bs-list="#opponent-player-list" data-bs-target="#addPlayerModal" disabled>
|
||||
<i class="bi bi-person-add fs-4"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script lang="javascript">
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
setupPlayerButtons('opponent-clan', 'opponent-player-list', 'opponent-player-delete', 'opponent-player-edit', 'opponent-player-add');
|
||||
});
|
||||
</script>
|
||||
|
||||
{{ end }}
|
||||
@@ -43,6 +43,11 @@
|
||||
{{ template "add_clan" . }}
|
||||
<!-- Edit Clan Modal -->
|
||||
{{ template "edit_clan" . }}
|
||||
|
||||
<!-- Add Player Modal -->
|
||||
{{ template "add_player" . }}
|
||||
|
||||
|
||||
<script lang="javascript">
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
|
||||
|
||||
54
templates/modals/add_player.html
Normal file
54
templates/modals/add_player.html
Normal file
@@ -0,0 +1,54 @@
|
||||
{{ define "add_player" }}
|
||||
|
||||
<div class="modal fade" id="addPlayerModal" tabindex="-1">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-3 text-success fw-bold" id="addPlayerModalLabel">Spieler hinzufügen</h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-floating mb-3">
|
||||
<input type="text" class="form-control form-control-lg" id="clanName" placeholder="Clan-Name" disabled>
|
||||
<label for="clanName">Clan-Name</label>
|
||||
</div>
|
||||
<div class="form-floating">
|
||||
<input type="text" class="form-control form-control-lg" id="playerName" placeholder="Spieler-Name">
|
||||
<label for="playerName">Spieler-Name</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" name="submit" class="btn btn-lg btn-primary">Hinzufügen</button>
|
||||
<button type="button" class="btn btn-lg btn-secondary" data-bs-dismiss="modal">Abbrechen</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script lang="javascript">
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const addPlayerModal = document.getElementById('addPlayerModal');
|
||||
const addPlayerModalBS = new bootstrap.Modal('#addPlayerModal');
|
||||
if (addPlayerModal) {
|
||||
addPlayerModal.addEventListener('show.bs.modal', event => {
|
||||
const [playerList, otherPlayerList] = getPlayerLists(event);
|
||||
const selectedClan = getSelectedClan(event);
|
||||
const clanTag = addPlayerModal.querySelector('#playerName');
|
||||
const clanName = addPlayerModal.querySelector('#clanName');
|
||||
clanName.value = selectedClan.innerText;
|
||||
|
||||
const submitButton = addPlayerModal.querySelector('button[name="submit"]');
|
||||
submitButton.addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
submitButton.onclick = function () {}
|
||||
|
||||
|
||||
|
||||
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user