From eab18a81c9088e118ce2a68e0a449967ce1935c9 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Fri, 19 Aug 2016 12:19:02 -0400 Subject: [PATCH] Adjusted display of created and last_updated times for primary objects --- netbox/templates/circuits/circuit.html | 9 +-------- netbox/templates/circuits/provider.html | 9 +-------- netbox/templates/dcim/device.html | 9 +-------- netbox/templates/dcim/rack.html | 9 +-------- netbox/templates/dcim/site.html | 9 +-------- netbox/templates/inc/created_updated.html | 3 +++ netbox/templates/ipam/aggregate.html | 9 +-------- netbox/templates/ipam/ipaddress.html | 9 +-------- netbox/templates/ipam/prefix.html | 10 ++-------- netbox/templates/ipam/vlan.html | 9 +-------- netbox/templates/ipam/vrf.html | 9 +-------- netbox/templates/secrets/secret.html | 9 +-------- netbox/templates/tenancy/tenant.html | 9 +-------- netbox/templates/users/userkey.html | 1 + 14 files changed, 17 insertions(+), 96 deletions(-) create mode 100644 netbox/templates/inc/created_updated.html diff --git a/netbox/templates/circuits/circuit.html b/netbox/templates/circuits/circuit.html index 489dc42a6..8844dc43a 100644 --- a/netbox/templates/circuits/circuit.html +++ b/netbox/templates/circuits/circuit.html @@ -102,16 +102,9 @@ {% endif %} - - Created - {{ circuit.created }} - - - Last Updated - {{ circuit.last_updated }} - + {% include 'inc/created_updated.html' with obj=circuit %}
diff --git a/netbox/templates/circuits/provider.html b/netbox/templates/circuits/provider.html index 1388a2c5d..e5aa6c0c4 100644 --- a/netbox/templates/circuits/provider.html +++ b/netbox/templates/circuits/provider.html @@ -103,14 +103,6 @@ {% endif %} - - Created - {{ provider.created }} - - - Last Updated - {{ provider.last_updated }} -
@@ -125,6 +117,7 @@ {% endif %}
+ {% include 'inc/created_updated.html' with obj=provider %}
diff --git a/netbox/templates/dcim/device.html b/netbox/templates/dcim/device.html index 049555571..6bdd48c29 100644 --- a/netbox/templates/dcim/device.html +++ b/netbox/templates/dcim/device.html @@ -79,14 +79,6 @@ {% endif %} - - Created - {{ device.created }} - - - Last Updated - {{ device.last_updated }} -
@@ -306,6 +298,7 @@
None found
{% endif %}
+ {% include 'inc/created_updated.html' with obj=device %}
{% if device_bays or device.device_type.is_parent_device %} diff --git a/netbox/templates/dcim/rack.html b/netbox/templates/dcim/rack.html index 16a4731b6..927ec2305 100644 --- a/netbox/templates/dcim/rack.html +++ b/netbox/templates/dcim/rack.html @@ -130,14 +130,6 @@ {{ rack.devices.count }} - - Created - {{ rack.created }} - - - Last Updated - {{ rack.last_updated }} -
@@ -187,6 +179,7 @@ {% endif %}
+ {% include 'inc/created_updated.html' with obj=rack %}
diff --git a/netbox/templates/dcim/site.html b/netbox/templates/dcim/site.html index 2bd0ffce8..2509721b9 100644 --- a/netbox/templates/dcim/site.html +++ b/netbox/templates/dcim/site.html @@ -109,14 +109,6 @@ {% endif %} - - Created - {{ site.created }} - - - Last Updated - {{ site.last_updated }} -
@@ -131,6 +123,7 @@ {% endif %}
+ {% include 'inc/created_updated.html' with obj=site %}
diff --git a/netbox/templates/inc/created_updated.html b/netbox/templates/inc/created_updated.html new file mode 100644 index 000000000..001bb6b85 --- /dev/null +++ b/netbox/templates/inc/created_updated.html @@ -0,0 +1,3 @@ +

