Skip to content

Commit 2219748

Browse files
committed
Added friends list buttons
1 parent dfeb256 commit 2219748

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

home/templates/home/home.html

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,20 @@ <h2>Other People</h2>
2222
<a href="{% url 'accounts:view_profile_with_pk' pk=user.pk %}">
2323
<h3>{{ user.username }}</h3>
2424
</a>
25+
{% if not user in friends %}
26+
<a href="{% url 'home:change_friends' operation='add' pk=user.pk %}">
27+
<button type="button" class="btn btn-success">Add Friend</button>
28+
</a>
29+
{% endif %}
2530
{% endfor %}
2631
<h2>Friends</h2>
2732
{% for friend in friends %}
28-
<a href="{% url 'accounts:view_profile_with_pk' pk=user.pk %}">
33+
<a href="{% url 'accounts:view_profile_with_pk' pk=friend.pk %}">
2934
<h3>{{ friend.username }}</h3>
3035
</a>
36+
<a href="{% url 'home:change_friends' operation='remove' pk=friend.pk %}">
37+
<button type="button" class="btn btn-default">Remove Friend</button>
38+
</a>
3139
{% endfor %}
3240
</div>
3341
</div>

0 commit comments

Comments
 (0)