From 3d4e8f4088920688bfb7329bb0492f6c42afd26c Mon Sep 17 00:00:00 2001 From: leigh-mil Date: Fri, 26 Oct 2018 15:18:12 -0400 Subject: [PATCH 1/2] Add conditional logic to show Edit Account link --- atst/routes/workspaces.py | 2 ++ templates/workspaces/members/edit.html | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/atst/routes/workspaces.py b/atst/routes/workspaces.py index dbea6810..5e295b70 100644 --- a/atst/routes/workspaces.py +++ b/atst/routes/workspaces.py @@ -255,6 +255,7 @@ def view_member(workspace_id, member_id): member = WorkspaceUsers.get(workspace_id, member_id) projects = Projects.get_all(g.current_user, member, workspace) form = EditMemberForm(workspace_role=member.role) + editable = g.current_user == member.user return render_template( "workspaces/members/edit.html", workspace=workspace, @@ -264,6 +265,7 @@ def view_member(workspace_id, member_id): choices=ENVIRONMENT_ROLES, env_role_modal_description=ENV_ROLE_MODAL_DESCRIPTION, EnvironmentRoles=EnvironmentRoles, + editable=editable, ) diff --git a/templates/workspaces/members/edit.html b/templates/workspaces/members/edit.html index 0cec712b..53f17f69 100644 --- a/templates/workspaces/members/edit.html +++ b/templates/workspaces/members/edit.html @@ -30,7 +30,9 @@
{{ member.user.email }}
- edit account details + {% if editable %} + edit account details + {% endif %} From 20c50ebbfa30c963af36176855956521f2497d24 Mon Sep 17 00:00:00 2001 From: leigh-mil Date: Mon, 29 Oct 2018 09:44:43 -0400 Subject: [PATCH 2/2] Update link href --- templates/workspaces/members/edit.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/workspaces/members/edit.html b/templates/workspaces/members/edit.html index 53f17f69..339f154b 100644 --- a/templates/workspaces/members/edit.html +++ b/templates/workspaces/members/edit.html @@ -31,7 +31,7 @@ {% if editable %} - edit account details + edit account details {% endif %}