Add toast notification system
Django CI/CD / test (push) Successful in 35s
Django CI/CD / build-and-push (push) Successful in 54s

Add more toast types
This commit is contained in:
2026-05-11 13:22:42 +02:00
parent 4e3b0ddb08
commit f82c61ef1e
18 changed files with 1026 additions and 109 deletions
+10 -1
View File
@@ -94,7 +94,16 @@
<script>
function createPlayEvent() {
this.played++;
fetch('{% url 'api-1.0.0:create_playevent' %}', { method: 'POST', headers: { 'X-CSRFToken': '{{ csrf_token }}' }, body: '{"game_id": {{ game.id }}}'})
// TODO: migrate to hx-post + hx-on::after-request for HTMX-native toast handling
fetchWithHtmxTriggers('{% url 'api-1.0.0:create_playevent' %}', {
method: 'POST',
headers: { 'X-CSRFToken': '{{ csrf_token }}', 'Content-Type': 'application/json' },
body: '{"game_id": {{ game.id }}}'
})
.catch(() => {
this.played--;
console.error('Failed to record play');
});
}
</script>
</ul>