From d5f85c84c8c4e8605849de416ad0271d38518858 Mon Sep 17 00:00:00 2001 From: James Graham Date: Mon, 26 Apr 2021 20:29:22 +0100 Subject: [PATCH] fix: hide relationship buttons on own profile page --- .../templates/people/person/detail_full.html | 42 ++++++++++--------- .../people/person/detail_partial.html | 42 ++++++++++--------- people/templates/people/person/list.html | 22 +++++----- 3 files changed, 56 insertions(+), 50 deletions(-) diff --git a/people/templates/people/person/detail_full.html b/people/templates/people/person/detail_full.html index bbc7945..ff80350 100644 --- a/people/templates/people/person/detail_full.html +++ b/people/templates/people/person/detail_full.html @@ -22,30 +22,32 @@

{{ person.name }}

-
+ {% if person.user != request.user %} +
+ +
+
+ {% if relationship %} + Update Relationship + + + {% else %} + New Relationship + + {% endif %} +
-
-
{% if relationship %} - Update Relationship - - - {% else %} - New Relationship - + {% endif %}
- - {% if relationship %} - - {% endif %} -
+ {% endif %}
diff --git a/people/templates/people/person/detail_partial.html b/people/templates/people/person/detail_partial.html index 3d5e146..84c6060 100644 --- a/people/templates/people/person/detail_partial.html +++ b/people/templates/people/person/detail_partial.html @@ -22,30 +22,32 @@

{{ person.name }}

-
+ {% if person.user != request.user %} +
+ +
+
+ {% if relationship %} + Update Relationship + + + {% else %} + New Relationship + + {% endif %} +
-
-
{% if relationship %} - Update Relationship - - - {% else %} - New Relationship - + {% endif %}
- - {% if relationship %} - - {% endif %} -
+ {% endif %}
diff --git a/people/templates/people/person/list.html b/people/templates/people/person/list.html index 77502bd..a8bf1b9 100644 --- a/people/templates/people/person/list.html +++ b/people/templates/people/person/list.html @@ -37,17 +37,19 @@ Profile - {% if person.pk in existing_relationships %} - Update Relationship - + {% if person.user != request.user %} + {% if person.pk in existing_relationships %} + Update Relationship + - {% else %} - New Relationship - + {% else %} + New Relationship + + {% endif %} {% endif %}