mirror of
https://github.com/tanrax/django-interactive-frameworks-benchmark
synced 2026-01-09 06:43:37 +01:00
Real-time alert system using Django LiveView with WebSocket support. Features include: - Real-time alert creation, viewing, and deletion - Broadcast notifications to all connected users - SQLite database - Stimulus.js integration for interactive UI - Modal dialogs for alert details - Alert form with validation Fixed Stimulus controller scope issue by placing data-controller on html element.
50 lines
1.9 KiB
HTML
50 lines
1.9 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block content %}
|
|
<section class="section">
|
|
<div class="container">
|
|
<h1 class="title">New Alert</h1>
|
|
<h2 class="subtitle">Create a new alert</h2>
|
|
|
|
<div class="box">
|
|
<form data-liveview-function="submit_new_alert" data-action="submit->page#run">
|
|
<div class="field">
|
|
<label class="label">Alert Type</label>
|
|
<div class="control">
|
|
<div class="select is-fullwidth">
|
|
{{ form.type }}
|
|
</div>
|
|
</div>
|
|
{% if form.type.errors %}
|
|
{% for error in form.type.errors %}
|
|
<p class="help is-danger">{{ error }}</p>
|
|
{% endfor %}
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="field">
|
|
<label class="label">Description</label>
|
|
<div class="control">
|
|
{{ form.description }}
|
|
</div>
|
|
{% if form.description.errors %}
|
|
{% for error in form.description.errors %}
|
|
<p class="help is-danger">{{ error }}</p>
|
|
{% endfor %}
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="field is-grouped">
|
|
<div class="control">
|
|
<button type="submit" class="button is-primary">Create Alert</button>
|
|
</div>
|
|
<div class="control">
|
|
<button type="button" class="button is-light" data-liveview-function="go_home" data-action="click->page#run">Cancel</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
{% endblock %}
|