mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
@@ -16,7 +16,17 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% include 'partials/list_search.html' %}
|
||||
<form method="GET" class="ml-auto w-25 d-flex flex-column justify-content-end">
|
||||
{% csrf_token %}
|
||||
<div class="input-group">
|
||||
<input type="search" name="q" placeholder="Search" value="{{ request.GET.q }}"
|
||||
class="form-control" id="id_search_text"/>
|
||||
<span class="input-group-append">{% button 'search' id="id_search" %}</span>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary mt-2 {% if request.GET.is_supervisor %}active{%endif%}" data-toggle="button" aria-pressed="false" name="is_supervisor" value="{% if request.GET.is_supervisor %}{% else %}True{% endif %}">
|
||||
Only Supervisors
|
||||
</button>
|
||||
</form>
|
||||
<div class="row pt-2">
|
||||
<div class="col">
|
||||
<div class="table-responsive">
|
||||
|
||||
@@ -108,6 +108,9 @@ class TraineeList(generic.ListView):
|
||||
# not an integer
|
||||
pass
|
||||
|
||||
if self.request.GET.get('is_supervisor', ''):
|
||||
filt = filt & Q(is_supervisor=True)
|
||||
|
||||
return self.model.objects.filter(filt).annotate(num_qualifications=Count('qualifications_obtained')).order_by('-num_qualifications').prefetch_related('level_qualifications', 'qualifications_obtained', 'qualifications_obtained__item')
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user