1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

69 lines
2.9 KiB
HTML
Raw Normal View History

{% 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 %}
{% 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>
{% 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>
{% if obj_type.table.page.has_next %}
2021-04-18 00:22:52 -07:00
See All {{ obj_type.table.page.paginator.count }} Results
{% else %}
2021-04-18 00:22:52 -07:00
Refine Search
{% 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">&nbsp;</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>
</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">
<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 %}
{% endblock content %}