Add basic search bar

This commit is contained in:
Skia
2016-08-19 02:53:44 +02:00
parent 0689f864d2
commit f1105d704e
13 changed files with 199 additions and 73 deletions

View File

@ -24,6 +24,10 @@
<a href="{{ url('core:user_profile', user_id=user.id) }}">{{ user.get_display_name() }}</a> |
<a href="{{ url('core:user_tools') }}">{% trans %}Tools{% endtrans %}</a> |
<a href="{{ url('core:logout') }}">{% trans %}Logout{% endtrans %}</a>
<form action="{{ url('core:search') }}" method="GET">
<input type="text" placeholder="{% trans %}Search{% endtrans %}" name="query" />
<input type="submit" value="{% trans %}Search{% endtrans %}" style="display: none;" />
</form>
{% endif %}
</header>
{% else %}

View File

@ -1,7 +1,8 @@
{% extends "core/base.jinja" %}
{% block title %}{{ title }}{% endblock %}
{% block title %}
{% trans %}Welcome!{% endtrans %}
{% endblock %}
{% block content %}
{% trans %}Hello, world. You're at the core index using Jinja2.{% endtrans %}
{% endblock %}

View File

@ -1,3 +1,16 @@
{% macro user_profile_link(user) -%}
<a href="{{ url("core:user_profile", user_id=user.id) }}">{{ user.get_display_name() }}</a>
{%- endmacro %}
{% macro user_link_with_pict(user) -%}
<a href="{{ url("core:user_profile", user_id=user.id) }}" class="mini_profile_link" >
<span>
{% if user.profile_pict %}
<img src="{{ user.profile_pict.get_download_url() }}" alt="{% trans %}Profile{% endtrans %}" />
{% else %}
<img src="{{ static('core/img/na.gif') }}" alt="{% trans %}Profile{% endtrans %}" />
{% endif %}
</span>
<em>{{ user.get_display_name() }}</em>
</a>
{%- endmacro %}

View File

@ -0,0 +1,26 @@
{% extends "core/base.jinja" %}
{% from "core/macros.jinja" import user_link_with_pict %}
{% block title %}
{% trans %}Search result{% endtrans %}
{% endblock %}
{% block content %}
<h4>{% trans %}Users{% endtrans %}</h4>
<ul>
{% for i in result.users %}
<li>
{{ user_link_with_pict(i) }}
</li>
{% endfor %}
</ul>
<h4>{% trans %}Clubs{% endtrans %}</h4>
<ul>
{% for i in result.clubs %}
<li>
<a href="{{ url("club:club_view", club_id=i.id) }}">{{ i }}</a>
</li>
{% endfor %}
</ul>
{% endblock %}

View File

@ -8,9 +8,10 @@
{% if profile.permanencies %}
<div>
<h3>Permanencies</h3>
<p>
{{ total_time }}
</p>
<p>Total: {{ total_perm_time }}</p>
<p>Foyer: {{ total_foyer_time }}</p>
<p>MDE: {{ total_mde_time }}</p>
<p>La Gommette: {{ total_gommette_time }}</p>
</div>
{% endif %}
{% endblock %}