106 lines
4.6 KiB
HTML
106 lines
4.6 KiB
HTML
|
|
{% extends app_name|add:'/base.html' %}
|
|
|
|
{% load crispy_forms_tags %}
|
|
{% load render_table from django_tables2 %}
|
|
{% block css %}
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
|
|
<div class="row mb-3">
|
|
<div class="col-12">
|
|
<div class="d-flex justify-content-between mb-2 align-items-center flex-column flex-md-row">
|
|
<div class="mb-2 mb-md-0">
|
|
<div class="btn-toolbar" role="toolbar">
|
|
<div class="btn-group me-2" role="group">
|
|
<button id="delete-selected-btn" class="btn btn-danger btn-sm"
|
|
hx-post="{% url 'generic:bulk_delete_questions' %}"
|
|
hx-include="[name='selection']:checked"
|
|
hx-vals='{"app":"{{ app_name|escapejs }}"}'
|
|
hx-target="#action-result"
|
|
hx-swap="innerHTML"
|
|
hx-confirm="Are you sure you want to delete the selected questions? This action cannot be undone.">Delete selected</button>
|
|
</div>
|
|
<div class="btn-group" role="group">
|
|
<button id="button-select-add-exam" class="btn btn-outline-primary btn-sm"
|
|
data-exam_json_edit_url="{% url 'generic:generic_exam_json_edit' %}"
|
|
data-exam_list_url="{% url 'api-1:'|add:app_name|add:'_user_exams' %}"
|
|
data-type={{app_name}} data-csrf="{{ csrf_token }}">Add to exam</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="action-result" class="mt-2 mt-md-0"></div>
|
|
</div>
|
|
|
|
<div class="table-responsive">
|
|
{% render_table table %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Floating filter bar (fixed at bottom) -->
|
|
<style>
|
|
.floating-filter {
|
|
position: fixed;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
z-index: 1030;
|
|
background: var(--bs-body-bg);
|
|
border-top: 1px solid rgba(0,0,0,0.12);
|
|
padding: 0.5rem 0.75rem;
|
|
}
|
|
.floating-filter .filter-body {
|
|
max-height: 50vh;
|
|
overflow-y: auto;
|
|
}
|
|
.floating-filter .filter-toggle {
|
|
position: fixed;
|
|
right: 1rem;
|
|
bottom: 1rem;
|
|
z-index: 1040;
|
|
}
|
|
/* minibar/tab styling - small visible handle so panel isn't fully hidden */
|
|
.bottom-filter-minibar {
|
|
position: fixed;
|
|
right: 1rem;
|
|
bottom: 1rem;
|
|
z-index: 1045;
|
|
background: transparent;
|
|
}
|
|
.bottom-filter-minibar .btn { box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
|
|
</style>
|
|
|
|
<!-- Minibar: small visible strip when panel is collapsed -->
|
|
<div id="bottom-filter-minibar" class="bottom-filter-minibar">
|
|
<button class="btn btn-sm btn-outline-primary" type="button" data-bs-toggle="collapse" data-bs-target="#bottom-filter-body" aria-controls="bottom-filter-body">Filters</button>
|
|
</div>
|
|
|
|
<button class="btn btn-primary filter-toggle d-md-none" type="button" data-bs-toggle="collapse" data-bs-target="#bottom-filter-body" aria-expanded="false" aria-controls="bottom-filter-body">Filters</button>
|
|
|
|
<div class="floating-filter shadow-lg">
|
|
<div id="bottom-filter-body" class="collapse show">
|
|
<div class="container-fluid">
|
|
<div class="d-flex justify-content-between align-items-start">
|
|
<div class="fw-bold">Filters</div>
|
|
<div>
|
|
<button class="btn btn-sm btn-outline-secondary" type="button" data-bs-toggle="collapse" data-bs-target="#bottom-filter-body" aria-expanded="true">Close</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- filter body collapsible so minibar stays visible -->
|
|
<div class="filter-body mt-2">
|
|
<form action="" method="get">
|
|
{{ filter.form|crispy }}
|
|
<div class="mt-2">
|
|
<button class="btn btn-primary btn-sm" type="submit">Apply</button>
|
|
<a class="btn btn-secondary btn-sm" href="?">Reset</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{% endblock %} |