Fix
This commit is contained in:
@ -1,49 +0,0 @@
|
||||
<form id="deckflow-settings">
|
||||
<h2>Deck Flow Regeln</h2>
|
||||
<label for="board">Board auswählen:</label>
|
||||
<select id="board" onchange="updateStacks()">
|
||||
<option value="">-- Wähle ein Board --</option>
|
||||
<?php foreach ($_['boards'] as $board): ?>
|
||||
<option value="<?php p($board['id']); ?>"><?php p($board['title']); ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
|
||||
<label for="source_stack">Quell-Stapel:</label>
|
||||
<select id="source_stack"></select>
|
||||
|
||||
<label for="target_stack">Ziel-Stapel:</label>
|
||||
<select id="target_stack"></select>
|
||||
|
||||
<button type="button" onclick="addRule()">➕ Hinzufügen</button>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
let stacks = <?php echo json_encode($_['stacks']); ?>;
|
||||
|
||||
function updateStacks() {
|
||||
let boardId = document.getElementById('board').value;
|
||||
let sourceSelect = document.getElementById('source_stack');
|
||||
let targetSelect = document.getElementById('target_stack');
|
||||
sourceSelect.innerHTML = '';
|
||||
targetSelect.innerHTML = '';
|
||||
|
||||
if (stacks[boardId]) {
|
||||
stacks[boardId].forEach(stack => {
|
||||
sourceSelect.add(new Option(stack.title, stack.id));
|
||||
targetSelect.add(new Option(stack.title, stack.id));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function addRule() {
|
||||
let boardId = document.getElementById('board').value;
|
||||
let sourceStack = document.getElementById('source_stack').value;
|
||||
let targetStack = document.getElementById('target_stack').value;
|
||||
|
||||
fetch('/apps/deckflow/settings/addRule', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ board_id: boardId, source_stack: sourceStack, target_stack: targetStack }),
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
}).then(() => location.reload());
|
||||
}
|
||||
</script>
|
19
templates/settings.php
Normal file
19
templates/settings.php
Normal file
@ -0,0 +1,19 @@
|
||||
<h1>Deckflow Settings</h1>
|
||||
<form method="post" action="/settings/deckflow">
|
||||
<label for="deckId">Wählen Sie das Deck:</label>
|
||||
<select name="deckId" id="deckId">
|
||||
<!-- Liste der Decks des Users -->
|
||||
</select>
|
||||
|
||||
<label for="sourceStack">Wählen Sie den Quellstapel:</label>
|
||||
<select name="sourceStack" id="sourceStack">
|
||||
<!-- Quellstapel -->
|
||||
</select>
|
||||
|
||||
<label for="targetStack">Wählen Sie den Zielstapel:</label>
|
||||
<select name="targetStack" id="targetStack">
|
||||
<!-- Zielstapel -->
|
||||
</select>
|
||||
|
||||
<button type="submit">Speichern</button>
|
||||
</form>
|
Reference in New Issue
Block a user