diff --git a/CHANGELOG.md b/CHANGELOG.md index 196db889..1cb9ceef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ All notable changes to this project will be documented in this file. ### Bug Fixes - Fix unwanted special character escaping in notification messages (#606) - Fix JS error after copying a code snippet +- Make email non-editable in the "Invite Member" dialog when team limit reached ## v1.25.0 - 2022-01-07 diff --git a/hc/accounts/views.py b/hc/accounts/views.py index 4e220816..b75a52f0 100644 --- a/hc/accounts/views.py +++ b/hc/accounts/views.py @@ -493,6 +493,7 @@ def project(request, code): q = project.member_set.select_related("user").order_by("user__email") ctx["memberships"] = list(q) + ctx["can_invite_new_users"] = project.can_invite_new_users() return render(request, "accounts/project.html", ctx) diff --git a/static/js/project.js b/static/js/project.js index e1d13421..82a00ab2 100644 --- a/static/js/project.js +++ b/static/js/project.js @@ -18,6 +18,7 @@ $(function() { $(".add-to-team").click(function() { $("#itm-email").val(this.dataset.email); + $("#itm-email-display").text(this.dataset.email); $("#invite-team-member-modal").modal("show"); return false; }); diff --git a/templates/accounts/project.html b/templates/accounts/project.html index cdbb40d9..890f474d 100644 --- a/templates/accounts/project.html +++ b/templates/accounts/project.html @@ -257,7 +257,7 @@ <br /> {% if is_manager %} - {% if project.can_invite_new_users %} + {% if can_invite_new_users %} <a href="#" class="btn btn-primary pull-right" @@ -445,6 +445,7 @@ <div class="form-group"> <label for="itm-email" class="col-sm-3 control-label">Email</label> <div class="col-sm-8"> + {% if can_invite_new_users %} <input type="email" class="form-control" @@ -452,6 +453,10 @@ name="email" maxlength="254" placeholder="friend@example.org"> + {% else %} + <p id="itm-email-display" class="form-control-static"></p> + <input type="hidden" id="itm-email" name="email"> + {% endif %} </div> </div>