Skip to content

Commit

Permalink
Merge pull request #301 from brisco17/#291-notifications-selectall
Browse files Browse the repository at this point in the history
User Notifications 'select-all' button
  • Loading branch information
aebruno committed Jul 23, 2021
2 parents a01dd6e + 03f2d4f commit 9529d0d
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" 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>
</tr>
</thead>
Expand Down Expand Up @@ -452,6 +452,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 @@ -474,4 +478,4 @@ <h3 class="d-inline"><i class="fas fa-users" aria-hidden="true"></i> Messages fr
});
});
</script>
{% endblock %}
{% endblock %}

0 comments on commit 9529d0d

Please sign in to comment.