fix: hide relationship buttons on own profile page

This commit is contained in:
James Graham
2021-04-26 20:29:22 +01:00
parent 123a123050
commit d5f85c84c8
3 changed files with 56 additions and 50 deletions

View File

@@ -22,6 +22,7 @@
<h1>{{ person.name }}</h1>
{% if person.user != request.user %}
<hr>
<div class="row justify-content-md-center">
@@ -46,6 +47,7 @@
</div>
{% endif %}
</div>
{% endif %}
<hr>

View File

@@ -22,6 +22,7 @@
<h1>{{ person.name }}</h1>
{% if person.user != request.user %}
<hr>
<div class="row justify-content-md-center">
@@ -46,6 +47,7 @@
</div>
{% endif %}
</div>
{% endif %}
<hr>

View File

@@ -37,6 +37,7 @@
<a class="btn btn-sm btn-info"
href="{% url 'people:person.detail' pk=person.pk %}">Profile</a>
{% if person.user != request.user %}
{% if person.pk in existing_relationships %}
<a class="btn btn-sm btn-warning"
style="width: 10rem"
@@ -49,6 +50,7 @@
href="{% url 'people:person.relationship.create' person_pk=person.pk %}">New Relationship
</a>
{% endif %}
{% endif %}
</td>
</tr>