From 9592568dbb712db511d8247b4f478100a825fda1 Mon Sep 17 00:00:00 2001 From: Ross Date: Thu, 28 May 2026 22:57:42 +0100 Subject: [PATCH] and some fixes --- atlas/tables.py | 11 + atlas/templates/atlas/base.html | 3 + .../templates/atlas/case_admin_overview.html | 198 +++++++++--------- atlas/templates/atlas/condition_detail.html | 9 +- .../partials/_case_admin_recent_cases.html | 2 +- atlas/templates/atlas/user_uploads.html | 5 + 6 files changed, 129 insertions(+), 99 deletions(-) diff --git a/atlas/tables.py b/atlas/tables.py index 0c331b37..01e06eab 100755 --- a/atlas/tables.py +++ b/atlas/tables.py @@ -21,6 +21,7 @@ from .models import ( from django.utils.html import format_html from django.utils.safestring import mark_safe +from django.template.defaultfilters import filesizeformat from easy_thumbnails.files import get_thumbnailer @@ -159,6 +160,11 @@ class CaseTable(SelectionTable): return mark_safe(", ".join(links)) return "No collections" + def render_case_size(self, value): + if value is None: + return "-" + return filesizeformat(value) + associated_cases = tables.Column( verbose_name="Associated Cases", accessor="pk", orderable=False ) @@ -167,6 +173,10 @@ class CaseTable(SelectionTable): verbose_name="Collections", accessor="pk", orderable=False ) + case_size = tables.Column( + verbose_name="Case size", accessor="total_images_series_size" + ) + edit = tables.LinkColumn( "atlas:case_update", text="Edit", args=[A("pk")], orderable=False ) @@ -188,6 +198,7 @@ class CaseTable(SelectionTable): "title", "description", "created_date", + "case_size", "series", "author", "associated_cases", diff --git a/atlas/templates/atlas/base.html b/atlas/templates/atlas/base.html index 046317ba..40c9fef4 100755 --- a/atlas/templates/atlas/base.html +++ b/atlas/templates/atlas/base.html @@ -54,6 +54,9 @@ {% if request.user.is_staff %}
  • +
  • + Case Admin Overview +
  • Large cases
  • diff --git a/atlas/templates/atlas/case_admin_overview.html b/atlas/templates/atlas/case_admin_overview.html index 1eb5cbc3..349ac634 100644 --- a/atlas/templates/atlas/case_admin_overview.html +++ b/atlas/templates/atlas/case_admin_overview.html @@ -1,112 +1,116 @@ {% extends 'atlas/base.html' %} {% block content %} -
    -
    -

    Case Admin Overview

    - Back to case list -
    +
    +
    +

    Case Admin Overview

    + Back to case list +
    -
    -
    -
    -
    -
    Total cases
    -
    {{ totals.total_cases }}
    -
    -
    -
    -
    -
    -
    -
    Authors with cases
    -
    {{ totals.total_authors }}
    -
    -
    -
    -
    -
    -
    -
    Open-access cases
    -
    {{ totals.open_access_cases }}
    -
    -
    -
    -
    -
    -
    -
    Archived cases
    -
    {{ totals.archived_cases }}
    -
    +
    +
    +
    +
    +
    Total cases
    +
    {{ totals.total_cases }}
    - -
    -
    -
    -
    Cases per user
    -
    -
    - - - - - - - - - {% for row in author_rows %} - - - - - {% empty %} - - - - {% endfor %} - -
    UserCase count
    - {% if row.get_full_name %}{{ row.get_full_name }}{% else %}{{ row.username }}{% endif %} -
    {{ row.username }}
    -
    {{ row.case_count }}
    No case authors found.
    -
    -
    +
    +
    +
    +
    Authors with cases
    +
    {{ totals.total_authors }}
    - -
    -
    -
    - Recently added cases - -
    -
    - Click Load to fetch recently added cases. -
    +
    +
    +
    +
    +
    Open-access cases
    +
    {{ totals.open_access_cases }}
    - -
    -
    - Largest cases - -
    -
    - Click Load to fetch the largest cases by image footprint. -
    +
    +
    +
    +
    +
    +
    Archived cases
    +
    {{ totals.archived_cases }}
    + +
    +
    +
    +
    Cases per user
    +
    +
    + + + + + + + + + {% for row in author_rows %} + + + + + {% empty %} + + + + {% endfor %} + +
    UserCase count
    + + {% if row.get_full_name %}{{ row.get_full_name }}{% else %}{{ row.username }}{% endif %} + +
    {{ row.username }}
    +
    + {{ row.case_count }} +
    No case authors found.
    +
    +
    +
    +
    + +
    +
    +
    + Recently added cases + +
    +
    + Click Load to fetch recently added cases. +
    +
    + +
    +
    + Largest cases + +
    +
    + Click Load to fetch the largest cases by image footprint. +
    +
    +
    +
    +
    {% endblock %} diff --git a/atlas/templates/atlas/condition_detail.html b/atlas/templates/atlas/condition_detail.html index 4154fc7d..f37f1f10 100755 --- a/atlas/templates/atlas/condition_detail.html +++ b/atlas/templates/atlas/condition_detail.html @@ -57,7 +57,14 @@ {% if can_merge %}
    Edit relationships
    - {% include 'atlas/partials/_condition_relationships.html' %} +

    + +

    +
    +
    + {% include 'atlas/partials/_condition_relationships.html' %} +
    +
    {% endif %} diff --git a/atlas/templates/atlas/partials/_case_admin_recent_cases.html b/atlas/templates/atlas/partials/_case_admin_recent_cases.html index 8ad8e11f..de1dbccd 100644 --- a/atlas/templates/atlas/partials/_case_admin_recent_cases.html +++ b/atlas/templates/atlas/partials/_case_admin_recent_cases.html @@ -18,7 +18,7 @@ {{ case.created_date|date:"Y-m-d H:i" }} {% for author in case.author.all %} - {{ author.username }} + {{ author.username }} {% empty %} None {% endfor %} diff --git a/atlas/templates/atlas/user_uploads.html b/atlas/templates/atlas/user_uploads.html index b9eb7a3f..242e3540 100644 --- a/atlas/templates/atlas/user_uploads.html +++ b/atlas/templates/atlas/user_uploads.html @@ -844,6 +844,11 @@ /* small helpers */ .text-muted { color: var(--muted) !important; } + #caseSeriesModal .modal-body { + max-height: min(72vh, 760px); + overflow-y: auto; + } + #series-list li { } #series-list .selected {