move case block to a partial
This commit is contained in:
@@ -1,3 +1,24 @@
|
||||
{% load partials %}
|
||||
|
||||
{% partialdef case-series %}
|
||||
{% for series in case.series.all %}
|
||||
<span class="series-block">
|
||||
<span>
|
||||
<span class="series-block-series-number">Series {{ forloop.counter }}:</span><br>
|
||||
<a href="{% url 'atlas:series_detail' pk=series.pk %}">
|
||||
{{series.get_block}}
|
||||
</a>
|
||||
<br>
|
||||
<input type="checkbox" name="series-ids" value="{{series.pk}}">
|
||||
<span class="series-block-popup-link">
|
||||
<a href="#"
|
||||
onclick="return window.create_popup_window('/atlas/series/{{series.pk}}', 'Series')">Popup</a>
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
{% endfor %}
|
||||
{% endpartialdef %}
|
||||
|
||||
<div class="atlas {% if case.scrapped %}atlas-scrapped{% endif %}">
|
||||
<h2>Case: {{ case.title }}</h2>
|
||||
{% if case.previous_case or case.next_case %}
|
||||
@@ -120,27 +141,12 @@
|
||||
|
||||
<div class="pre-whitespace multi-image-block"><b>Series:</b>
|
||||
<form>
|
||||
{% for series in case.series.all %}
|
||||
<span class="series-block">
|
||||
<span>
|
||||
<span class="series-block-series-number">Series {{ forloop.counter }}:</span><br>
|
||||
<a href="{% url 'atlas:series_detail' pk=series.pk %}">
|
||||
{{series.get_block}}
|
||||
</a>
|
||||
<br>
|
||||
<input type="checkbox" name="series-ids" value="{{series.pk}}">
|
||||
<span class="series-block-popup-link">
|
||||
<a href="#"
|
||||
onclick="return window.create_popup_window('/atlas/series/{{series.pk}}', 'Series')">Popup</a>
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
{% endfor %}
|
||||
{% partial case-series %}
|
||||
</form>
|
||||
<span>
|
||||
<a href="{% url 'atlas:series_id_create' pk=case.pk %}">Add new series</a><br />
|
||||
<a href="{% url 'atlas:user_uploads_case' case_id=case.pk %}">Import new uploads</a><br />
|
||||
<details>
|
||||
<details class="series-actions" id="series-actions">
|
||||
<summary>+</summary>
|
||||
<button hx-get="{% url 'atlas:case_order_dicom' pk=case.pk %}"
|
||||
title="order dicom by slice location"
|
||||
@@ -186,7 +192,7 @@
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<div>
|
||||
<details>
|
||||
<details open>
|
||||
<summary><b>Findings</b></summary>
|
||||
{% if case.series.all %}
|
||||
{% for series in case.series.all %}
|
||||
@@ -202,6 +208,13 @@
|
||||
{% endfor %}
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if finding.conditions.all %}
|
||||
<span>
|
||||
Conditions: {% for c in finding.conditions.all %}
|
||||
{{c.get_link}},
|
||||
{% endfor %}
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if finding.structures.all %}
|
||||
<span>
|
||||
Structure: {% for s in finding.structures.all %}
|
||||
@@ -298,3 +311,24 @@
|
||||
|
||||
|
||||
<p><b>Case size:</b> {{ case.get_total_series_images_size | filesizeformat }}</p>
|
||||
|
||||
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const detailsElement = document.getElementById("series-actions");
|
||||
const checkboxes = document.querySelectorAll("input[name='series-ids']");
|
||||
|
||||
function toggleCheckboxes() {
|
||||
const isOpen = detailsElement.hasAttribute("open");
|
||||
checkboxes.forEach(checkbox => {
|
||||
checkbox.style.display = isOpen ? "inline-block" : "none";
|
||||
});
|
||||
}
|
||||
|
||||
// Initial state
|
||||
toggleCheckboxes();
|
||||
|
||||
// Listen for toggle events on the <details> element
|
||||
detailsElement.addEventListener("toggle", toggleCheckboxes);
|
||||
});
|
||||
</script>
|
||||
@@ -1,17 +1,22 @@
|
||||
<!-- filepath: /home/ross/rad/rad/atlas/templates/atlas/linked_cases_overview.html -->
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% load partials %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
<h1>Linked Cases Overview</h1>
|
||||
<h2>Current Case: {{ case.title }}</h2>
|
||||
<h2>Current Case: {{ current_case.title }}</h2>
|
||||
|
||||
<h3>Previous Cases</h3>
|
||||
{% if previous_cases %}
|
||||
<ul>
|
||||
{% for prev_case in previous_cases %}
|
||||
{% for case in previous_cases %}
|
||||
<li>
|
||||
<a href="{{ prev_case.get_absolute_url }}">{{ prev_case.title }}</a>
|
||||
<a href="{{ prev_case.get_absolute_url }}">{{ case.title }}</a>
|
||||
|
||||
</li>
|
||||
{% partial case-series %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
@@ -21,10 +26,11 @@
|
||||
<h3>Next Cases</h3>
|
||||
{% if next_cases %}
|
||||
<ul>
|
||||
{% for next_case in next_cases %}
|
||||
{% for case in next_cases %}
|
||||
<li>
|
||||
<a href="{{ next_case.get_absolute_url }}">{{ next_case.title }}</a>
|
||||
<a href="{{ next_case.get_absolute_url }}">{{ case.title }}</a>
|
||||
</li>
|
||||
{% include "atlas/case_display_block.html#case-series" %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
|
||||
+1
-1
@@ -3094,7 +3094,7 @@ def linked_cases_overview(request, case_id):
|
||||
request,
|
||||
"atlas/linked_cases_overview.html",
|
||||
{
|
||||
"case": case,
|
||||
"current_case": case,
|
||||
"previous_cases": previous_cases,
|
||||
"next_cases": next_cases,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user