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

Introduce generic object template

This commit is contained in:
Jeremy Stretch
2021-03-02 15:58:33 -05:00
parent 8dd7123923
commit 51120ccf31
27 changed files with 494 additions and 1324 deletions

View File

@@ -1,65 +1,17 @@
{% extends 'base.html' %}
{% load buttons %}
{% load custom_links %}
{% extends 'generic/object.html' %}
{% load helpers %}
{% load plugins %}
{% load static %}
{% load tz %}
{% block header %}
<div class="row noprint">
<div class="col-sm-8 col-md-9">
<ol class="breadcrumb">
<li><a href="{% url 'dcim:site_list' %}">Sites</a></li>
{% if object.region %}
{% for region in object.region.get_ancestors %}
<li><a href="{{ region.get_absolute_url }}">{{ region }}</a></li>
{% endfor %}
<li><a href="{{ object.region.get_absolute_url }}">{{ object.region }}</a></li>
{% endif %}
<li>{{ object }}</li>
</ol>
</div>
<div class="col-sm-4 col-md-3">
<form action="{% url 'dcim:site_list' %}" method="get">
<div class="input-group">
<input type="text" name="q" class="form-control" placeholder="Search sites" />
<span class="input-group-btn">
<button type="submit" class="btn btn-primary">
<span class="mdi mdi-magnify" aria-hidden="true"></span>
</button>
</span>
</div>
</form>
</div>
</div>
<div class="pull-right noprint">
{% plugin_buttons object %}
{% if perms.dcim.add_site %}
{% clone_button object %}
{% endif %}
{% if perms.dcim.change_site %}
{% edit_button object %}
{% endif %}
{% if perms.dcim.delete_site %}
{% delete_button object %}
{% endif %}
</div>
<h1>{% block title %}{{ object }}{% endblock %}</h1>
{% include 'inc/created_updated.html' %}
<div class="pull-right noprint">
{% custom_links object %}
</div>
<ul class="nav nav-tabs">
<li role="presentation"{% if not active_tab %} class="active"{% endif %}>
<a href="{{ object.get_absolute_url }}">Site</a>
</li>
{% if perms.extras.view_objectchange %}
<li role="presentation"{% if active_tab == 'changelog' %} class="active"{% endif %}>
<a href="{% url 'dcim:site_changelog' pk=object.pk %}">Change Log</a>
</li>
{% endif %}
</ul>
{% block breadcrumbs %}
<li><a href="{% url 'dcim:site_list' %}">Sites</a></li>
{% if object.region %}
{% for region in object.region.get_ancestors %}
<li><a href="{{ region.get_absolute_url }}">{{ region }}</a></li>
{% endfor %}
<li><a href="{{ object.region.get_absolute_url }}">{{ object.region }}</a></li>
{% endif %}
<li>{{ object }}</li>
{% endblock %}
{% block content %}