Closes #4129: Add individual deletion views for device type components

This commit is contained in:
Jeremy Stretch
2020-02-10 11:43:51 -05:00
parent 0c22be54ca
commit e961aa58b9
5 changed files with 85 additions and 9 deletions

View File

@@ -200,6 +200,11 @@ def get_component_template_actions(model_name):
<i class="glyphicon glyphicon-pencil" aria-hidden="true"></i>
</a>
{{% endif %}}
{{% if perms.dcim.delete_{model_name} %}}
<a href="{{% url 'dcim:{model_name}_delete' pk=record.pk %}}?return_url={{{{ request.path }}}}" class="btn btn-xs btn-danger">
<i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
</a>
{{% endif %}}
""".format(model_name=model_name).strip()