Browse Source

Adjusted display of created and last_updated times for primary objects

Jeremy Stretch 8 years ago
parent
commit
eab18a81c9

+ 1 - 8
netbox/templates/circuits/circuit.html

@@ -102,16 +102,9 @@
                         {% endif %}
                     </td>
                 </tr>
-                <tr>
-                    <td>Created</td>
-                    <td>{{ circuit.created }}</td>
-                </tr>
-                <tr>
-                    <td>Last Updated</td>
-                    <td>{{ circuit.last_updated }}</td>
-                </tr>
             </table>
         </div>
+        {% include 'inc/created_updated.html' with obj=circuit %}
 	</div>
 	<div class="col-md-6">
         <div class="panel panel-default">

+ 1 - 8
netbox/templates/circuits/provider.html

@@ -103,14 +103,6 @@
                         {% endif %}
                     </td>
                 </tr>
-                <tr>
-                    <td>Created</td>
-                    <td>{{ provider.created }}</td>
-                </tr>
-                <tr>
-                    <td>Last Updated</td>
-                    <td>{{ provider.last_updated }}</td>
-                </tr>
             </table>
         </div>
         <div class="panel panel-default">
@@ -125,6 +117,7 @@
                 {% endif %}
             </div>
         </div>
+        {% include 'inc/created_updated.html' with obj=provider %}
 	</div>
 	<div class="col-md-6">
         <div class="panel panel-default">

+ 1 - 8
netbox/templates/dcim/device.html

@@ -79,14 +79,6 @@
                         {% endif %}
                     </td>
                 </tr>
-                <tr>
-                    <td>Created</td>
-                    <td>{{ device.created }}</td>
-                </tr>
-                <tr>
-                    <td>Last Updated</td>
-                    <td>{{ device.last_updated }}</td>
-                </tr>
             </table>
         </div>
         <div class="panel panel-default">
@@ -306,6 +298,7 @@
                 <div class="panel-body text-muted">None found</div>
             {% endif %}
         </div>
+        {% include 'inc/created_updated.html' with obj=device %}
 	</div>
 	<div class="col-md-6">
         {% if device_bays or device.device_type.is_parent_device %}

+ 1 - 8
netbox/templates/dcim/rack.html

@@ -130,14 +130,6 @@
                         <a href="{% url 'dcim:device_list' %}?rack_id={{ rack.id }}">{{ rack.devices.count }}</a>
                     </td>
                 </tr>
-                <tr>
-                    <td>Created</td>
-                    <td>{{ rack.created }}</td>
-                </tr>
-                <tr>
-                    <td>Last Updated</td>
-                    <td>{{ rack.last_updated }}</td>
-                </tr>
             </table>
         </div>
         <div class="panel panel-default">
@@ -187,6 +179,7 @@
                 {% endif %}
             </div>
         </div>
+        {% include 'inc/created_updated.html' with obj=rack %}
 	</div>
     <div class="row col-md-6">
        <div class="col-md-6 col-sm-6 col-xs-12">

+ 1 - 8
netbox/templates/dcim/site.html

@@ -109,14 +109,6 @@
                         {% endif %}
                     </td>
                 </tr>
-                <tr>
-                    <td>Created</td>
-                    <td>{{ site.created }}</td>
-                </tr>
-                <tr>
-                    <td>Last Updated</td>
-                    <td>{{ site.last_updated }}</td>
-                </tr>
             </table>
         </div>
         <div class="panel panel-default">
@@ -131,6 +123,7 @@
                 {% endif %}
             </div>
         </div>
+        {% include 'inc/created_updated.html' with obj=site %}
     </div>
     <div class="col-md-5">
         <div class="panel panel-default">

+ 3 - 0
netbox/templates/inc/created_updated.html

@@ -0,0 +1,3 @@
+<p>
+    <small class="text-muted">Created {{ obj.created }} &middot; Updated <span title="{{ obj.last_updated }}">{{ obj.last_updated|timesince }}</span> ago</small>
+</p>

+ 1 - 8
netbox/templates/ipam/aggregate.html

@@ -77,16 +77,9 @@
                         {% endif %}
                     </td>
                 </tr>
-                <tr>
-                    <td>Created</td>
-                    <td>{{ aggregate.created }}</td>
-                </tr>
-                <tr>
-                    <td>Last Updated</td>
-                    <td>{{ aggregate.last_updated }}</td>
-                </tr>
             </table>
         </div>
