Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/staff/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,8 @@ class Meta:


class NewUnseenOrderTable(StaffIDMixinTable):
sticky_header = True

seen = tables.TemplateColumn(
verbose_name="",
orderable=False,
Expand Down Expand Up @@ -619,6 +621,8 @@ class Meta:


class NewSeenOrderTable(StaffIDMixinTable):
sticky_header = True

priority = tables.TemplateColumn(
orderable=False,
verbose_name="Priority",
Expand Down Expand Up @@ -668,6 +672,8 @@ class Meta:


class AssignedOrderTable(StatusMixinTable, StaffIDMixinTable):
sticky_header = True

priority = tables.TemplateColumn(
orderable=False,
verbose_name="Priority",
Expand Down Expand Up @@ -699,6 +705,8 @@ class Meta:


class DraftOrderTable(StaffIDMixinTable):
sticky_header = True

priority = tables.TemplateColumn(
orderable=False,
verbose_name="Priority",
Expand Down
4 changes: 3 additions & 1 deletion src/staff/templates/staff/components/order_table.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@

<div class="rounded-md border bg-white p-4">
<h4 class="text-2xl mb-4">{{ title }} ({{ count }})</h4>
{% render_table table %}
<div class="relative overflow-y-scroll{% if table.sticky_header %} max-h-96{% endif %}">
{% render_table table %}
</div>
</div>
39 changes: 19 additions & 20 deletions src/templates/django_tables2/header.html
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
<thead {{ table.attrs.thead.as_html }}>
<tr>
<thead class="{% if table.sticky_header %}sticky top-0{% endif %}" {{ table.attrs.thead.as_html }}>
<tr>
{% for column in table.columns %}
<th {{ column.attrs.th.as_html }}>
{% if column.orderable %}
<a href="?{{ column.ext.next }}"
class="inline-flex items-center gap-1">
{{ column.header }}
{% if column.is_ordered %}
{% if "-" in column.order_by_alias %}
<i class="fa-solid fa-sort-down text-gray-500"></i>
{% else %}
<i class="fa-solid fa-sort-up text-gray-500"></i>
{% endif %}
{% else %}
<i class="fa-solid fa-sort text-gray-400 hover:text-black"></i>
{% endif %}
</a>
<th {{ column.attrs.th.as_html }}>
{% if column.orderable %}
<a href="?{{ column.ext.next }}" class="inline-flex items-center gap-1">
{{ column.header }}
{% if column.is_ordered %}
{% if '-' in column.order_by_alias %}
<i class="fa-solid fa-sort-down text-gray-500"></i>
{% else %}
<i class="fa-solid fa-sort-up text-gray-500"></i>
{% endif %}
{% else %}
{{ column.header }}
<i class="fa-solid fa-sort text-gray-400 hover:text-black"></i>
{% endif %}
</th>
</a>
{% else %}
{{ column.header }}
{% endif %}
</th>
{% endfor %}
</tr>
</tr>
</thead>