show period if dates exist

This commit is contained in:
Arvind Tiwari 2017-09-28 02:47:58 +05:30
parent df67fa3333
commit 3ba1f191a3

View file

@ -98,10 +98,12 @@
</p> </p>
<div class="row"> <div class="row">
<div class="col-sm-6"> <div class="col-sm-6">
<p> {% if vm.created_at %}
<span>{% trans "Period" %}: </span> <p>
<span>{{ vm.created_at|date:'Y/m/d' }} - {% if vm.terminated_at %}{{ vm.terminated_at|date:'Y/m/d' }}{% else %}{% now 'Y/m/d' %}{% endif %}</span> <span>{% trans "Period" %}: </span>
</p> <span>{{ vm.created_at|date:'Y/m/d' }} - {% if vm.terminated_at %}{{ vm.terminated_at|date:'Y/m/d' }}{% else %}{% now 'Y/m/d' %}{% endif %}</span>
</p>
{% endif %}
<p> <p>
<span>{% trans "Cores" %}: </span> <span>{% trans "Cores" %}: </span>
{% if vm.cores %} {% if vm.cores %}