Skip to content

Commit

Permalink
ubccr#291: Notifications can be enabled or disabled for Users under a…
Browse files Browse the repository at this point in the history
… project with a 'select all' button in the 'Users' section of the 'Project Details' template
  • Loading branch information
brisco17 committed May 27, 2021
1 parent 941e87a commit f9b9c1a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion coldfront/core/project/templates/project/project_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ <h3 class="d-inline" id="users"><i class="fas fa-users" aria-hidden="true"></i>
<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, 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">Status</th>
<th scope="col">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">Enable Notifications <input type="checkbox" class="check" id="selectAll"><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>
</tr>
</thead>
Expand Down Expand Up @@ -440,6 +440,10 @@ <h3 class="d-inline"><i class="fas fa-users" aria-hidden="true"></i> Messages fr
}]
});

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

$("[id^=email_notifications_for_user_id_]").change(function() {
var checked = $(this).prop('checked');
var user_project_id = Number($(this).attr('id').split("_").pop());
Expand Down

0 comments on commit f9b9c1a

Please sign in to comment.