2021-05-17 16:27:27 -04:00
|
|
|
{% extends 'base/layout.html' %}
|
2017-03-29 16:45:25 -04:00
|
|
|
{% load helpers %}
|
2017-03-29 12:04:57 -04:00
|
|
|
{% load form_helpers %}
|
|
|
|
|
2017-03-29 16:05:23 -04:00
|
|
|
{% block title %}Search{% endblock %}
|
|
|
|
|
2017-03-29 12:04:57 -04:00
|
|
|
{% block content %}
|
|
|
|
{% if request.GET.q %}
|
2017-03-29 14:22:27 -04:00
|
|
|
{% if results %}
|
|
|
|
<div class="row">
|
2021-04-30 15:55:37 -07:00
|
|
|
<div class="col col-md-9">
|
2017-03-29 14:22:27 -04:00
|
|
|
{% for obj_type in results %}
|
2017-03-29 16:45:25 -04:00
|
|
|
<h3 id="{{ obj_type.name|lower }}">{{ obj_type.name|bettertitle }}</h3>
|
2021-05-17 16:27:27 -04:00
|
|
|
{% include 'inc/panel_table.html' with table=obj_type.table %}
|
2021-04-18 00:22:52 -07:00
|
|
|
<a href="{{ obj_type.url }}" class="btn btn-primary float-end my-3">
|
2021-04-20 12:45:39 -07:00
|
|
|
<i class="mdi mdi-arrow-right-bold" aria-hidden="true"></i>
|
2017-12-20 14:09:52 -05:00
|
|
|
{% if obj_type.table.page.has_next %}
|
2021-04-18 00:22:52 -07:00
|
|
|
See All {{ obj_type.table.page.paginator.count }} Results
|
2017-12-20 14:09:52 -05:00
|
|
|
{% else %}
|
2021-04-18 00:22:52 -07:00
|
|
|
Refine Search
|
2017-12-20 14:09:52 -05:00
|
|
|
{% endif %}
|
|
|
|
</a>
|
2017-03-29 14:22:27 -04:00
|
|
|
{% endfor %}
|
|
|
|
</div>
|
2021-04-30 15:55:37 -07:00
|
|
|
<div class="col col-md-3">
|
2021-04-18 00:22:52 -07:00
|
|
|
<h3 class="invisible"> </h3>
|
|
|
|
<div class="card">
|
|
|
|
<h5 class="card-header">
|
|
|
|
Search Results
|
|
|
|
</h5>
|
|
|
|
<div class="card-body">
|
|
|
|
<div class="list-group list-group-flush">
|
|
|
|
{% for obj_type in results %}
|
|
|
|
<a href="#{{ obj_type.name|lower }}" class="list-group-item">
|
|
|
|
{{ obj_type.name|bettertitle }}
|
|
|
|
<span class="badge bg-primary">{{ obj_type.table.page.paginator.count }}</span>
|
|
|
|
</a>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
2017-03-29 12:04:57 -04:00
|
|
|
</div>
|
2017-03-29 16:05:23 -04:00
|
|
|
</div>
|
2017-03-29 14:22:27 -04:00
|
|
|
</div>
|
2017-03-29 12:04:57 -04:00
|
|
|
</div>
|
2017-03-29 14:22:27 -04:00
|
|
|
{% else %}
|
|
|
|
<h3 class="text-muted text-center">No results found</h3>
|
|
|
|
{% endif %}
|
2017-03-29 12:04:57 -04:00
|
|
|
{% else %}
|
2021-04-18 00:22:52 -07:00
|
|
|
<div class="row">
|
2021-04-30 15:55:37 -07:00
|
|
|
<div class="col-4 offset-4">
|
2017-03-29 12:04:57 -04:00
|
|
|
<form action="{% url 'search' %}" method="get" class="form form-horizontal">
|
2021-04-18 00:22:52 -07:00
|
|
|
<div class="card">
|
|
|
|
<h5 class="card-header">
|
|
|
|
Search
|
|
|
|
</h5>
|
|
|
|
<div class="card-body">
|
2017-03-29 12:04:57 -04:00
|
|
|
{% render_form form %}
|
|
|
|
</div>
|
2021-04-18 00:22:52 -07:00
|
|
|
<div class="card-footer text-end">
|
2017-03-29 12:04:57 -04:00
|
|
|
<button type="submit" class="btn btn-primary">
|
2020-11-06 14:33:20 -05:00
|
|
|
<span class="mdi mdi-magnify" aria-hidden="true"></span> Search
|
2017-03-29 12:04:57 -04:00
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2021-05-17 16:27:27 -04:00
|
|
|
{% endblock content %}
|