mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
805892f623
* Clean up & comment base templates * Clean up login template & form * Use SVG file for NetBox logo * Simplify breadcrumbs * Merge changelog.html into home.html * Rename title_container block to header * Move breadcrumbs block to object.html * Attach names to endblock template tags * Reorganize root-level templates into base/ and inc/ * Remove obsolete reference to Bootstrap 3.4.1
69 lines
2.9 KiB
HTML
69 lines
2.9 KiB
HTML
{% extends 'base/layout.html' %}
|
|
{% load helpers %}
|
|
{% load form_helpers %}
|
|
|
|
{% block title %}Search{% endblock %}
|
|
|
|
{% block content %}
|
|
{% if request.GET.q %}
|
|
{% if results %}
|
|
<div class="row">
|
|
<div class="col col-md-9">
|
|
{% for obj_type in results %}
|
|
<h3 id="{{ obj_type.name|lower }}">{{ obj_type.name|bettertitle }}</h3>
|
|
{% include 'inc/panel_table.html' with table=obj_type.table %}
|
|
<a href="{{ obj_type.url }}" class="btn btn-primary float-end my-3">
|
|
<i class="mdi mdi-arrow-right-bold" aria-hidden="true"></i>
|
|
{% if obj_type.table.page.has_next %}
|
|
See All {{ obj_type.table.page.paginator.count }} Results
|
|
{% else %}
|
|
Refine Search
|
|
{% endif %}
|
|
</a>
|
|
{% endfor %}
|
|
</div>
|
|
<div class="col col-md-3">
|
|
<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>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% else %}
|
|
<h3 class="text-muted text-center">No results found</h3>
|
|
{% endif %}
|
|
{% else %}
|
|
<div class="row">
|
|
<div class="col-4 offset-4">
|
|
<form action="{% url 'search' %}" method="get" class="form form-horizontal">
|
|
<div class="card">
|
|
<h5 class="card-header">
|
|
Search
|
|
</h5>
|
|
<div class="card-body">
|
|
{% render_form form %}
|
|
</div>
|
|
<div class="card-footer text-end">
|
|
<button type="submit" class="btn btn-primary">
|
|
<span class="mdi mdi-magnify" aria-hidden="true"></span> Search
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
{% endblock content %}
|