<commit_before>{% from "macros/links.jinja" import club_link %}

{% extends "base-page.jinja" %}


{% block title -%}
{% if search_text -%}
{% trans %}Search <small>for "{{ search_text }}"</small>{% endtrans %}
{%- else -%}
{% trans %}Search{% endtrans %}
{%- endif %}
{%- endblock %}


{% block content -%}
<table class="table table-striped search-results">
  <tbody>
    {% for result in results -%}
    <tr>
      <td class="column-icon">{{ result_icon(result) }}</td>
      <td class="column-type"><small>{{ result_type(result) }}</small></td>
      <td>{{ result_title(result) }}</td>
      <td class="column-buttons">{{ result_buttons(result) }}</td>
    </tr>
    {%- endfor %}
  </tbody>
</table>
{%- endblock %}


{% macro result_icon(result) -%}
{% if result.model == 'User' -%}
  <i class="icon-user" title="{{ _('Pilot') }}"></i>
{%- elif result.model == 'Club' -%}
  <i class="icon-group" title="{{ _('Club') }}"></i>
{%- elif result.model == 'Airport' -%}
  <i class="icon-map-marker" title="{{ _('Airport') }}"></i>
{%- endif %}
{%- endmacro %}

{% macro result_type(result) -%}
{% if result.model == 'User' -%}
  {{ _('Pilot') }}
{%- elif result.model == 'Club' -%}
  {{ _('Club') }}
{%- elif result.model == 'Airport' -%}
  {{ _('Airport') }}
{%- endif %}
{%- endmacro %}

{% macro result_title(result) -%}
{% if result.model == 'User' -%}
  <a href="/users/{{ result.id }}">{{ result.name }}</a>
{%- elif result.model == 'Club' -%}
  <a href="/clubs/{{ result.id }}">{{ result.name }}</a>
{%- elif result.model == 'Airport' -%}
  <a href="/flights/airport/{{ result.id }}">{{ result.name }}</a>
{%- endif %}
{%- endmacro %}

{% macro result_buttons(result) -%}
{% if result.model == 'User' -%}
  <a href="/flights/pilot/{{ result.id }}" class="btn btn-mini"><i class="icon-plane"></i> {{ _('Flights') }}</a>
  <a href="/statistics/pilot/{{ result.id }}" class="btn btn-mini"><i class="icon-tasks"></i> {{ _('Statistics') }}</a>
{%- elif result.model == 'Club' -%}
  <a href="/flights/club/{{ result.id }}" class="btn btn-mini"><i class="icon-plane"></i> {{ _('Flights') }}</a>
  <a href="/statistics/club/{{ result.id }}" class="btn btn-mini"><i class="icon-tasks"></i> {{ _('Statistics') }}</a>
{%- elif result.model == 'Airport' -%}
  <a href="/flights/airport/{{ result.id }}" class="btn btn-mini"><i class="icon-plane"></i> {{ _('Flights') }}</a>
  <a href="/statistics/airport/{{ result.id }}" class="btn btn-mini"><i class="icon-tasks"></i> {{ _('Statistics') }}</a>
{%- endif %}
{%- endmacro %}
<commit_msg>templates/search: Show "no results" message<commit_after>{% from "macros/links.jinja" import club_link %}

{% extends "base-page.jinja" %}


{% block title -%}
{% if search_text -%}
{% trans %}Search <small>for "{{ search_text }}"</small>{% endtrans %}
{%- else -%}
{% trans %}Search{% endtrans %}
{%- endif %}
{%- endblock %}


{% block content -%}
<table class="table table-striped search-results">
  <tbody>
    {% for result in results -%}
    <tr>
      <td class="column-icon">{{ result_icon(result) }}</td>
      <td class="column-type"><small>{{ result_type(result) }}</small></td>
      <td>{{ result_title(result) }}</td>
      <td class="column-buttons">{{ result_buttons(result) }}</td>
    </tr>
    {%- else -%}
    <tr>
      <td colspan="4">{{ _('There were no results for your search... Sorry!') }}</td>
    </tr>
    {%- endfor %}
  </tbody>
</table>
{%- endblock %}


{% macro result_icon(result) -%}
{% if result.model == 'User' -%}
  <i class="icon-user" title="{{ _('Pilot') }}"></i>
{%- elif result.model == 'Club' -%}
  <i class="icon-group" title="{{ _('Club') }}"></i>
{%- elif result.model == 'Airport' -%}
  <i class="icon-map-marker" title="{{ _('Airport') }}"></i>
{%- endif %}
{%- endmacro %}

{% macro result_type(result) -%}
{% if result.model == 'User' -%}
  {{ _('Pilot') }}
{%- elif result.model == 'Club' -%}
  {{ _('Club') }}
{%- elif result.model == 'Airport' -%}
  {{ _('Airport') }}
{%- endif %}
{%- endmacro %}

{% macro result_title(result) -%}
{% if result.model == 'User' -%}
  <a href="/users/{{ result.id }}">{{ result.name }}</a>
{%- elif result.model == 'Club' -%}
  <a href="/clubs/{{ result.id }}">{{ result.name }}</a>
{%- elif result.model == 'Airport' -%}
  <a href="/flights/airport/{{ result.id }}">{{ result.name }}</a>
{%- endif %}
{%- endmacro %}

{% macro result_buttons(result) -%}
{% if result.model == 'User' -%}
  <a href="/flights/pilot/{{ result.id }}" class="btn btn-mini"><i class="icon-plane"></i> {{ _('Flights') }}</a>
  <a href="/statistics/pilot/{{ result.id }}" class="btn btn-mini"><i class="icon-tasks"></i> {{ _('Statistics') }}</a>
{%- elif result.model == 'Club' -%}
  <a href="/flights/club/{{ result.id }}" class="btn btn-mini"><i class="icon-plane"></i> {{ _('Flights') }}</a>
  <a href="/statistics/club/{{ result.id }}" class="btn btn-mini"><i class="icon-tasks"></i> {{ _('Statistics') }}</a>
{%- elif result.model == 'Airport' -%}
  <a href="/flights/airport/{{ result.id }}" class="btn btn-mini"><i class="icon-plane"></i> {{ _('Flights') }}</a>
  <a href="/statistics/airport/{{ result.id }}" class="btn btn-mini"><i class="icon-tasks"></i> {{ _('Statistics') }}</a>
{%- endif %}
{%- endmacro %}

{'fraction_non_alphanumeric': 0.2893021472392638, 'fraction_numerical': 0.00019171779141104295, 'mean_word_length': 3.7818515123739687, 'pattern_counts': {'":': 0, '<': 115, '<?xml version=': 0, '>': 115, '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': '4652454', 'n_tokens_mistral': 2108, 'n_tokens_neox': 1929, 'n_words': 394}