Refactor case size template for improved readability and structure
This commit is contained in:
@@ -50,10 +50,10 @@
|
|||||||
<a class="dropdown-item" href="{% url 'atlas:normals_list' %}"><i class="bi bi-file-earmark-check me-1" aria-hidden="true"></i>Normals</a>
|
<a class="dropdown-item" href="{% url 'atlas:normals_list' %}"><i class="bi bi-file-earmark-check me-1" aria-hidden="true"></i>Normals</a>
|
||||||
</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>
|
<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>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
@@ -113,7 +113,7 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="{% url 'atlas:user_uploads' %}" title="View unimported uploads"><i class="bi bi-upload me-1" aria-hidden="true"></i>Uploads</a>
|
<a class="nav-link" href="{% url 'atlas:user_uploads' %}" title="View unimported uploads"><i class="bi bi-upload me-1" aria-hidden="true"></i>Uploads</a>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -1,43 +1,43 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>Cases by size</h1>
|
<h1>Cases by size</h1>
|
||||||
<form method="get" class="mb-3">
|
<form method="get" class="mb-3">
|
||||||
<label>Min size (bytes): <input type="number" name="min_size" value="{{ min_size }}" /></label>
|
<label>Min size (bytes): <input type="number" name="min_size" value="{{ min_size }}" /></label>
|
||||||
<button class="btn btn-primary btn-sm">Filter</button>
|
<button class="btn btn-primary btn-sm">Filter</button>
|
||||||
</form>
|
</form>
|
||||||
<table class="table table-sm">
|
<table class="table table-sm">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
|
||||||
<th>Case</th>
|
|
||||||
<th>Title</th>
|
|
||||||
<th>Series</th>
|
|
||||||
<th>Images</th>
|
|
||||||
<th>Total Size</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{% for row in page.object_list %}
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="{{ row.case.get_absolute_url }}">{{ row.case.pk }}</a></td>
|
<th>Case</th>
|
||||||
<td>{{ row.case.title }}</td>
|
<th>Title</th>
|
||||||
<td>{{ row.series_count }}</td>
|
<th>Series</th>
|
||||||
<td>{{ row.image_count }}</td>
|
<th>Images</th>
|
||||||
<td>{{ row.human_total }}</td>
|
<th>Total Size</th>
|
||||||
</tr>
|
</tr>
|
||||||
{% empty %}
|
</thead>
|
||||||
<tr><td colspan="5">No cases</td></tr>
|
<tbody>
|
||||||
{% endfor %}
|
{% for row in page.object_list %}
|
||||||
</tbody>
|
<tr>
|
||||||
</table>
|
<td><a href="{{ row.case.get_absolute_url }}">{{ row.case.pk }}</a></td>
|
||||||
<nav>
|
<td>{{ row.case.title }}</td>
|
||||||
<ul class="pagination">
|
<td>{{ row.series_count }}</td>
|
||||||
{% if page.has_previous %}
|
<td>{{ row.image_count }}</td>
|
||||||
<li class="page-item"><a class="page-link" href="?page={{ page.previous_page_number }}&min_size={{ min_size }}">Previous</a></li>
|
<td>{{ row.human_total }}</td>
|
||||||
{% endif %}
|
</tr>
|
||||||
<li class="page-item disabled"><span class="page-link">Page {{ page.number }} / {{ page.paginator.num_pages }}</span></li>
|
{% empty %}
|
||||||
{% if page.has_next %}
|
<tr><td colspan="5">No cases</td></tr>
|
||||||
<li class="page-item"><a class="page-link" href="?page={{ page.next_page_number }}&min_size={{ min_size }}">Next</a></li>
|
{% endfor %}
|
||||||
{% endif %}
|
</tbody>
|
||||||
</ul>
|
</table>
|
||||||
</nav>
|
<nav>
|
||||||
|
<ul class="pagination">
|
||||||
|
{% if page.has_previous %}
|
||||||
|
<li class="page-item"><a class="page-link" href="?page={{ page.previous_page_number }}&min_size={{ min_size }}">Previous</a></li>
|
||||||
|
{% endif %}
|
||||||
|
<li class="page-item disabled"><span class="page-link">Page {{ page.number }} / {{ page.paginator.num_pages }}</span></li>
|
||||||
|
{% if page.has_next %}
|
||||||
|
<li class="page-item"><a class="page-link" href="?page={{ page.next_page_number }}&min_size={{ min_size }}">Next</a></li>
|
||||||
|
{% endif %}
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Reference in New Issue
Block a user