and some fixes
This commit is contained in:
@@ -21,6 +21,7 @@ from .models import (
|
|||||||
from django.utils.html import format_html
|
from django.utils.html import format_html
|
||||||
|
|
||||||
from django.utils.safestring import mark_safe
|
from django.utils.safestring import mark_safe
|
||||||
|
from django.template.defaultfilters import filesizeformat
|
||||||
|
|
||||||
from easy_thumbnails.files import get_thumbnailer
|
from easy_thumbnails.files import get_thumbnailer
|
||||||
|
|
||||||
@@ -159,6 +160,11 @@ class CaseTable(SelectionTable):
|
|||||||
return mark_safe(", ".join(links))
|
return mark_safe(", ".join(links))
|
||||||
return "No collections"
|
return "No collections"
|
||||||
|
|
||||||
|
def render_case_size(self, value):
|
||||||
|
if value is None:
|
||||||
|
return "-"
|
||||||
|
return filesizeformat(value)
|
||||||
|
|
||||||
associated_cases = tables.Column(
|
associated_cases = tables.Column(
|
||||||
verbose_name="Associated Cases", accessor="pk", orderable=False
|
verbose_name="Associated Cases", accessor="pk", orderable=False
|
||||||
)
|
)
|
||||||
@@ -167,6 +173,10 @@ class CaseTable(SelectionTable):
|
|||||||
verbose_name="Collections", accessor="pk", orderable=False
|
verbose_name="Collections", accessor="pk", orderable=False
|
||||||
)
|
)
|
||||||
|
|
||||||
|
case_size = tables.Column(
|
||||||
|
verbose_name="Case size", accessor="total_images_series_size"
|
||||||
|
)
|
||||||
|
|
||||||
edit = tables.LinkColumn(
|
edit = tables.LinkColumn(
|
||||||
"atlas:case_update", text="Edit", args=[A("pk")], orderable=False
|
"atlas:case_update", text="Edit", args=[A("pk")], orderable=False
|
||||||
)
|
)
|
||||||
@@ -188,6 +198,7 @@ class CaseTable(SelectionTable):
|
|||||||
"title",
|
"title",
|
||||||
"description",
|
"description",
|
||||||
"created_date",
|
"created_date",
|
||||||
|
"case_size",
|
||||||
"series",
|
"series",
|
||||||
"author",
|
"author",
|
||||||
"associated_cases",
|
"associated_cases",
|
||||||
|
|||||||
@@ -54,6 +54,9 @@
|
|||||||
</li>
|
</li>
|
||||||
{% if request.user.is_staff %}
|
{% if request.user.is_staff %}
|
||||||
<li><hr class="dropdown-divider"></li>
|
<li><hr class="dropdown-divider"></li>
|
||||||
|
<li>
|
||||||
|
<a class="dropdown-item" href="{% url 'atlas:case_admin_overview' %}"><i class="bi bi-speedometer2 me-1" aria-hidden="true"></i>Case Admin Overview</a>
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a class="dropdown-item" href="{% url 'atlas:cases_by_size' %}"><i class="bi bi-hDD-stack me-1" aria-hidden="true"></i>Large cases</a>
|
<a class="dropdown-item" href="{% url 'atlas:cases_by_size' %}"><i class="bi bi-hDD-stack me-1" aria-hidden="true"></i>Large cases</a>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -59,10 +59,14 @@
|
|||||||
{% for row in author_rows %}
|
{% for row in author_rows %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
|
<a href="{% url 'atlas:case_view' %}?author={{ row.pk }}">
|
||||||
{% if row.get_full_name %}{{ row.get_full_name }}{% else %}{{ row.username }}{% endif %}
|
{% if row.get_full_name %}{{ row.get_full_name }}{% else %}{{ row.username }}{% endif %}
|
||||||
|
</a>
|
||||||
<div class="text-muted small">{{ row.username }}</div>
|
<div class="text-muted small">{{ row.username }}</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-end fw-semibold">{{ row.case_count }}</td>
|
<td class="text-end fw-semibold">
|
||||||
|
<a href="{% url 'atlas:case_view' %}?author={{ row.pk }}">{{ row.case_count }}</a>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% empty %}
|
{% empty %}
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -57,7 +57,14 @@
|
|||||||
{% if can_merge %}
|
{% if can_merge %}
|
||||||
<dt class="col-sm-4">Edit relationships</dt>
|
<dt class="col-sm-4">Edit relationships</dt>
|
||||||
<dd class="col-sm-8">
|
<dd class="col-sm-8">
|
||||||
|
<p>
|
||||||
|
<a class="btn btn-sm btn-outline-primary" data-bs-toggle="collapse" href="#relationshipCollapse" role="button" aria-expanded="false" aria-controls="relationshipCollapse">Show relationship editor</a>
|
||||||
|
</p>
|
||||||
|
<div class="collapse" id="relationshipCollapse">
|
||||||
|
<div class="card card-body">
|
||||||
{% include 'atlas/partials/_condition_relationships.html' %}
|
{% include 'atlas/partials/_condition_relationships.html' %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</dd>
|
</dd>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<td class="small">{{ case.created_date|date:"Y-m-d H:i" }}</td>
|
<td class="small">{{ case.created_date|date:"Y-m-d H:i" }}</td>
|
||||||
<td class="small">
|
<td class="small">
|
||||||
{% for author in case.author.all %}
|
{% for author in case.author.all %}
|
||||||
<span class="badge text-bg-secondary me-1">{{ author.username }}</span>
|
<a class="badge text-bg-secondary me-1 text-decoration-none" href="{% url 'atlas:case_view' %}?author={{ author.pk }}">{{ author.username }}</a>
|
||||||
{% empty %}
|
{% empty %}
|
||||||
<span class="text-muted">None</span>
|
<span class="text-muted">None</span>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@@ -844,6 +844,11 @@
|
|||||||
/* small helpers */
|
/* small helpers */
|
||||||
.text-muted { color: var(--muted) !important; }
|
.text-muted { color: var(--muted) !important; }
|
||||||
|
|
||||||
|
#caseSeriesModal .modal-body {
|
||||||
|
max-height: min(72vh, 760px);
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
#series-list li {
|
#series-list li {
|
||||||
}
|
}
|
||||||
#series-list .selected {
|
#series-list .selected {
|
||||||
|
|||||||
Reference in New Issue
Block a user