Skip to content

Commit

Permalink
moar template fix
Browse files Browse the repository at this point in the history
  • Loading branch information
claire-peters committed Nov 16, 2023
1 parent 504bd0e commit c31fc45
Showing 1 changed file with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ <h3 class="d-inline"><i class="fas fa-users" aria-hidden="true"></i> Users in Al
{% for user in allocation_users %}
{% if user.unit == "CPU Hours" %}
{% firstof user.usage as userusage %}
{% firstof allocation.usage as allocationusage %}
{% firstof allocation.size as allocationusage %}
{% else %}
{% firstof user.usage_bytes as userusage %}
{% firstof allocation.usage_exact as allocationusage %}
Expand All @@ -490,20 +490,14 @@ <h3 class="d-inline"><i class="fas fa-users" aria-hidden="true"></i> Users in Al
{% if allocationusage == None or allocationusage == 0 %}
<td>0</td>
{% else %}
{% if user.unit == "CPU Hours" %}
<td>{{userusage|div:allocation.size|mul:100|floatformat:2 }}%</td>
{% else %}
<td>{{userusage|div:allocationusage|mul:100|floatformat:2 }}%</td>
{% endif %}

{% endif %}
{% if user.unit == "CPU Hours" %}
{% cost_cpuhours userusage as cost %}
{% else %}

{% if user.unit != "CPU Hours" %}
{% cost_bytes userusage as cost %}
{% endif %}
{% if cost %}
<td>{{ cost }}</td>
{% if cost %}
<td>{{ cost }}</td>
{% endif %}
{% endif %}
</tr>
{% endfor %}
Expand Down

0 comments on commit c31fc45

Please sign in to comment.