Sith/matmat/templates/matmat/search_form.jinja

64 lines
1.9 KiB
Django/Jinja
Raw Permalink Normal View History

2017-07-23 10:54:12 +00:00
{% from "core/macros.jinja" import user_mini_profile, paginate %}
2017-07-22 20:35:01 +00:00
{% extends "core/base.jinja" %}
{% block title %}
{% trans %}Search user{% endtrans %}
{% endblock %}
{% block content %}
{% if result_exists %}
2018-06-05 22:25:27 +00:00
<h2>{% trans %}Results{% endtrans %}</h2>
<div class="matmat_results">
2017-07-22 20:35:01 +00:00
{% for user in object_list %}
2017-07-23 10:54:12 +00:00
<div class="matmat_user">
2018-06-05 22:25:27 +00:00
<a href="{{ url("core:user_profile", user_id=user.id) }}">
{{ user_mini_profile(user) }}
</a>
</div>
2017-07-23 10:54:12 +00:00
2017-07-22 20:35:01 +00:00
{% endfor %}
2018-06-05 22:25:27 +00:00
</div>
2017-07-23 10:54:12 +00:00
{{ paginate(page_obj, paginator) }}
2018-06-05 22:25:27 +00:00
<hr>
2017-07-22 20:35:01 +00:00
{% endif %}
<h2>{% trans %}Search user{% endtrans %}</h2>
<h3>{% trans %}Search by profile{% endtrans %}</h3>
<form action="{{ url('matmat:search') }}" method="post" enctype="multipart/form-data">
{% csrf_token %}
{% for field in form %}
2017-07-23 13:03:04 +00:00
{% if field.name not in ('phone', 'quick') %}
2017-07-22 20:35:01 +00:00
<p>
2018-06-05 22:25:27 +00:00
{{ field.errors }}
<label for="{{ field.id_for_label }}">{{ field.label }}</label>
{{ field }}
2017-07-22 20:35:01 +00:00
</p>
{% endif %}
{% endfor %}
<p><input type="submit" value="{% trans %}Search{% endtrans %}" /></p>
</form>
<h3>{% trans %}Inverted search{% endtrans %}</h3>
<form action="{{ url('matmat:search_reverse') }}" method="post" enctype="multipart/form-data">
{% csrf_token %}
2018-06-05 22:25:27 +00:00
<p>
{{ form.phone.errors }}
<label for="{{ form.phone.id_for_label }}">{{ form.phone.label }}</label>
{{ form.phone }}
<p><input type="submit" value="{% trans %}Search{% endtrans %}" /></p>
</p>
2017-07-22 20:35:01 +00:00
</form>
2017-07-23 13:03:04 +00:00
<h3>{% trans %}Quick search{% endtrans %}</h3>
<form action="{{ url('matmat:search_quick') }}" method="post">
2017-07-22 20:35:01 +00:00
{% csrf_token %}
2017-07-23 13:03:04 +00:00
<p>
{{ form.quick.errors }}
<label for="{{ form.quick.id_for_label }}">{{ form.quick.label }}</label>
{{ form.quick }}
<p><input type="submit" value="{% trans %}Search{% endtrans %}" /></p>
</p>
</form>
2017-07-22 20:35:01 +00:00
{% endblock %}
{% block script %}
{{ super() }}
{% endblock %}