Prepare Specs UI for Windows review
This commit is contained in:
@@ -42,11 +42,17 @@
|
||||
<td>{{ resource.module.name if resource.module else 'N/A' }}</td>
|
||||
<td>{{ resource.quantity }}</td>
|
||||
<td>
|
||||
{% set allocated = resource.resource_allocations|sum(attribute='quantity', default=0) %}
|
||||
{% set allocated = 0 %}
|
||||
{% for allocation in resource.resource_allocations %}
|
||||
{% set allocated = allocated + allocation.quantity %}
|
||||
{% endfor %}
|
||||
{{ allocated }}
|
||||
</td>
|
||||
<td>
|
||||
{% set allocated = resource.resource_allocations|sum(attribute='quantity', default=0) %}
|
||||
{% set allocated = 0 %}
|
||||
{% for allocation in resource.resource_allocations %}
|
||||
{% set allocated = allocated + allocation.quantity %}
|
||||
{% endfor %}
|
||||
{% set remaining = resource.quantity - allocated %}
|
||||
<span class="badge {% if remaining <= 0 %}bg-danger{% elif remaining < 100 %}bg-warning{% else %}bg-success{% endif %}">
|
||||
{{ remaining }}
|
||||
|
||||
Reference in New Issue
Block a user