Add friend

This commit is contained in:
cuom1999 2020-06-23 20:46:33 -05:00
parent 5298e6aaa5
commit e951c761f5
12 changed files with 158 additions and 14 deletions

View file

@ -16,7 +16,11 @@
{% block title_ruler %}{% endblock %}
{% block title_row %}
{% set tab = 'list' %}
{% if request.GET.get('friend') == 'true'%}
{% set tab = 'friends' %}
{% else %}
{% set tab = 'list' %}
{% endif %}
{% set title = 'Leaderboard' %}
{% include "user/user-list-tabs.html" %}
{% endblock %}

View file

@ -9,6 +9,20 @@
{% block user_content %}
<div class="content-description">
{% if request.user != user.user %}
<form method="post">
{% csrf_token %}
<button class="{{ 'unfollow' if followed else 'follow' }}">
{% if followed %}
<i class="fa fa-remove"></i>
{{ _('Unfollow') }}
{% else %}
<i class="fa fa-user-plus"></i>
{{ _('Follow') }}
{% endif %}
</button>
</form>
{% endif %}
{% with orgs=user.organizations.all() %}
{% if orgs %}
<p style="margin-top: 0"><b>{{ _('From') }}</b>

View file

@ -1,6 +1,7 @@
{% extends "tabs-base.html" %}
{% block tabs %}
{{ make_tab('list', 'fa-users', url('user_list'), _('Leaderboard')) }}
{{ make_tab('list', 'fa-trophy', url('user_list'), _('Leaderboard')) }}
{{ make_tab('friends', 'fa-users', url('user_list') + '?friend=true', _('Friends')) }}
{{ make_tab('organizations', 'fa-university', url('organization_list'), _('Organizations')) }}
{% endblock %}