Refactor collection view: create a new template for collections with improved layout and staff action visibility

This commit is contained in:
Ross
2025-11-17 22:47:15 +00:00
parent 2f1e2f6abe
commit fb833a2b90
3 changed files with 91 additions and 3 deletions
@@ -0,0 +1,22 @@
{% extends 'atlas/base.html' %}
{% load render_table from django_tables2 %}
{% block content %}
<div class="container-fluid">
<div class="d-flex align-items-start justify-content-between mb-3">
<h2 class="mb-0">Collections</h2>
{% if request.user.is_staff %}
<a class="btn btn-sm btn-primary" href="{% url 'atlas:exam_create' %}">Create collection</a>
{% endif %}
</div>
<p class="mb-3">Manage and browse case collections. Use filters to narrow results.</p>
{% render_table table %}
{% include "generic/partials/filter_bar.html" with filter=filter app_name=app_name collapse_id="bottom-filter-body" %}
</div>
{% endblock %}
+8 -2
View File
@@ -7,7 +7,14 @@
{% block content %}
<div class="container-fluid">
<h2>My Collections</h2>
<div class="d-flex align-items-start justify-content-between">
<h2 class="mb-0">{{ model_verbose_name_plural|capfirst }}</h2>
{% if request.user.is_staff and create_url %}
<div>
<a class="btn btn-sm btn-primary" href="{{ create_url }}">Add new {{ model_verbose_name }}</a>
</div>
{% endif %}
</div>
{% comment %} <details>
<summary>
<h4>Filter</h4>
@@ -19,7 +26,6 @@
</form>
</div>
</details> {% endcomment %}
View my <a href='{% url "atlas:case_view" %}?author={{request.user.id}}'>cases</a>.
{% render_table table %}
{% include "generic/partials/filter_bar.html" with filter=filter app_name=app_name collapse_id="bottom-filter-body" %}
</div>