+ Created {{ obj.created }} · Updated {{ obj.last_updated|timesince }} ago +

diff --git a/netbox/templates/ipam/aggregate.html b/netbox/templates/ipam/aggregate.html index 9a0a8db1f..ec408d33b 100644 --- a/netbox/templates/ipam/aggregate.html +++ b/netbox/templates/ipam/aggregate.html @@ -77,16 +77,9 @@ {% endif %} - - Created - {{ aggregate.created }} - - - Last Updated - {{ aggregate.last_updated }} -
+ {% include 'inc/created_updated.html' with obj=aggregate %}
diff --git a/netbox/templates/ipam/ipaddress.html b/netbox/templates/ipam/ipaddress.html index de5ed637b..56f95479b 100644 --- a/netbox/templates/ipam/ipaddress.html +++ b/netbox/templates/ipam/ipaddress.html @@ -119,16 +119,9 @@ {% endif %} - - Created - {{ ipaddress.created }} - - - Last Updated - {{ ipaddress.last_updated }} -
+ {% include 'inc/created_updated.html' with obj=ipaddress %}
{% with heading='Parent Prefixes' %} diff --git a/netbox/templates/ipam/prefix.html b/netbox/templates/ipam/prefix.html index 802e9b90f..24a40ed66 100644 --- a/netbox/templates/ipam/prefix.html +++ b/netbox/templates/ipam/prefix.html @@ -99,16 +99,10 @@ IP Addresses {{ ipaddress_count }} - - Created - {{ prefix.created }} - - - Last Updated - {{ prefix.last_updated }} -
+ {% include 'inc/created_updated.html' with obj=prefix %} +
{% if duplicate_prefix_table.rows %} diff --git a/netbox/templates/ipam/vlan.html b/netbox/templates/ipam/vlan.html index d27184824..5b9d4cd3c 100644 --- a/netbox/templates/ipam/vlan.html +++ b/netbox/templates/ipam/vlan.html @@ -107,17 +107,10 @@ N/A {% endif %} - - - Created - {{ vlan.created }} - - - Last Updated - {{ vlan.last_updated }}
+ {% include 'inc/created_updated.html' with obj=vlan %}
diff --git a/netbox/templates/ipam/vrf.html b/netbox/templates/ipam/vrf.html index bd3cadc9e..899b14f54 100644 --- a/netbox/templates/ipam/vrf.html +++ b/netbox/templates/ipam/vrf.html @@ -79,17 +79,10 @@ N/A {% endif %} - - - Created - {{ vrf.created }} - - - Last Updated - {{ vrf.last_updated }}
+ {% include 'inc/created_updated.html' with obj=vrf %}
diff --git a/netbox/templates/secrets/secret.html b/netbox/templates/secrets/secret.html index 53cdb4d7c..98007c2b9 100644 --- a/netbox/templates/secrets/secret.html +++ b/netbox/templates/secrets/secret.html @@ -56,16 +56,9 @@ {% endif %} - - Created - {{ secret.created }} - - - Last Updated - {{ secret.last_updated }} -
+ {% include 'inc/created_updated.html' with obj=secret %}
{% if secret|decryptable_by:request.user %} diff --git a/netbox/templates/tenancy/tenant.html b/netbox/templates/tenancy/tenant.html index 0ca380639..c2334bda7 100644 --- a/netbox/templates/tenancy/tenant.html +++ b/netbox/templates/tenancy/tenant.html @@ -63,14 +63,6 @@ {% endif %} - - Created - {{ tenant.created }} - - - Last Updated - {{ tenant.last_updated }} -
@@ -85,6 +77,7 @@ {% endif %}
+ {% include 'inc/created_updated.html' with obj=tenant %}
diff --git a/netbox/templates/users/userkey.html b/netbox/templates/users/userkey.html index cbc748d17..6318377c6 100644 --- a/netbox/templates/users/userkey.html +++ b/netbox/templates/users/userkey.html @@ -31,6 +31,7 @@ Edit user key
+ {% include 'inc/created_updated.html' with obj=userkey %} {% else %}

You don't have a user key on file.