mirror of
https://github.com/netbox-community/netbox.git
synced 2025-09-06 14:23:36 -06:00
Consolodate data file attributes into a reusable template
This commit is contained in:
parent
96306dcc6f
commit
9ecfd65fe2
36
netbox/templates/core/inc/datafile_panel.html
Normal file
36
netbox/templates/core/inc/datafile_panel.html
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
<div class="card">
|
||||||
|
<h2 class="card-header">{% trans "Data File" %}</h2>
|
||||||
|
<table class="table table-hover attr-table">
|
||||||
|
<tr>
|
||||||
|
<th scope="row">{% trans "Data Source" %}</th>
|
||||||
|
<td>
|
||||||
|
{% if object.data_source %}
|
||||||
|
<a href="{{ object.data_source.get_absolute_url }}">{{ object.data_source }}</a>
|
||||||
|
{% else %}
|
||||||
|
{{ ''|placeholder }}
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">{% trans "Data File" %}</th>
|
||||||
|
<td>
|
||||||
|
{% if object.data_file %}
|
||||||
|
<a href="{{ object.data_file.get_absolute_url }}">{{ object.data_file }}</a>
|
||||||
|
{% elif object.data_path %}
|
||||||
|
<div class="float-end text-warning">
|
||||||
|
<i class="mdi mdi-alert" title="{% trans "The data file associated with this object has been deleted" %}."></i>
|
||||||
|
</div>
|
||||||
|
{{ object.data_path }}
|
||||||
|
{% else %}
|
||||||
|
{{ ''|placeholder }}
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">{% trans "Data Synced" %}</th>
|
||||||
|
<td>{{ object.data_synced|placeholder }}</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
@ -29,37 +29,9 @@
|
|||||||
<th scope="row">{% trans "Active" %}</th>
|
<th scope="row">{% trans "Active" %}</th>
|
||||||
<td>{% checkmark object.is_active %}</td>
|
<td>{% checkmark object.is_active %}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<th scope="row">{% trans "Data Source" %}</th>
|
|
||||||
<td>
|
|
||||||
{% if object.data_source %}
|
|
||||||
<a href="{{ object.data_source.get_absolute_url }}">{{ object.data_source }}</a>
|
|
||||||
{% else %}
|
|
||||||
{{ ''|placeholder }}
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th scope="row">{% trans "Data File" %}</th>
|
|
||||||
<td>
|
|
||||||
{% if object.data_file %}
|
|
||||||
<a href="{{ object.data_file.get_absolute_url }}">{{ object.data_file }}</a>
|
|
||||||
{% elif object.data_path %}
|
|
||||||
<div class="float-end text-warning">
|
|
||||||
<i class="mdi mdi-alert" title="{% trans "The data file associated with this object has been deleted" %}."></i>
|
|
||||||
</div>
|
|
||||||
{{ object.data_path }}
|
|
||||||
{% else %}
|
|
||||||
{{ ''|placeholder }}
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th scope="row">{% trans "Data Synced" %}</th>
|
|
||||||
<td>{{ object.data_synced|placeholder }}</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
{% include 'core/inc/datafile_panel.html' %}
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<h2 class="card-header">{% trans "Assignment" %}</h2>
|
<h2 class="card-header">{% trans "Assignment" %}</h2>
|
||||||
<table class="table table-hover attr-table">
|
<table class="table table-hover attr-table">
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
{% include 'core/inc/datafile_panel.html' %}
|
||||||
{% include 'inc/panels/custom_fields.html' %}
|
{% include 'inc/panels/custom_fields.html' %}
|
||||||
{% include 'inc/panels/tags.html' %}
|
{% include 'inc/panels/tags.html' %}
|
||||||
{% include 'inc/panels/comments.html' %}
|
{% include 'inc/panels/comments.html' %}
|
||||||
|
@ -35,37 +35,9 @@
|
|||||||
<th scope="row">{% trans "Attachment" %}</th>
|
<th scope="row">{% trans "Attachment" %}</th>
|
||||||
<td>{% checkmark object.as_attachment %}</td>
|
<td>{% checkmark object.as_attachment %}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<th scope="row">{% trans "Data Source" %}</th>
|
|
||||||
<td>
|
|
||||||
{% if object.data_source %}
|
|
||||||
<a href="{{ object.data_source.get_absolute_url }}">{{ object.data_source }}</a>
|
|
||||||
{% else %}
|
|
||||||
{{ ''|placeholder }}
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th scope="row">{% trans "Data File" %}</th>
|
|
||||||
<td>
|
|
||||||
{% if object.data_file %}
|
|
||||||
<a href="{{ object.data_file.get_absolute_url }}">{{ object.data_file }}</a>
|
|
||||||
{% elif object.data_path %}
|
|
||||||
<div class="float-end text-warning">
|
|
||||||
<i class="mdi mdi-alert" title="{% trans "The data file associated with this object has been deleted" %}."></i>
|
|
||||||
</div>
|
|
||||||
{{ object.data_path }}
|
|
||||||
{% else %}
|
|
||||||
{{ ''|placeholder }}
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th scope="row">{% trans "Data Synced" %}</th>
|
|
||||||
<td>{{ object.data_synced|placeholder }}</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
{% include 'core/inc/datafile_panel.html' %}
|
||||||
{% plugin_left_page object %}
|
{% plugin_left_page object %}
|
||||||
</div>
|
</div>
|
||||||
<div class="col col-md-6">
|
<div class="col col-md-6">
|
||||||
|
Loading…
Reference in New Issue
Block a user