Skip to content

Commit

Permalink
fix allocationchangerequest list
Browse files Browse the repository at this point in the history
  • Loading branch information
claire-peters committed Jun 20, 2023
1 parent f8c6e11 commit 374699a
Showing 1 changed file with 23 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ <h2>Allocation Change Requests</h2>
<th scope="col">PI</th>
<th scope="col">Resource</th>
<th scope="col">Extension</th>
<th scope="col">Changes</th>
<th scope="col">Actions</th>
</tr>
</thead>
Expand All @@ -44,27 +45,37 @@ <h2>Allocation Change Requests</h2>
({{change.allocation.project.pi.username}})</td>
<td>{{change.allocation.get_parent_resource}}</td>
<td>
{% if change.end_date_extension == 0 %}
{% if change.end_date_extension != 0 %}
{% else %} {{change.end_date_extension}} days
{% endif %}
</td>
<td class="text-nowrap">
<form method="post" action="{% url 'allocation-change-detail' change.pk %}">

<td>
{% if change.allocationattributechangerequest_set.all %}
{% for attr_change in change.allocationattributechangerequest_set.all %}
{{ attr_change }} ({{attr_change.allocation_attribute.value }} to {{ attr_change.new_value }})
{% endfor %}
{% endif %}
</td>
<td class="text-nowrap">
<div class="row">
{% if change.allocationattributechangerequest_set.all %}
<button class="btn btn-success mr-1" aria-disabled="true"
style="
cursor: not-allowed;
opacity: 0.6;
pointer-events: none;">
Approve
</button>
{% else %}
style="
cursor: not-allowed;
opacity: 0.6;
pointer-events: none;">
Approve
</button>
{% else %}
<form method="post" action="{% url 'allocation-change-detail' change.pk %}">
{% csrf_token %}
<input type="hidden" name="end_date_extension" value="{{ change.end_date_extension }}" />
<button type="submit" name="action" value="approve" class="btn btn-success mr-1">Approve</button>
{% endif %}
<a href="{% url 'allocation-change-detail' change.pk %}"><button class="btn btn-primary mr-1">Details</button></a>
</form>
{% endif %}
<a href="{% url 'allocation-change-detail' change.pk %}"><button class="btn btn-primary mr-1">Details</button></a>
</div>
</td>
</tr>
{% endfor %}
Expand Down

0 comments on commit 374699a

Please sign in to comment.