allow adding markers and authors to exams in collections

This commit is contained in:
Ross
2025-01-06 20:11:57 +00:00
parent 9bb4d8bc08
commit 9d4487b7f5
8 changed files with 162 additions and 4 deletions
@@ -29,6 +29,11 @@
{% endwith %}
<a href="{% url 'anatomy:exam_list_collection' object.pk %}">View exam list</a>
<div class="add-marker">
<button class="btn-sm add-marker-button" hx-get="{% url 'generic:exam_collection_add_marker' object.pk 'anatomy' %}" hx-target=".add-marker" hx-swap="innerHTML">Add marker</button>
</div>
{% endif %}
{% if object.longs_exams.all %}
@@ -37,6 +42,9 @@
{% include "exam_list.html#exam-list" %}
{% endwith %}
<a href="{% url 'longs:exam_list_collection' object.pk %}">View exam list</a>
<div class="add-marker">
<button class="btn-sm add-marker-button" hx-get="{% url 'generic:exam_collection_add_marker' object.pk 'longs' %}" hx-target=".add-marker" hx-swap="innerHTML">Add marker</button>
</div>
{% endif %}
{% if object.rapids_exams.all %}
@@ -45,6 +53,9 @@
{% include "exam_list.html#exam-list" %}
{% endwith %}
<a href="{% url 'rapids:exam_list_collection' object.pk %}">View exam list</a>
<div class="add-marker">
<button class="btn-sm add-marker-button" hx-get="{% url 'generic:exam_collection_add_marker' object.pk 'rapids' %}" hx-target=".add-marker" hx-swap="innerHTML">Add marker</button>
</div>
{% endif %}
{% if object.physics_exams.all %}
@@ -63,11 +74,19 @@
<a href="{% url 'sbas:exam_list_collection' object.pk %}">View exam list</a>
{% endif %}
<br/>
<div id="add-user">
<button hx-get="{% url 'generic:exam_collection_add_author' object.pk %}" hx-target="#add-user" hx-swap="innerHTML">Add author</button>
</div>
{% include 'exam_overview_js.html' %}
{% endblock %}
{% block js %}
{% endblock %}
{% block css %}
<style>
.add-marker-button {
opacity: 0.5;
}
</style>
{% endblock %}
+12
View File
@@ -0,0 +1,12 @@
{% load crispy_forms_tags %}
{{form.media}}
<form action="" method="post" enctype="multipart/form-data" id="marker-form" class="inline-form">
{% csrf_token %}
{{ form|crispy }}
{% comment %} <input type="submit" class="submit-button" value="Submit" name="submit"> {% endcomment %}
<button hx-post="{% url 'generic:exam_collection_add_marker' collection_id exam_type %}" hx-target=".add-marker" hx-swap="innerHTML" class="btn btn-primary">Add marker to exams</button>
</form>
+12
View File
@@ -0,0 +1,12 @@
{% load crispy_forms_tags %}
{{form.media}}
<form action="" method="post" enctype="multipart/form-data" id="user-form" class="inline-form">
{% csrf_token %}
{{ form|crispy }}
{% comment %} <input type="submit" class="submit-button" value="Submit" name="submit"> {% endcomment %}
<button hx-post="{% url 'generic:exam_collection_add_author' collection_id %}" hx-target="#add-user" hx-swap="innerHTML" class="btn btn-primary">Submit</button>
</form>