mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Merge v2.11.8 changes
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
{# Base layout for the core NetBox UI w/navbar and page content #}
|
||||
{% extends 'base/base.html' %}
|
||||
{% load helpers %}
|
||||
{% load nav %}
|
||||
{% load search_options %}
|
||||
{% load static %}
|
||||
@@ -115,7 +116,7 @@
|
||||
<div class="row align-items-center justify-content-end mx-0">
|
||||
<div class="col-auto d-none d-md-block"></div>
|
||||
<div class="col text-center small text-muted">
|
||||
<span class="fw-light d-block d-md-inline">{% now 'Y-m-d H:i:s T' %}</span>
|
||||
<span class="fw-light d-block d-md-inline">{% annotated_now %} {% now 'T' %}</span>
|
||||
<span class="ms-md-3 d-block d-md-inline">{{ settings.HOSTNAME }} (v{{ settings.VERSION }})</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -52,7 +52,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Install Date</th>
|
||||
<td>{{ object.install_date|placeholder }}</td>
|
||||
<td>{{ object.install_date|annotated_date|placeholder }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Commit Rate</th>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
{% extends 'base/layout.html' %}
|
||||
{% load helpers %}
|
||||
{% load form_helpers %}
|
||||
|
||||
{% block title %}Create {{ component_type }}{% endblock %}
|
||||
@@ -12,7 +13,37 @@
|
||||
<div class="col col-md-8">
|
||||
<div class="field-group">
|
||||
<h4>{{ component_type|title }}</h4>
|
||||
{% render_form form %}
|
||||
{% if form.non_field_errors %}
|
||||
<div class="panel panel-danger">
|
||||
<div class="panel-heading"><strong>Errors</strong></div>
|
||||
<div class="panel-body">
|
||||
{{ form.non_field_errors }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<strong>{{ component_type|bettertitle }}</strong>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
{% for field in form.hidden_fields %}
|
||||
{{ field }}
|
||||
{% endfor %}
|
||||
{% for field in form.visible_fields %}
|
||||
{% if field.name not in form.custom_fields %}
|
||||
{% render_field field %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% if form.custom_fields %}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"><strong>Custom Fields</strong></div>
|
||||
<div class="panel-body">
|
||||
{% render_custom_fields form %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -35,6 +35,15 @@
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
{% if object.mgmt_only %}
|
||||
<span class="badge bg-success">Management Only</span>
|
||||
{% else %}
|
||||
<span class="badge bg-danger">Not Management Only</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Device</th>
|
||||
<td>
|
||||
|
@@ -278,7 +278,7 @@
|
||||
</td>
|
||||
<td>
|
||||
{{ resv.description }}<br />
|
||||
<small>{{ resv.user }} · {{ resv.created }}</small>
|
||||
<small>{{ resv.user }} · {{ resv.created|annotated_date }}</small>
|
||||
</td>
|
||||
<td class="text-end noprint">
|
||||
{% if perms.dcim.change_rackreservation %}
|
||||
|
@@ -68,7 +68,7 @@
|
||||
<td>
|
||||
{% if object.time_zone %}
|
||||
{{ object.time_zone }} (UTC {{ object.time_zone|tzoffset }})<br />
|
||||
<small class="text-muted">Site time: {% timezone object.time_zone %}{% now "SHORT_DATETIME_FORMAT" %}{% endtimezone %}</small>
|
||||
<small class="text-muted">Site time: {% timezone object.time_zone %}{% annotated_now %}{% endtimezone %}</small>
|
||||
{% else %}
|
||||
<span class="text-muted">—</span>
|
||||
{% endif %}
|
||||
|
@@ -26,7 +26,7 @@
|
||||
<tr>
|
||||
<th scope="row">Created</th>
|
||||
<td>
|
||||
{{ object.created }}
|
||||
{{ object.created|annotated_date }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@@ -44,7 +44,7 @@
|
||||
<tr>
|
||||
<th scope="row">Time</th>
|
||||
<td>
|
||||
{{ object.time }}
|
||||
{{ object.time|annotated_date }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@@ -31,7 +31,7 @@
|
||||
<div class="col col-md-12">
|
||||
{% if report.result %}
|
||||
Last run: <a href="{% url 'extras:report_result' job_result_pk=report.result.pk %}">
|
||||
<strong>{{ report.result.created }}</strong>
|
||||
<strong>{{ report.result.created|annotated_date }}</strong>
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
@@ -35,7 +35,7 @@
|
||||
<td>{{ report.description|render_markdown|placeholder }}</td>
|
||||
<td class="text-end">
|
||||
{% if report.result %}
|
||||
<a href="{% url 'extras:report_result' job_result_pk=report.result.pk %}">{{ report.result.created }}</a>
|
||||
<a href="{% url 'extras:report_result' job_result_pk=report.result.pk %}">{{ report.result.created|annotated_date }}</a>
|
||||
{% else %}
|
||||
<span class="text-muted">Never</span>
|
||||
{% endif %}
|
||||
|
@@ -13,7 +13,7 @@
|
||||
<div class="row">
|
||||
<div class="col col-md-12">
|
||||
<p>
|
||||
Run: <strong>{{ result.created }}</strong>
|
||||
Run: <strong>{{ result.created|annotated_date }}</strong>
|
||||
{% if result.completed %}
|
||||
Duration: <strong>{{ result.duration }}</strong>
|
||||
{% else %}
|
||||
|
@@ -30,7 +30,7 @@
|
||||
<td>{{ script.Meta.description|render_markdown }}</td>
|
||||
{% if script.result %}
|
||||
<td class="text-end">
|
||||
<a href="{% url 'extras:script_result' job_result_pk=script.result.pk %}">{{ script.result.created }}</a>
|
||||
<a href="{% url 'extras:script_result' job_result_pk=script.result.pk %}">{{ script.result.created|annotated_date }}</a>
|
||||
</td>
|
||||
{% else %}
|
||||
<td class="text-end text-muted">Never</td>
|
||||
|
@@ -19,7 +19,7 @@
|
||||
<li class="breadcrumb-item"><a href="{% url 'extras:script_list' %}">Scripts</a></li>
|
||||
<li class="breadcrumb-item"><a href="{% url 'extras:script_list' %}#module.{{ script.module }}">{{ script.module|bettertitle }}</a></li>
|
||||
<li class="breadcrumb-item"><a href="{% url 'extras:script' module=script.module name=class_name %}">{{ script }}</a></li>
|
||||
<li class="breadcrumb-item">{{ result.created }}</li>
|
||||
<li class="breadcrumb-item">{{ result.created|annotated_date }}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
@@ -38,7 +38,7 @@
|
||||
</ul>
|
||||
<div class="tab-content my-3">
|
||||
<p>
|
||||
Run: <strong>{{ result.created }}</strong>
|
||||
Run: <strong>{{ result.created|annotated_date }}</strong>
|
||||
{% if result.completed %}
|
||||
Duration: <strong>{{ result.duration }}</strong>
|
||||
{% else %}
|
||||
|
@@ -72,8 +72,8 @@
|
||||
{% block content %}
|
||||
<p>
|
||||
<small class="text-muted">
|
||||
Created {{ object.created }} ·
|
||||
Updated <span title="{{ object.last_updated }}">{{ object.last_updated|timesince }}</span> ago
|
||||
Created {{ object.created|annotated_date }} ·
|
||||
Updated <span title="{{ object.last_updated|annotated_date }}">{{ object.last_updated|timesince }}</span> ago
|
||||
</small>
|
||||
<span class="badge bg-primary">{{ object|meta:"app_label" }}.{{ object|meta:"model_name" }}:{{ object.pk }}</span>
|
||||
</p>
|
||||
|
@@ -1,3 +1,4 @@
|
||||
{% load helpers %}
|
||||
|
||||
{% if images %}
|
||||
<table class="table table-hover">
|
||||
@@ -14,7 +15,7 @@
|
||||
<a class="image-preview" href="{{ attachment.image.url }}" target="_blank">{{ attachment }}</a>
|
||||
</td>
|
||||
<td>{{ attachment.size|filesizeformat }}</td>
|
||||
<td>{{ attachment.created }}</td>
|
||||
<td>{{ attachment.created|annotated_date }}</td>
|
||||
<td class="text-end noprint">
|
||||
{% if perms.extras.change_imageattachment %}
|
||||
<a href="{% url 'extras:imageattachment_edit' pk=attachment.pk %}" class="btn btn-warning btn-sm lh-1" title="Edit Image">
|
||||
|
@@ -53,7 +53,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Date Added</td>
|
||||
<td>{{ object.date_added|placeholder }}</td>
|
||||
<td>{{ object.date_added|annotated_date|placeholder }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Description</td>
|
||||
|
@@ -24,12 +24,12 @@
|
||||
<div class="row">
|
||||
<div class="col col-md-4">
|
||||
<small class="text-muted">Created</small><br />
|
||||
<span title="{{ token.created }}">{{ token.created|date }}</span>
|
||||
{{ token.created|annotated_date }}
|
||||
</div>
|
||||
<div class="col col-md-4">
|
||||
<small class="text-muted">Expires</small><br />
|
||||
{% if token.expires %}
|
||||
<span title="{{ token.expires }}">{{ token.expires|date }}</span>
|
||||
{{ token.expires|annotated_date }}
|
||||
{% else %}
|
||||
<span>Never</span>
|
||||
{% endif %}
|
||||
|
@@ -21,7 +21,7 @@
|
||||
<small class="text-muted">Email</small>
|
||||
<h5>{{ request.user.email }}</h5>
|
||||
<small class="text-muted">Registered</small>
|
||||
<h5>{{ request.user.date_joined }}</h5>
|
||||
<h5>{{ request.user.date_joined|annotated_date }}</h5>
|
||||
<small class="text-muted">Groups</small>
|
||||
<h5>
|
||||
{% if request.user.groups.all %}
|
||||
|
@@ -142,7 +142,7 @@
|
||||
<th scope="row"><i class="mdi mdi-chip"></i> Memory</th>
|
||||
<td>
|
||||
{% if object.memory %}
|
||||
{{ object.memory }} MB
|
||||
{{ object.memory|humanize_megabytes }} MB
|
||||
{% else %}
|
||||
<span class="text-muted">—</span>
|
||||
{% endif %}
|
||||
|
@@ -1,28 +0,0 @@
|
||||
{% extends 'base/layout.html' %}
|
||||
{% load helpers %}
|
||||
{% load form_helpers %}
|
||||
|
||||
{% block title %}Create {{ component_type }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<form action="" method="post" class="form form-horizontal">
|
||||
{% csrf_token %}
|
||||
<div class="row mb-3">
|
||||
<div class="col col-md-6">
|
||||
<div class="field-group">
|
||||
<h4>{{ component_type|bettertitle }}</h4>
|
||||
{% render_form form %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col col-md-6">
|
||||
<div class="float-end">
|
||||
<a href="{{ return_url }}" class="btn btn-outline-danger">Cancel</a>
|
||||
<button type="submit" name="_addanother" class="btn btn-outline-primary">Create & Add More</button>
|
||||
<button type="submit" name="_create" class="btn btn-primary">Create</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
Reference in New Issue
Block a user