tidy up some cimar stuff

This commit is contained in:
Ross
2025-03-24 10:19:43 +00:00
parent e27d45f3c5
commit bcc449eb34
4 changed files with 40 additions and 11 deletions
+7
View File
@@ -161,6 +161,13 @@
<div class="row clear-both">
<div class="col-md-12">
<div id="htmx-error"></div>
<span
id="cimar-login-needed"
hx-get='{% url "cimar_status" %}'
hx-trigger="cimar-login-needed from:body"
>
</span>
{% block content %}
{% endblock %}
</div>
+23 -9
View File
@@ -1,14 +1,9 @@
{% extends 'base.html' %}
{% load partials %}
{% block content %}
<div class="anatomy">
<h2>CIMAR login</h2>
Login status: {{ login_status }} ({{cimar_sid}})<br/>
{% partialdef login-block %}
Logging in here allows your account to be linked with CIMAR. You may periodically need to re-login to keep the link active.
<form method="POST" class="post-form">
<form method="POST" class="post-form" id="cimar-login-form">
Username: <input type="text" id="username" name="username" value=""/> <br/>
Password: <input type="password" id="password" name="password" value=""/> <br/>
<button hx-post='{% url "cimar_login" %}'
@@ -16,8 +11,27 @@ hx-target="#results">Login</button>
</form>
<div id="results"></div>
{% endpartialdef %}
{% block content %}
<div class="anatomy">
<h2>CIMAR login</h2>
Login status: {{ login_status }} ({{cimar_sid}})
{% if login_status %}
<button
class="button btn-sm"
hx-get="{% url 'cimar_logout' %}"
hx-swap="outerHTML"
>Logout</button>
{% endif %}
<br/>
{% partial login-block %}
</div>
{% endblock %}