Skip to content

Commit 57b805d

Browse files
committed
Fix display of last sync time
1 parent bf88de0 commit 57b805d

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

netbox_branching/templates/netbox_branching/branch.html

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,17 @@ <h5 class="card-header">{% trans "Branch" %}</h5>
8383
<tr>
8484
<th scope="row">{% trans "Last synced" %}</th>
8585
<td>
86-
{{ object.synced_time|isodatetime }}
87-
{% if object.is_stale %}
88-
<span class="text-danger" title="{% trans "Branch is stale and can no longer be synced" %}">
89-
<i class="mdi mdi-alert-circle"></i>
90-
</span>
86+
{% if object.last_sync %}
87+
{{ object.last_sync|isodatetime }}
88+
{% if object.is_stale %}
89+
<span class="text-danger" title="{% trans "Branch is stale and can no longer be synced" %}">
90+
<i class="mdi mdi-alert-circle"></i>
91+
</span>
92+
{% endif %}
93+
<div class="small text-muted">{{ object.last_sync|timesince }} {% trans "ago" %}</div>
94+
{% else %}
95+
{{ ''|placeholder }}
9196
{% endif %}
92-
<div class="small text-muted">{{ object.synced_time|timesince }} {% trans "ago" %}</div>
9397
</td>
9498
</tr>
9599
<tr>

0 commit comments

Comments
 (0)