include archived

This commit is contained in:
2026-07-11 23:11:19 -07:00
parent 576ae85ef0
commit 997e51e944
4 changed files with 92 additions and 26 deletions

View File

@@ -1,27 +1,30 @@
{% if total_pages > 1 %}
{% set page_args = {'per_page': per_page} %}
{% if include_archived %}{% set _ = page_args.update({'include_archived': '1'}) %}{% endif %}
{% if case_email %}{% set _ = page_args.update({'case_email': case_email}) %}{% endif %}
<div class="flex justify-center items-center mt-6 space-x-2">
{% if current_page > 1 %}
<a href="{{ url_for(request.endpoint, page=current_page - 1, per_page=per_page) }}" class="px-3 py-2 text-sm text-slate-600 bg-white border border-slate-300 rounded-md hover:bg-slate-50">
<a href="{{ url_for(request.endpoint, page=current_page - 1, **page_args) }}" class="px-3 py-2 text-sm text-slate-600 bg-white border border-slate-300 rounded-md hover:bg-slate-50">
Previous
</a>
{% else %}
<span class="px-3 py-2 text-sm text-slate-400 bg-white border border-slate-300 rounded-md cursor-not-allowed">Previous</span>
{% endif %}
{% for page in range(1, total_pages + 1) %}
{% if page == current_page %}
<span class="px-3 py-2 text-sm font-medium text-white bg-blue-600 border border-blue-600 rounded-md">{{ page }}</span>
{% elif page == 1 or page == total_pages or (page >= current_page - 2 and page <= current_page + 2) %}
<a href="{{ url_for(request.endpoint, page=page, per_page=per_page) }}" class="px-3 py-2 text-sm text-slate-600 bg-white border border-slate-300 rounded-md hover:bg-slate-50">
<a href="{{ url_for(request.endpoint, page=page, **page_args) }}" class="px-3 py-2 text-sm text-slate-600 bg-white border border-slate-300 rounded-md hover:bg-slate-50">
{{ page }}
</a>
{% elif page == current_page - 3 or page == current_page + 3 %}
<span class="px-3 py-2 text-sm text-slate-400">...</span>
{% endif %}
{% endfor %}
{% if current_page < total_pages %}
<a href="{{ url_for(request.endpoint, page=current_page + 1, per_page=per_page) }}" class="px-3 py-2 text-sm text-slate-600 bg-white border border-slate-300 rounded-md hover:bg-slate-50">
<a href="{{ url_for(request.endpoint, page=current_page + 1, **page_args) }}" class="px-3 py-2 text-sm text-slate-600 bg-white border border-slate-300 rounded-md hover:bg-slate-50">
Next
</a>
{% else %}

View File

@@ -26,7 +26,7 @@
<div class="mb-4 flex w-[400px]">
<label for="simulateCaseEmail" class=" text-sm font-medium text-slate-700 mb-1">Simulate case email:</label>
<input type="text" id="simulateCaseEmail" x-model="case_email_sim"
@keyup.debounce.1000ms="window.location.href=`/dashboard/1?case_email=${encodeURIComponent($data.case_email_sim)}`"
@keyup.debounce.1000ms="window.location.href=`/dashboard/1?per_page=${$data.perPage}&include_archived=${$data.includeArchived ? '1' : '0'}&case_email=${encodeURIComponent($data.case_email_sim)}`"
class="w-full px-3 py-2 border w-64 border-slate-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
placeholder="Enter case email to simulate">
</div>
@@ -35,9 +35,19 @@
{% endif %}
<div class="flex gap-2 items-center">
<!-- Include Archived Toggle -->
<div class="mb-4 flex items-center">
<label class="flex items-center cursor-pointer text-sm font-medium text-slate-700">
<input type="checkbox" x-model="includeArchived"
@change="window.location.href = `/dashboard/1?per_page=${$data.perPage}&include_archived=${$data.includeArchived ? '1' : '0'}${$data.case_email_sim ? '&case_email=' + encodeURIComponent($data.case_email_sim) : ''}`"
class="mr-2 h-4 w-4 text-blue-600 border-slate-300 rounded focus:ring-blue-500">
Include archived
</label>
</div>
<!-- Export Button -->
<div class="mb-4">
<a href="{{ url_for('dashboard_export_xls') }}" class="inline-flex items-center px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
<a :href="`{{ url_for('dashboard_export_xls') }}?include_archived=${$data.includeArchived ? '1' : '0'}${$data.case_email_sim ? '&case_email=' + encodeURIComponent($data.case_email_sim) : ''}`" class="inline-flex items-center px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
<svg class="mr-2 -ml-1 h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"></path>
</svg>
@@ -48,7 +58,7 @@
<!-- Per Page Dropdown -->
<div class="mb-4 flex items-center">
<label for="perPage" class="mr-2 text-sm font-medium text-slate-700">Items per page:</label>
<select id="perPage" x-model="perPage" @change="window.location.href = `/dashboard/1?per_page=${$data.perPage}${$data.case_email_sim ? '&case_email=' + encodeURIComponent($data.case_email_sim) : ''}`"
<select id="perPage" x-model="perPage" @change="window.location.href = `/dashboard/1?per_page=${$data.perPage}&include_archived=${$data.includeArchived ? '1' : '0'}${$data.case_email_sim ? '&case_email=' + encodeURIComponent($data.case_email_sim) : ''}`"
class="px-3 py-2 border border-slate-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
<option value="10">10</option>
<option value="25">25</option>
@@ -571,6 +581,7 @@
showColumnModal: false,
case_email_sim: '',
perPage: 25,
includeArchived: false,
columns: [
'Matter Num',
'Matter Description',
@@ -639,6 +650,7 @@
if (perPage) {
this.perPage = parseInt(perPage);
}
this.includeArchived = urlParams.get('include_archived') === '1';
},
isColumnVisible(columnName) {