Sync both clan lists.
This commit is contained in:
@@ -8,9 +8,7 @@
|
||||
<div class="input-group input-group-lg mb-3">
|
||||
<select class="form-select form-control border-secondary" id="home-clan" hx-get="/players" hx-target="#home-player-list">
|
||||
<option disabled selected value>Auswählen...</option>
|
||||
{{ range .clans }}
|
||||
<option value="{{ .ID }}">[{{ .Tag }}] {{ .Name }}</option>
|
||||
{{ end }}
|
||||
<!-- Options will be loaded dynamically -->
|
||||
</select>
|
||||
<button class="btn btn-lg btn-outline-secondary text-danger" type="button" id="home-delete" data-bs-toggle="modal" data-bs-list="#home-clan" data-bs-target="#deleteClanModal" disabled>
|
||||
<i class="bi bi-trash3"></i>
|
||||
@@ -27,14 +25,8 @@
|
||||
|
||||
<script lang="javascript">
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const dropdownHome = document.getElementById('home-clan');
|
||||
const deleteButtonHome = document.getElementById('home-delete');
|
||||
const editButtonHome = document.getElementById('home-edit');
|
||||
|
||||
dropdownHome.addEventListener('change', function () {
|
||||
deleteButtonHome.disabled = !this.value;
|
||||
editButtonHome.disabled = !this.value;
|
||||
});
|
||||
setupClanButtons('home-clan', 'home-delete', 'home-edit');
|
||||
htmx.ajax('GET', '/clan_options', {target: '#home-clan'});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user