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 Jun 2, 2021
1 parent 941e87a commit 4e3c758
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions 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"><input type="checkbox" class="check" id="selectAll">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>
</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 All @@ -462,4 +466,4 @@ <h3 class="d-inline"><i class="fas fa-users" aria-hidden="true"></i> Messages fr
});
});
</script>
{% endblock %}
{% endblock %}

0 comments on commit 4e3c758

Please sign in to comment.