mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-22 20:12:00 -06:00
Cleaned up objectchange table
This commit is contained in:
parent
bbaa3a2058
commit
85efdf8e00
@ -24,6 +24,10 @@ CONFIGCONTEXT_ACTIONS = """
|
||||
{% endif %}
|
||||
"""
|
||||
|
||||
OBJECTCHANGE_TIME = """
|
||||
<a href="{{ record.get_absolute_url }}">{{ value|date:"SHORT_DATETIME_FORMAT" }}</a>
|
||||
"""
|
||||
|
||||
OBJECTCHANGE_ACTION = """
|
||||
{% if record.action == 1 %}
|
||||
<span class="label label-success">Created</span>
|
||||
@ -42,6 +46,10 @@ OBJECTCHANGE_OBJECT = """
|
||||
{% endif %}
|
||||
"""
|
||||
|
||||
OBJECTCHANGE_REQUEST_ID = """
|
||||
<a href="{% url 'extras:objectchange_list' %}?request_id={{ value }}">{{ value }}</a>
|
||||
"""
|
||||
|
||||
|
||||
class TagTable(BaseTable):
|
||||
pk = ToggleColumn()
|
||||
@ -74,7 +82,9 @@ class ConfigContextTable(BaseTable):
|
||||
|
||||
|
||||
class ObjectChangeTable(BaseTable):
|
||||
time = tables.LinkColumn()
|
||||
time = tables.TemplateColumn(
|
||||
template_code=OBJECTCHANGE_TIME
|
||||
)
|
||||
action = tables.TemplateColumn(
|
||||
template_code=OBJECTCHANGE_ACTION
|
||||
)
|
||||
@ -85,7 +95,8 @@ class ObjectChangeTable(BaseTable):
|
||||
template_code=OBJECTCHANGE_OBJECT,
|
||||
verbose_name='Object'
|
||||
)
|
||||
request_id = tables.Column(
|
||||
request_id = tables.TemplateColumn(
|
||||
template_code=OBJECTCHANGE_REQUEST_ID,
|
||||
verbose_name='Request ID'
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user