+        {% include 'inc/created_updated.html' with obj=aggregate %}
     </div>
 </div>
 <div class="row">

+ 1 - 8
netbox/templates/ipam/ipaddress.html

@@ -119,16 +119,9 @@
                         {% endif %}
                     </td>
                 </tr>
-                <tr>
-                    <td>Created</td>
-                    <td>{{ ipaddress.created }}</td>
-                </tr>
-                <tr>
-                    <td>Last Updated</td>
-                    <td>{{ ipaddress.last_updated }}</td>
-                </tr>
             </table>
         </div>
+        {% include 'inc/created_updated.html' with obj=ipaddress %}
 	</div>
 	<div class="col-md-6">
         {% with heading='Parent Prefixes' %}

+ 2 - 8
netbox/templates/ipam/prefix.html

@@ -99,16 +99,10 @@
                     <td>IP Addresses</td>
                     <td><a href="{% url 'ipam:prefix_ipaddresses' pk=prefix.pk %}">{{ ipaddress_count }}</a></td>
                 </tr>
-                <tr>
-                    <td>Created</td>
-                    <td>{{ prefix.created }}</td>
-                </tr>
-                <tr>
-                    <td>Last Updated</td>
-                    <td>{{ prefix.last_updated }}</td>
-                </tr>
             </table>
         </div>
+        {% include 'inc/created_updated.html' with obj=prefix %}
+        <br />
 	</div>
 	<div class="col-md-7">
         {% if duplicate_prefix_table.rows %}

+ 1 - 8
netbox/templates/ipam/vlan.html

@@ -108,16 +108,9 @@
                         {% endif %}
                     </td>
                 </tr>
-                <tr>
-                    <td>Created</td>
-                    <td>{{ vlan.created }}</td>
-                </tr>
-                <tr>
-                    <td>Last Updated</td>
-                    <td>{{ vlan.last_updated }}</td>
-                </tr>
 		    </table>
         </div>
+        {% include 'inc/created_updated.html' with obj=vlan %}
 	</div>
 	<div class="col-md-6">
         <div class="panel panel-default">

+ 1 - 8
netbox/templates/ipam/vrf.html

@@ -80,16 +80,9 @@
                         {% endif %}
                     </td>
                 </tr>
-                <tr>
-                    <td>Created</td>
-                    <td>{{ vrf.created }}</td>
-                </tr>
-                <tr>
-                    <td>Last Updated</td>
-                    <td>{{ vrf.last_updated }}</td>
-                </tr>
 		    </table>
         </div>
+        {% include 'inc/created_updated.html' with obj=vrf %}
 	</div>
 	<div class="col-md-6">
         <div class="panel panel-default">

+ 1 - 8
netbox/templates/secrets/secret.html

@@ -56,16 +56,9 @@
                         {% endif %}
                     </td>
                 </tr>
-                <tr>
-                    <td>Created</td>
-                    <td>{{ secret.created }}</td>
-                </tr>
-                <tr>
-                    <td>Last Updated</td>
-                    <td>{{ secret.last_updated }}</td>
-                </tr>
             </table>
         </div>
+        {% include 'inc/created_updated.html' with obj=secret %}
 	</div>
 	<div class="col-md-6">
         {% if secret|decryptable_by:request.user %}

+ 1 - 8
netbox/templates/tenancy/tenant.html

@@ -63,14 +63,6 @@
                         {% endif %}
                     </td>
                 </tr>
-                <tr>
-                    <td>Created</td>
-                    <td>{{ tenant.created }}</td>
-                </tr>
-                <tr>
-                    <td>Last Updated</td>
-                    <td>{{ tenant.last_updated }}</td>
-                </tr>
             </table>
         </div>
         <div class="panel panel-default">
@@ -85,6 +77,7 @@
                 {% endif %}
             </div>
         </div>
+        {% include 'inc/created_updated.html' with obj=tenant %}
 	</div>
 	<div class="col-md-5">
         <div class="panel panel-default">

+ 1 - 0
netbox/templates/users/userkey.html

@@ -31,6 +31,7 @@
                     Edit user key
                 </a>
             </div>
+            {% include 'inc/created_updated.html' with obj=userkey %}
         {% else %}
             <p>You don't have a user key on file.</p>
             <p>