Introduce an inclusion template for object comments

This commit is contained in:
jeremystretch 2021-07-21 14:20:14 -04:00
parent a9930bd442
commit 7be684835b
13 changed files with 26 additions and 140 deletions

View File

@ -66,18 +66,7 @@
</div>
{% include 'inc/custom_fields_panel.html' %}
{% include 'extras/inc/tags_panel.html' with tags=object.tags.all url='circuits:circuit_list' %}
<div class="card">
<h5 class="card-header">
Comments
</h5>
<div class="card-body rendered-markdown">
{% if object.comments %}
{{ object.comments|render_markdown }}
{% else %}
<span class="text-muted">None</span>
{% endif %}
</div>
</div>
{% include 'inc/comments_panel.html' %}
{% plugin_left_page object %}
</div>
<div class="col col-md-6">

View File

@ -52,18 +52,7 @@
<div class="col col-md-6">
{% include 'inc/custom_fields_panel.html' %}
{% include 'extras/inc/tags_panel.html' with tags=object.tags.all url='circuits:provider_list' %}
<div class="card">
<h5 class="card-header">
Comments
</h5>
<div class="card-body rendered-markdown">
{% if object.comments %}
{{ object.comments|render_markdown }}
{% else %}
<span class="text-muted">None</span>
{% endif %}
</div>
</div>
{% include 'inc/comments_panel.html' %}
{% plugin_right_page object %}
</div>
<div class="col col-md-12">

View File

@ -37,20 +37,9 @@
{% plugin_left_page object %}
</div>
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">
Comments
</h5>
<div class="card-body rendered-markdown">
{% if object.comments %}
{{ object.comments|render_markdown }}
{% else %}
<span class="text-muted">None</span>
{% endif %}
</div>
</div>
{% include 'inc/custom_fields_panel.html' %}
{% include 'extras/inc/tags_panel.html' with tags=object.tags.all url='circuits:providernetwork_list' %}
{% include 'inc/comments_panel.html' %}
{% plugin_right_page object %}
</div>
</div>

View File

@ -210,18 +210,7 @@
</div>
{% include 'inc/custom_fields_panel.html' %}
{% include 'extras/inc/tags_panel.html' with tags=object.tags.all url='dcim:device_list' %}
<div class="card">
<h5 class="card-header">
Comments
</h5>
<div class="card-body rendered-markdown">
{% if object.comments %}
{{ object.comments|render_markdown }}
{% else %}
<span class="text-muted">None</span>
{% endif %}
</div>
</div>
{% include 'inc/comments_panel.html' %}
{% plugin_left_page object %}
</div>
<div class="col col-md-6">

View File

@ -126,18 +126,7 @@
<div class="col col-md-6">
{% include 'inc/custom_fields_panel.html' %}
{% include 'extras/inc/tags_panel.html' with tags=object.tags.all url='dcim:devicetype_list' %}
<div class="card">
<h5 class="card-header">
Comments
</h5>
<div class="card-body rendered-markdown">
{% if object.comments %}
{{ object.comments|render_markdown }}
{% else %}
<span class="text-muted">None</span>
{% endif %}
</div>
</div>
{% include 'inc/comments_panel.html' %}
{% plugin_right_page object %}
</div>
</div>

View File

@ -182,18 +182,7 @@
</div>
{% endif %}
</div>
<div class="card">
<h5 class="card-header">
Comments
</h5>
<div class="card-body rendered-markdown">
{% if object.comments %}
{{ object.comments|render_markdown }}
{% else %}
<span class="text-muted">None</span>
{% endif %}
</div>
</div>
{% include 'inc/comments_panel.html' %}
{% plugin_right_page object %}
</div>
</div>

View File

@ -168,18 +168,7 @@
</div>
{% include 'inc/custom_fields_panel.html' %}
{% include 'extras/inc/tags_panel.html' with tags=object.tags.all url='dcim:rack_list' %}
<div class="card">
<h5 class="card-header">
Comments
</h5>
<div class="card-body rendered-markdown">
{% if object.comments %}
{{ object.comments|render_markdown }}
{% else %}
<span class="text-muted">None</span>
{% endif %}
</div>
</div>
{% include 'inc/comments_panel.html' %}
{% if power_feeds %}
<div class="card">
<h5 class="card-header">

View File

@ -167,18 +167,7 @@
</div>
{% include 'inc/custom_fields_panel.html' %}
{% include 'extras/inc/tags_panel.html' with tags=object.tags.all url='dcim:site_list' %}
<div class="card">
<h5 class="card-header">
Comments
</h5>
<div class="card-body rendered-markdown">
{% if object.comments %}
{{ object.comments|render_markdown }}
{% else %}
<span class="text-muted">None</span>
{% endif %}
</div>
</div>
{% include 'inc/comments_panel.html' %}
{% plugin_left_page object %}
</div>
<div class="col col-md-5">

View File

@ -45,14 +45,7 @@
</div>
</div>
<div class="col col-md-8">
<div class="card">
<h5 class="card-header">
Comments
</h5>
<div class="card-body">
{{ object.comments|render_markdown }}
</div>
</div>
{% include 'inc/comments_panel.html' %}
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,14 @@
{% load helpers %}
<div class="card">
<h5 class="card-header">
Comments
</h5>
<div class="card-body rendered-markdown">
{% if object.comments %}
{{ object.comments|render_markdown }}
{% else %}
<span class="text-muted">None</span>
{% endif %}
</div>
</div>

View File

@ -37,18 +37,7 @@
</div>
{% include 'inc/custom_fields_panel.html' %}
{% include 'extras/inc/tags_panel.html' with tags=object.tags.all url='tenancy:tenant_list' %}
<div class="card">
<h5 class="card-header">
Comments
</h5>
<div class="card-body rendered-markdown">
{% if object.comments %}
{{ object.comments|render_markdown }}
{% else %}
<span class="text-muted">None</span>
{% endif %}
</div>
</div>
{% include 'inc/comments_panel.html' %}
{% plugin_left_page object %}
</div>
<div class="col col-md-5">

View File

@ -56,18 +56,7 @@
</table>
</div>
</div>
<div class="card">
<h5 class="card-header">
Comments
</h5>
<div class="card-body rendered-markdown">
{% if object.comments %}
{{ object.comments|render_markdown }}
{% else %}
<span class="text-muted">None</span>
{% endif %}
</div>
</div>
{% include 'inc/comments_panel.html' %}
{% plugin_left_page object %}
</div>
<div class="col col-md-6">

View File

@ -91,18 +91,7 @@
</div>
{% include 'inc/custom_fields_panel.html' %}
{% include 'extras/inc/tags_panel.html' with tags=object.tags.all url='virtualization:virtualmachine_list' %}
<div class="card">
<h5 class="card-header">
Comments
</h5>
<div class="card-body rendered-markdown">
{% if object.comments %}
{{ object.comments|render_markdown }}
{% else %}
<span class="text-muted">None</span>
{% endif %}
</div>
</div>
{% include 'inc/comments_panel.html' %}
{% plugin_left_page object %}
</div>
<div class="col col-md-6">