{% extends 'base.html' %}
{% load i18n static %}
{% block title %}{% blocktrans %}Argelg | Liens{% endblocktrans %}{% endblock %}
{% block header %}
{% include 'frags/nav.html' %}
{% endblock %}
{% block content %}
<section class="wrapper wrapper--centered">
<div class="column column--spaced column--bottom heading">
<div class="container--title">
<h1 class="title title--line">Liens</h1>
</div>
<div class="container--form">
<div class="field__search">
<form class="search" method="get">
<input class="field" type="text" placeholder="Rechercher un lien" id="link-search" name="link-search">
<input class="field__search--btn" type="submit" value="">
</form>
</div>
</div>
</div>
{% if search %}
{% if links %}
<h2 class="title--right">Résultat de la recherche</h2>
<ul class="list__links column">
{% with links.all|first as link %}
<li class="list__item">
<a title="Ouvrir ce lien dans un nouvel onglet" href="{{ link.url }}" target="_blank">
<h2 class="subtitle text--color">{{ link.name }}</h2>
{% if link.description %}
<p class="baseline">{{ link.description }}</p>
{% endif %}
</a>
</li>
{% endwith %}
</ul>
{% else %}
<h2 class="title--right">Aucun lien n'a été trouvé</h2>
{% endif %}
{% else %}
{% if categories %}
{% for category in categories %}
<h2 class="title--right">{{ category.name }}</h2>
<ul class="list__links column">
{% for link in category.link.all %}
<li class="list__item">
<a title="Ouvrir ce lien dans un nouvel onglet" href="{{ link.url }}" target="_blank">
<h2 class="subtitle text--color">{{ link.name }}</h2>
{% if link.description %}
<p class="baseline">{{ link.description }}</p>
{% endif %}
</a>
</li>
{% endfor %}
</ul>
{% endfor %}
{% endif %}
{% endif %}
</section>
{% endblock %}
{% block footer %}
{% include 'frags/footer.html' %}
{% endblock %}