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

95 lines
3.7 KiB
HTML

{% extends 'base/layout.html' %}
{% load get_status %}
{% load helpers %}
{% block header %}
{{ block.super }}
{% if new_release %}
{# new_release is set only if the current user is a superuser or staff member #}
<div class="header-alert-container">
<div class="alert alert-info text-center mw-md-50" role="alert">
<h6 class="alert-heading">
<i class="mdi mdi-information-outline"></i><br/>New Release Available
</h6>
<small><a href="{{ new_release.url }}">NetBox v{{ new_release.version }}</a> is available.</small>
<hr class="my-2" />
<small class="mb-0">
<a href="https://netbox.readthedocs.io/en/stable/installation/upgrading/">Upgrade Instructions</a>
</small>
</div>
</div>
{% endif %}
{% endblock %}
{% block title %}Home{% endblock %}
{% block content %}
{# General stats #}
<div class="row masonry">
{% for section, items in stats %}
<div class="col col-sm-12 col-lg-6 col-xl-4 my-2 masonry-item">
<div class="card">
<h6 class="card-header text-primary text-center">{{ section }}</h6>
<div class="card-body">
<div class="list-group list-group-flush">
{% for item in items %}
{% if item.count %}
<a href="{% url item.url %}" class="list-group-item list-group-item-action{% if item.disabled %} disabled{% endif %}">
<div class="d-flex w-100 justify-content-between align-items-center">
{{ item.label }}
<h4 class="mb-1">{{ item.count }}</h4>
</div>
</a>
{% endif %}
{% endfor %}
</div>
</div>
</div>
</div>
{% endfor %}
</div>
{# Changelog #}
<div class="row my-4 flex-grow-1 changelog-container">
<div class="col">
<div class="card">
<h6 class="card-header text-primary text-center">Changelog</h6>
{% if changelog and perms.extras.view_objectchange %}
{# TODO: Replace this with a django-tables2 Table #}
<table class="table table-flush align-middle table-hover">
<thead>
<tr>
<th scope="col">User</th>
<th scope="col">Action</th>
<th scope="col">Type</th>
<th scope="col">Object</th>
<th scope="col">Time</th>
</tr>
</thead>
<tbody>
{% for change in changelog %}
<tr class="{% get_status change.get_action_display %}" data-href="{{ change.get_absolute_url }}">
<th scope="row">{{ change.user|default:change.user_name }}</th>
<td>{{ change.get_action_display|bettertitle }}</td>
<td>{{ change.changed_object_type.name|bettertitle }}</td>
<td>
{% if change.changed_object.get_absolute_url %}
<a class="text-body" href="{{ change.changed_object.get_absolute_url }}">{{ change.changed_object }}</a>
{% else %} {{ change.changed_object|default:change.object_repr }} {% endif %}
</td>
<td>{{ change.time|date:'SHORT_DATETIME_FORMAT' }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% elif perms.extras.view_objectchange %}
<div class="alert alert-secondary mt-4" role="alert">
No change history found.
</div>
{% endif %}
</div>
</div>
</div>
{% endblock content %}