mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 03:49:24 +00:00
Add basic search bar
This commit is contained in:
@ -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 %}
|
||||
|
@ -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 %}
|
||||
|
@ -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 %}
|
||||
|
26
core/templates/core/search.jinja
Normal file
26
core/templates/core/search.jinja
Normal 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 %}
|
@ -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 %}
|
||||
|
Reference in New Issue
Block a user