Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project Detail User Sorting #462

Merged
merged 2 commits into from
Dec 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 18 additions & 9 deletions coldfront/core/project/templates/project/project_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,25 @@ <h3 class="d-inline" id="users"><i class="fas fa-users" aria-hidden="true"></i>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-hover">
<table id="projectuser_table" class="table table-hover">
<thead>
<tr>
<th scope="col">Username</th>
<th scope="col">Name</th>
<th scope="col">Email</th>
<th scope="col">Role <a href="#" data-toggle="popover" title="Role" data-trigger="hover" data-content="Manager role grants user access to add & remove users, attributes, publications, grants, & research output to the project and request/renew allocations."><i class="fas fa-info-circle" aria-hidden="true"></i><span class="sr-only">Manager role grants user access to add & remove users, attributes, publications, grants, & research output to the project and request/renew allocations.</span></a></th>
<th scope="col">Status</th>
<th scope="col"><input type="checkbox" class="check" id="selectAll" style="margin-right: 5px;">Enable Notifications <a href="#" title="Enable Notifications" data-toggle="popover" data-trigger="hover" data-content="When disabled, user will not receive notifications for allocation requests and expirations or cloud usage (if applicable)."><i class="fas fa-info-circle" aria-hidden="true"></i><span class="sr-only">When disabled, user will not receive notifications for allocation requests and expirations or cloud usage (if applicable).</span></a></th>
<th scope="col">Actions</th>
<th scope="col" class="text-nowrap">Username</th>
<th scope="col" class="text-nowrap">First Name</th>
<th scope="col" class="text-nowrap">Last Name</th>
<th scope="col" class="text-nowrap">Email</th>
<th scope="col" class="text-nowrap">Role <a href="#" data-toggle="popover" title="Role" data-trigger="hover" data-content="Manager role grants user access to add/remove users, allocations, grants, and publications to the project."><i class="fas fa-info-circle" aria-hidden="true"></i><span class="sr-only">Manager role grants user access to add/remove users, allocations, grants, and publications to the project.</span></a></th>
<th scope="col" class="text-nowrap">Status</th>
<th scope="col" class="nosort"><input type="checkbox" class="check" id="selectAll" style="margin-right: 5px;">Enable Notifications <a href="#" title="Enable Notifications" data-toggle="popover" data-trigger="hover" data-content="When disabled, user will not receive notifications for allocation requests and expirations or cloud usage (if applicable)."><i class="fas fa-info-circle" aria-hidden="true"></i><span class="sr-only">When disabled, user will not receive notifications for allocation requests and expirations or cloud usage (if applicable).</span></a></th>
<th scope="col" class="nosort">Actions</th>
</tr>
</thead>
<tbody>
{% for user in project_users %}
<tr>
<td>{{ user.user.username }}</td>
<td>{{ user.user.first_name }} {{ user.user.last_name }}</td>
<td>{{ user.user.first_name }} </td>
<td>{{ user.user.last_name }}</td>
<td>{{ user.user.email }}</td>
<td>{{ user.role.name }}</td>
{% if user.status.name == 'Active' %}
Expand Down Expand Up @@ -535,6 +537,13 @@ <h3 class="d-inline"><i class="fas fa-users" aria-hidden="true"></i> Notificatio
}]
});

$('#projectuser_table').DataTable({
'aoColumnDefs': [{
'bSortable': false,
'aTargets': ['nosort']
}]
});

$("#selectAll").click(function () {
$("input[id^='email_notifications_for_user_id_']").not(":disabled").prop('checked', $(this).prop('checked')).change();
});
Expand Down