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 %}">
|
<div class="atlas {% if case.scrapped %}atlas-scrapped{% endif %}">
|
||||||
<h2>Case: {{ case.title }}</h2>
|
<h2>Case: {{ case.title }}</h2>
|
||||||
{% if case.previous_case or case.next_case %}
|
{% if case.previous_case or case.next_case %}
|
||||||
@@ -120,27 +141,12 @@
|
|||||||
|
|
||||||
<div class="pre-whitespace multi-image-block"><b>Series:</b>
|
<div class="pre-whitespace multi-image-block"><b>Series:</b>
|
||||||
<form>
|
<form>
|
||||||
{% for series in case.series.all %}
|
{% partial case-series %}
|
||||||
<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 %}
|
|
||||||
</form>
|
</form>
|
||||||
<span>
|
<span>
|
||||||
<a href="{% url 'atlas:series_id_create' pk=case.pk %}">Add new series</a><br />
|
<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 />
|
<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>
|
<summary>+</summary>
|
||||||
<button hx-get="{% url 'atlas:case_order_dicom' pk=case.pk %}"
|
<button hx-get="{% url 'atlas:case_order_dicom' pk=case.pk %}"
|
||||||
title="order dicom by slice location"
|
title="order dicom by slice location"
|
||||||
@@ -186,7 +192,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
<div>
|
<div>
|
||||||
<details>
|
<details open>
|
||||||
<summary><b>Findings</b></summary>
|
<summary><b>Findings</b></summary>
|
||||||
{% if case.series.all %}
|
{% if case.series.all %}
|
||||||
{% for series in case.series.all %}
|
{% for series in case.series.all %}
|
||||||
@@ -202,6 +208,13 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if finding.conditions.all %}
|
||||||
|
<span>
|
||||||
|
Conditions: {% for c in finding.conditions.all %}
|
||||||
|
{{c.get_link}},
|
||||||
|
{% endfor %}
|
||||||
|
</span>
|
||||||
|
{% endif %}
|
||||||
{% if finding.structures.all %}
|
{% if finding.structures.all %}
|
||||||
<span>
|
<span>
|
||||||
Structure: {% for s in finding.structures.all %}
|
Structure: {% for s in finding.structures.all %}
|
||||||
@@ -298,3 +311,24 @@
|
|||||||
|
|
||||||
|
|
||||||
<p><b>Case size:</b> {{ case.get_total_series_images_size | filesizeformat }}</p>
|
<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 -->
|
<!-- filepath: /home/ross/rad/rad/atlas/templates/atlas/linked_cases_overview.html -->
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% load partials %}
|
||||||
|
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>Linked Cases Overview</h1>
|
<h1>Linked Cases Overview</h1>
|
||||||
<h2>Current Case: {{ case.title }}</h2>
|
<h2>Current Case: {{ current_case.title }}</h2>
|
||||||
|
|
||||||
<h3>Previous Cases</h3>
|
<h3>Previous Cases</h3>
|
||||||
{% if previous_cases %}
|
{% if previous_cases %}
|
||||||
<ul>
|
<ul>
|
||||||
{% for prev_case in previous_cases %}
|
{% for case in previous_cases %}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ prev_case.get_absolute_url }}">{{ prev_case.title }}</a>
|
<a href="{{ prev_case.get_absolute_url }}">{{ case.title }}</a>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
{% partial case-series %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
{% else %}
|
{% else %}
|
||||||
@@ -21,10 +26,11 @@
|
|||||||
<h3>Next Cases</h3>
|
<h3>Next Cases</h3>
|
||||||
{% if next_cases %}
|
{% if next_cases %}
|
||||||
<ul>
|
<ul>
|
||||||
{% for next_case in next_cases %}
|
{% for case in next_cases %}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ next_case.get_absolute_url }}">{{ next_case.title }}</a>
|
<a href="{{ next_case.get_absolute_url }}">{{ case.title }}</a>
|
||||||
</li>
|
</li>
|
||||||
|
{% include "atlas/case_display_block.html#case-series" %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|||||||
+1
-1
@@ -3094,7 +3094,7 @@ def linked_cases_overview(request, case_id):
|
|||||||
request,
|
request,
|
||||||
"atlas/linked_cases_overview.html",
|
"atlas/linked_cases_overview.html",
|
||||||
{
|
{
|
||||||
"case": case,
|
"current_case": case,
|
||||||
"previous_cases": previous_cases,
|
"previous_cases": previous_cases,
|
||||||
"next_cases": next_cases,
|
"next_cases": next_cases,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user