Add search

This commit is contained in:
Edgar P. Burkhart 2024-06-12 18:07:51 +02:00
parent b57a26953f
commit 92f6fe06a4
Signed by: edpibu
GPG Key ID: 9833D3C5A25BD227
4 changed files with 20 additions and 14 deletions

View File

@ -117,9 +117,9 @@ AUTH_PASSWORD_VALIDATORS = [
# Internationalization # Internationalization
# https://docs.djangoproject.com/en/5.0/topics/i18n/ # https://docs.djangoproject.com/en/5.0/topics/i18n/
LANGUAGE_CODE = "en-us" LANGUAGE_CODE = "fr-fr"
TIME_ZONE = "UTC" TIME_ZONE = "Europe/Paris"
USE_I18N = True USE_I18N = True

View File

@ -26,6 +26,8 @@
<link rel="preconnect" href="https://cdn.jsdelivr.net/"> <link rel="preconnect" href="https://cdn.jsdelivr.net/">
<link rel="stylesheet" <link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.classless.min.css" /> href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.classless.min.css" />
<link href="https://cdn.jsdelivr.net/npm/remixicon@4.2.0/fonts/remixicon.css"
rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="{% static 'css/lps.css' %}"> <link rel="stylesheet" type="text/css" href="{% static 'css/lps.css' %}">
{% block extra_css %}{# Override this in templates to add extra stylesheets #}{% endblock %} {% block extra_css %}{# Override this in templates to add extra stylesheets #}{% endblock %}
</head> </head>

View File

@ -1,19 +1,21 @@
{% load wagtailcore_tags navigation_tags %} {% load wagtailcore_tags navigation_tags %}
{% get_site_root as site_root %} {% get_site_root as site_root %}
<nav> <nav>
<ul> <ul>
<li> <li>
<a href="{% pageurl site_root %}"> <a href="{% pageurl site_root %}">
<strong>Lycée du Pays de Soule</strong> <strong>Lycée du Pays de Soule</strong>
</a> </a>
</li> </li>
</ul> </ul>
<ul> <ul>
{% for menuitem in site_root.get_children.live.in_menu %} {% for menuitem in site_root.get_children.live.in_menu %}
<li>
<a href="{% pageurl menuitem %}">{{ menuitem.title }}</a>
</li>
{% endfor %}
<li> <li>
<a href="{% pageurl menuitem %}">{{ menuitem.title }}</a> <a href="/search/"><i class="ri-search-line" title="Recherche"></i></a>
</li> </li>
{% endfor %}
</ul> </ul>
</nav> </nav>

View File

@ -3,12 +3,14 @@
{% block body_class %}template-searchresults{% endblock %} {% block body_class %}template-searchresults{% endblock %}
{% block title %}Search{% endblock %} {% block title %}Search{% endblock %}
{% block content %} {% block content %}
<h1>Search</h1> <h1>Recherche</h1>
<form action="{% url 'search' %}" method="get"> <form action="{% url 'search' %}" method="get">
<input type="text" <fieldset role="group">
name="query" <input type="text"
{% if search_query %}value="{{ search_query }}"{% endif %}> name="query"
<input type="submit" value="Search" class="button"> {% if search_query %}value="{{ search_query }}"{% endif %}>
<input type="submit" value="Rechercher" class="button">
</fieldset>
</form> </form>
{% if search_results %} {% if search_results %}
<ul> <ul>