forked from ubccr/coldfront
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #368 from ucb-rit/issue_361
Issue 361 - request hub
- Loading branch information
Showing
25 changed files
with
1,886 additions
and
597 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
130 changes: 130 additions & 0 deletions
130
...t/core/allocation/templates/allocation/allocation_cluster_account_request_list_table.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
<table class="table table-sm"> | ||
<thead> | ||
<tr> | ||
<th scope="col"> | ||
# | ||
<a href="?order_by=id&direction=asc&{{filter_parameters}}"><i class="fas fa-sort-up"></i></a> | ||
<a href="?order_by=id&direction=des&{{filter_parameters}}"><i class="fas fa-sort-down"></i></a> | ||
</th> | ||
<th scope="col"> | ||
Date Requested/<br>Last Modified | ||
<a href="?order_by=created&direction=asc&{{filter_parameters}}"><i class="fas fa-sort-up"></i></a> | ||
<a href="?order_by=created&direction=des&{{filter_parameters}}"><i class="fas fa-sort-down"></i></a> | ||
</th> | ||
<th scope="col"> | ||
User Email | ||
<a href="?order_by=allocation_user__user__email&direction=asc&{{filter_parameters}}"><i class="fas fa-sort-up"></i></a> | ||
<a href="?order_by=allocation_user__user__email&direction=des&{{filter_parameters}}"><i class="fas fa-sort-down"></i></a> | ||
</th> | ||
<th scope="col"> | ||
Cluster Username | ||
<a href="?order_by=allocation_user__user__username&direction=asc&{{filter_parameters}}"><i class="fas fa-sort-up"></i></a> | ||
<a href="?order_by=allocation_user__user__username&direction=des&{{filter_parameters}}"><i class="fas fa-sort-down"></i></a> | ||
</th> | ||
<th scope="col"> | ||
Project | ||
<a href="?order_by=allocation__project__name&direction=asc&{{filter_parameters}}"><i class="fas fa-sort-up"></i></a> | ||
<a href="?order_by=allocation__project__name=des&{{filter_parameters}}"><i class="fas fa-sort-down"></i></a> | ||
</th> | ||
<th scope="col"> | ||
Allocation | ||
</th> | ||
<th scope="col"> | ||
Status | ||
</th> | ||
{% if user.is_superuser and actions_visible %} | ||
<th scope="col"> | ||
Allocation Actions | ||
</th> | ||
{% endif %} | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for cluster_account in queryset %} | ||
<tr> | ||
<td>{{ cluster_account.pk }}</td> | ||
<td>{{ cluster_account.modified|date:"M. d, Y" }}</td> | ||
<td>{{ cluster_account.allocation_user.user.email }}</td> | ||
<td> | ||
{% if cluster_account.allocation_user.user.userprofile.cluster_uid %} | ||
{{ cluster_account.allocation_user.user.username }} | ||
{% else %} | ||
<span class="badge badge-danger"> | ||
No cluster account. | ||
</span> | ||
{% endif %} | ||
</td> | ||
<td> | ||
<a href="{% url 'project-detail' cluster_account.allocation.project.pk %}"> | ||
{{ cluster_account.allocation.project.name }} | ||
</a> | ||
</td> | ||
<td> | ||
<a href="{% url 'allocation-detail' cluster_account.allocation.pk %}"> | ||
<span class="accessibility-link-text">Allocation {{ allocation.pk }}</span> | ||
{{ cluster_account.allocation.pk }} | ||
</a> | ||
</td> | ||
<td> | ||
{% with status=cluster_account.value %} | ||
{% if status == "Pending - Add" %} | ||
<span class="badge badge-warning">Pending</span> | ||
{% elif status == "Processing" %} | ||
<span class="badge badge-warning">{{ status }}</span> | ||
{% elif status == "Active" %} | ||
<span class="badge badge-success">{{ status }}</span> | ||
{% elif status == "Denied" %} | ||
<span class="badge badge-danger">{{ status }}</span> | ||
{% endif %} | ||
{% endwith %} | ||
</td> | ||
{% if user.is_superuser and actions_visible %} | ||
<td class="text-nowrap"> | ||
{% if cluster_account.value == "Pending - Add" %} | ||
<a href="{% url 'allocation-cluster-account-update-status' cluster_account.pk %}" class="btn btn-success mr-1"> | ||
Activate | ||
</a> | ||
{% else %} | ||
<a href="{% url 'allocation-cluster-account-activate-request' cluster_account.pk %}" class="btn btn-success mr-1"> | ||
Activate | ||
</a> | ||
{% endif %} | ||
<div class="modal fade" id="denial{{ cluster_account.pk }}Modal" tabindex="-1" role="dialog" aria-labelledby="denial{{ cluster_account.pk }}ModalLabel" aria-hidden="true"> | ||
<div class="modal-dialog" role="document"> | ||
<form action="{% url 'allocation-cluster-account-deny-request' cluster_account.pk %}" method="get" id="denial{{ cluster_account.pk }}Form"> | ||
{% csrf_token %} | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<p class="modal-title">Deny Request</p> | ||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> | ||
<span aria-hidden="true">×</span> | ||
</button> | ||
</div> | ||
|
||
<div class="modal-body"> | ||
<label>Are You Sure?</label> | ||
|
||
<br><b>User:</b> {{ cluster_account.allocation_user.user.email }} | ||
<br><b>Project:</b> {{ cluster_account.allocation.project.name }} | ||
<br><b>Allocation:</b> {{ cluster_account.allocation.pk }} | ||
</div> | ||
|
||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> | ||
<button class="btn btn-danger mr-1" type="submit"> | ||
Yes, deny this request. | ||
</button> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
<button class="btn btn-danger mr-1" data-toggle="modal" data-target="#denial{{ cluster_account.pk }}Modal"> | ||
Deny | ||
</button> | ||
</td> | ||
{% endif %} | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.