{% extends "profiles/base.html" %}
{% load i18n %}
{% load profile_tags %}

{% block title %}{% trans 'Similar Users'%}{% endblock %}

{% block extra_head %}
{{ block.super }}
<link rel="stylesheet" href="{{ STATIC_URL }}css/iconrow.css">
<link rel="stylesheet" href="{{ STATIC_URL }}css/forms.css">
<link rel="stylesheet" href="{{ STATIC_URL }}css/profiles.css">

{% endblock %}

{% block body %}
{{ block.super }}
<div class="t">
{% users_nav request.user user_this %}
    <form class="search-form" action="" method="get">
    <input type="text" name="q" value="{{ request.GET.q|striptags }}" />
    <input type="submit" value="Search" />
    </form>

    {% if users_with_duplicate_name %}
    <div class="similar_group">
    <h3>{% trans "Users with Same Names" %}</h3>
    {% for users in users_with_duplicate_name %}
        {% similar_profile_items users %}
    {% endfor %}
    </div>
    {% endif %}

    {% if users_with_duplicate_email %}
    <div class="similar_group">
    <h3>{% trans "Users with Same Email" %}</h3>
    {% for users in users_with_duplicate_email %}
        {% similar_profile_items users %}
    {% endfor %}
    </div>
    {% endif %}

    {% if not users_with_duplicate_name and not users_with_duplicate_email %}
    <h3>{% trans "No similar users found" %}
    {% endif %}
    
    {% if num_pages > 1%}
    <div id="import-paginate">
        {% if prev %}
        <a href="?page={{ prev }}">Prev</a>
        {% else %}
        Prev
         {% endif %}
         
        {% for page in page_range %}
            {% if page = '...' %}
                {{ page }}
            {% else %}
                {% if page == curr_page %}
                <strong>{{ page }}</strong>
                {% else %}
                <a href="?page={{ page }}">{{ page }}</a>
                {% endif %}
            {% endif %}
        {% endfor %}
        
        {% if curr_page >= num_pages  %}
        Next
        {% else %}
        <a href="?page={{ next }}">Next</a>
         {% endif %}
    </div>
    {% endif %}

</div>
{% endblock %}
