<commit_before>{% extends 'RandoAmisSecours/base.html' %}
{% load i18n %}

{% block title %}{% trans "Search friends" %}{% endblock %}

{% block breadcrumb %}
  <li><a href="{% url 'index' %}">{% trans "Home" %}</a> <span class="divider">/</span></li>
  <li><a href="#">{% trans "Friends" %}</a> <span class="divider">/</span></li>
  <li class="active">{% trans "Search" %}</li>
{% endblock %}

{% block body %}
<div class="page-header">
  <h2>{% trans "Search friends" %}</h2>
</div>

<div class="row">
  {% if messages %}
  <div class="span12">
    {% for message in messages %}
    <div class="alert alert-{{ message.tags|default:'error' }}">
      <button type="button" class="close" data-dismiss="alert"><i class="icon-remove"></i></button>
      <strong>{{ message.tags|default:'error'|capfirst }}:</strong> {{ message }}
    </div>
    {% endfor %}
  </div>
  {% endif %}

  <div class="span8 offset2">
    <p>{% trans "Search for friends using the field below." %}</p>
    <form action="." method="get" class="form-search">
      <div class="input-append">
        <input type="text" name="query" class="input-medium search-query" autofocus="autofocus" placeholder="{% trans "Search" %}">
        <button type="submit" class="btn"><i class="icon-search"></i></button>
      </div>
    </form>
  </div>
  <div class="span8 offset2">
    {% if query %}
    <table class="table table-striped">
      <thead>
        <tr>
          <th>{% trans "Name" %}</th>
          <th width="10%"></th>
        </tr>
      </thead>
      <tbody>
      {% for profile in results %}
        <tr>
          <td>{{ profile.user.get_full_name }}</td>
          <td>{% if profile not in user.profile.friends.all %}<a href="{% url 'friends.invite' profile.user.pk %}" class="btn btn-mini btn-success" title="invite"><i class="icon-plus"></i></a>{% endif %}</td>
        </tr>
      {% endfor %}
      </tbody>
    </table>
    {% endif %}
  </div>
</div>
{% endblock %}<commit_msg>Friend search: print a message when no user match<commit_after>{% extends 'RandoAmisSecours/base.html' %}
{% load i18n %}

{% block title %}{% trans "Search friends" %}{% endblock %}

{% block breadcrumb %}
  <li><a href="{% url 'index' %}">{% trans "Home" %}</a> <span class="divider">/</span></li>
  <li><a href="#">{% trans "Friends" %}</a> <span class="divider">/</span></li>
  <li class="active">{% trans "Search" %}</li>
{% endblock %}

{% block body %}
<div class="page-header">
  <h2>{% trans "Search friends" %}</h2>
</div>

<div class="row">
  {% if messages %}
  <div class="span12">
    {% for message in messages %}
    <div class="alert alert-{{ message.tags|default:'error' }}">
      <button type="button" class="close" data-dismiss="alert"><i class="icon-remove"></i></button>
      <strong>{{ message.tags|default:'error'|capfirst }}:</strong> {{ message }}
    </div>
    {% endfor %}
  </div>
  {% endif %}

  <div class="span8 offset2">
    <p>{% trans "Search for friends using the field below." %}</p>
    <form action="." method="get" class="form-search">
      <div class="input-append">
        <input type="text" name="query" class="input-medium search-query" autofocus="autofocus" placeholder="{% trans "Search" %}">
        <button type="submit" class="btn"><i class="icon-search"></i></button>
      </div>
    </form>
  </div>
  <div class="span8 offset2">
    {% if query %}
    {% if results %}
    <table class="table table-striped">
      <thead>
        <tr>
          <th>{% trans "Name" %}</th>
          <th width="10%"></th>
        </tr>
      </thead>
      <tbody>
      {% for profile in results %}
        <tr>
          <td>{{ profile.user.get_full_name }}</td>
          <td>{% if profile not in user.profile.friends.all %}<a href="{% url 'friends.invite' profile.user.pk %}" class="btn btn-mini btn-success" title="invite"><i class="icon-plus"></i></a>{% endif %}</td>
        </tr>
      {% endfor %}
      </tbody>
    </table>
    {% else %}
    <p>{% trans "No matching user" %}</p>
    {% endif %}
    {% endif %}
  </div>
</div>
{% endblock %}
{'fraction_non_alphanumeric': 0.23228346456692914, 'fraction_numerical': 0.005905511811023622, 'mean_word_length': 3.065, 'pattern_counts': {'":': 0, '<': 139, '<?xml version=': 0, '>': 139, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4554394', 'n_tokens_mistral': 1479, 'n_tokens_neox': 1361, 'n_words': 338}