example-in-django-waiting-r.../waiting_room/templates/index.html

25 lines
603 B
HTML
Raw Normal View History

2024-11-05 16:52:47 +01:00
{% extends 'base.html' %}
{% block title %}Run task{% endblock %}
{% block content %}
<h1>Index</h1>
<section
2024-11-07 08:17:10 +01:00
id="form-start-task"
2024-11-05 16:52:47 +01:00
hx-ext="ws"
>
<form id="form" ws-send>
<input type="submit" name="task" value="calculate">
</form>
</section>
2024-11-07 08:17:10 +01:00
<script>
document.querySelector('#form-start-task').setAttribute('ws-connect', '/ws/' + localStorage.getItem('userId') + '/');
</script>
2024-11-05 16:52:47 +01:00
<section>
{% if result %}
<h2>The result is {{ result }}</h2>
{% endif %}
</section>
<a href="{% url 'waiting_room:about_us' %}">Go to about us</a>
{% endblock %}