1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-02-06 13:33:00 +00:00

Display the search results in a modal

This commit is contained in:
Yohann D'ANELLO 2020-10-15 16:03:08 +02:00
parent 980b2c9d8e
commit f1e5b63b75
4 changed files with 139 additions and 100 deletions

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Corres2math\n" "Project-Id-Version: Corres2math\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-10-11 18:43+0200\n" "POT-Creation-Date: 2020-10-15 16:01+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Yohann D'ANELLO <yohann.danello@animath.fr>\n" "Last-Translator: Yohann D'ANELLO <yohann.danello@animath.fr>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -30,7 +30,7 @@ msgid "This task failed successfully."
msgstr "Cette tâche a échoué avec succès." msgstr "Cette tâche a échoué avec succès."
#: apps/eastereggs/templates/eastereggs/xp_modal.html:16 #: apps/eastereggs/templates/eastereggs/xp_modal.html:16
#: templates/base_modal.html:16 #: templates/base_modal.html:18
msgid "Close" msgid "Close"
msgstr "Fermer" msgstr "Fermer"
@ -38,7 +38,7 @@ msgstr "Fermer"
msgid "Logs" msgid "Logs"
msgstr "Logs" msgstr "Logs"
#: apps/logs/models.py:22 apps/registration/models.py:16 #: apps/logs/models.py:22 apps/registration/models.py:17
msgid "user" msgid "user"
msgstr "utilisateur" msgstr "utilisateur"
@ -99,7 +99,7 @@ msgstr "changelogs"
msgid "Changelog of type \"{action}\" for model {model} at {timestamp}" msgid "Changelog of type \"{action}\" for model {model} at {timestamp}"
msgstr "Changelog de type \"{action}\" pour le modèle {model} le {timestamp}" msgstr "Changelog de type \"{action}\" pour le modèle {model} le {timestamp}"
#: apps/participation/forms.py:14 apps/participation/models.py:23 #: apps/participation/forms.py:14 apps/participation/models.py:24
msgid "The trigram must be composed of three uppercase letters." msgid "The trigram must be composed of three uppercase letters."
msgstr "Le trigramme doit être composé de trois lettres majuscules." msgstr "Le trigramme doit être composé de trois lettres majuscules."
@ -115,27 +115,27 @@ msgstr "Je m'engage à participer à l'intégralité des Correspondances."
msgid "Message to address to the team:" msgid "Message to address to the team:"
msgstr "Message à adresser à l'équipe :" msgstr "Message à adresser à l'équipe :"
#: apps/participation/models.py:16 #: apps/participation/models.py:17
msgid "name" msgid "name"
msgstr "nom" msgstr "nom"
#: apps/participation/models.py:22 #: apps/participation/models.py:23
msgid "trigram" msgid "trigram"
msgstr "trigramme" msgstr "trigramme"
#: apps/participation/models.py:30 #: apps/participation/models.py:31
msgid "access code" msgid "access code"
msgstr "code d'accès" msgstr "code d'accès"
#: apps/participation/models.py:31 #: apps/participation/models.py:32
msgid "The access code let other people to join the team." msgid "The access code let other people to join the team."
msgstr "Le code d'accès permet aux autres participants de rejoindre l'équipe." msgstr "Le code d'accès permet aux autres participants de rejoindre l'équipe."
#: apps/participation/models.py:35 #: apps/participation/models.py:36
msgid "Grant Animath to publish my video" msgid "Grant Animath to publish my video"
msgstr "Autoriser Animath à publier ma vidéo" msgstr "Autoriser Animath à publier ma vidéo"
#: apps/participation/models.py:36 #: apps/participation/models.py:37
msgid "" msgid ""
"Give the authorisation to publish the video on the main website to promote " "Give the authorisation to publish the video on the main website to promote "
"the action." "the action."
@ -143,90 +143,90 @@ msgstr ""
"Donner l'autorisation de publier la vidéo sur le site principal pour " "Donner l'autorisation de publier la vidéo sur le site principal pour "
"promouvoir les Correspondances." "promouvoir les Correspondances."
#: apps/participation/models.py:60 #: apps/participation/models.py:64
#, python-brace-format #, python-brace-format
msgid "Team {name} ({trigram})" msgid "Team {name} ({trigram})"
msgstr "Équipe {name} ({trigram})" msgstr "Équipe {name} ({trigram})"
#: apps/participation/models.py:63 apps/participation/models.py:74 #: apps/participation/models.py:67 apps/participation/models.py:78
#: apps/registration/models.py:85 apps/registration/models.py:130 #: apps/registration/models.py:89 apps/registration/models.py:134
msgid "team" msgid "team"
msgstr "équipe" msgstr "équipe"
#: apps/participation/models.py:64 #: apps/participation/models.py:68
msgid "teams" msgid "teams"
msgstr "équipes" msgstr "équipes"
#: apps/participation/models.py:78 #: apps/participation/models.py:82
#, python-brace-format #, python-brace-format
msgid "Problem #{problem:d}" msgid "Problem #{problem:d}"
msgstr "Problème n°{problem:d}" msgstr "Problème n°{problem:d}"
#: apps/participation/models.py:81 #: apps/participation/models.py:85
msgid "problem number" msgid "problem number"
msgstr "numéro de problème" msgstr "numéro de problème"
#: apps/participation/models.py:87 apps/participation/models.py:135 #: apps/participation/models.py:91 apps/participation/models.py:142
msgid "valid" msgid "valid"
msgstr "valide" msgstr "valide"
#: apps/participation/models.py:88 apps/participation/models.py:136 #: apps/participation/models.py:92 apps/participation/models.py:143
msgid "The video got the validation of the administrators." msgid "The video got the validation of the administrators."
msgstr "La vidéo a été validée par les administrateurs." msgstr "La vidéo a été validée par les administrateurs."
#: apps/participation/models.py:97 #: apps/participation/models.py:101
msgid "solution video" msgid "solution video"
msgstr "vidéo de solution" msgstr "vidéo de solution"
#: apps/participation/models.py:106 #: apps/participation/models.py:110
msgid "received participation" msgid "received participation"
msgstr "participation reçue" msgstr "participation reçue"
#: apps/participation/models.py:115 #: apps/participation/models.py:119
msgid "synthesis video" msgid "synthesis video"
msgstr "vidéo de synthèse" msgstr "vidéo de synthèse"
#: apps/participation/models.py:119 #: apps/participation/models.py:126
#, python-brace-format #, python-brace-format
msgid "Participation of the team {name} ({trigram})" msgid "Participation of the team {name} ({trigram})"
msgstr "Participation de l'équipe {name} ({trigram})" msgstr "Participation de l'équipe {name} ({trigram})"
#: apps/participation/models.py:122 #: apps/participation/models.py:129
msgid "participation" msgid "participation"
msgstr "participation" msgstr "participation"
#: apps/participation/models.py:123 #: apps/participation/models.py:130
msgid "participations" msgid "participations"
msgstr "participations" msgstr "participations"
#: apps/participation/models.py:128 #: apps/participation/models.py:135
msgid "link" msgid "link"
msgstr "lien" msgstr "lien"
#: apps/participation/models.py:129 #: apps/participation/models.py:136
msgid "The full video link." msgid "The full video link."
msgstr "Le lien complet de la vidéo." msgstr "Le lien complet de la vidéo."
#: apps/participation/models.py:158 #: apps/participation/models.py:165
#, python-brace-format #, python-brace-format
msgid "Video of team {name} ({trigram})" msgid "Video of team {name} ({trigram})"
msgstr "Vidéo de l'équipe {name} ({trigram})" msgstr "Vidéo de l'équipe {name} ({trigram})"
#: apps/participation/models.py:162 #: apps/participation/models.py:169
msgid "video" msgid "video"
msgstr "vidéo" msgstr "vidéo"
#: apps/participation/models.py:163 #: apps/participation/models.py:170
msgid "videos" msgid "videos"
msgstr "vidéos" msgstr "vidéos"
#: apps/participation/templates/participation/create_team.html:11 #: apps/participation/templates/participation/create_team.html:11
#: templates/base.html:207 #: templates/base.html:220
msgid "Create" msgid "Create"
msgstr "Créer" msgstr "Créer"
#: apps/participation/templates/participation/join_team.html:11 #: apps/participation/templates/participation/join_team.html:11
#: templates/base.html:203 #: templates/base.html:216
msgid "Join" msgid "Join"
msgstr "Rejoindre" msgstr "Rejoindre"
@ -370,65 +370,65 @@ msgstr "Invalider"
msgid "Update team" msgid "Update team"
msgstr "Modifier l'équipe" msgstr "Modifier l'équipe"
#: apps/participation/views.py:25 templates/base.html:70 #: apps/participation/views.py:28 templates/base.html:70
#: templates/base.html:206 #: templates/base.html:219
msgid "Create team" msgid "Create team"
msgstr "Créer une équipe" msgstr "Créer une équipe"
#: apps/participation/views.py:32 apps/participation/views.py:62 #: apps/participation/views.py:35 apps/participation/views.py:65
msgid "You don't participate, so you can't create a team." msgid "You don't participate, so you can't create a team."
msgstr "Vous ne participez pas, vous ne pouvez pas créer d'équipe." msgstr "Vous ne participez pas, vous ne pouvez pas créer d'équipe."
#: apps/participation/views.py:34 apps/participation/views.py:64 #: apps/participation/views.py:37 apps/participation/views.py:67
msgid "You are already in a team." msgid "You are already in a team."
msgstr "Vous êtes déjà dans une équipe." msgstr "Vous êtes déjà dans une équipe."
#: apps/participation/views.py:55 templates/base.html:75 #: apps/participation/views.py:58 templates/base.html:75
#: templates/base.html:202 #: templates/base.html:215
msgid "Join team" msgid "Join team"
msgstr "Rejoindre une équipe" msgstr "Rejoindre une équipe"
#: apps/participation/views.py:90 apps/participation/views.py:232 #: apps/participation/views.py:93 apps/participation/views.py:247
msgid "You are not in a team." msgid "You are not in a team."
msgstr "Vous n'êtes pas dans une équipe." msgstr "Vous n'êtes pas dans une équipe."
#: apps/participation/views.py:91 apps/participation/views.py:233 #: apps/participation/views.py:94 apps/participation/views.py:248
msgid "You don't participate, so you don't have any team." msgid "You don't participate, so you don't have any team."
msgstr "Vous ne participez pas, vous n'avez donc pas d'équipe." msgstr "Vous ne participez pas, vous n'avez donc pas d'équipe."
#: apps/participation/views.py:130 #: apps/participation/views.py:133
msgid "You don't participate, so you can't request the validation of the team." msgid "You don't participate, so you can't request the validation of the team."
msgstr "" msgstr ""
"Vous ne participez pas, vous ne pouvez pas demander la validation de " "Vous ne participez pas, vous ne pouvez pas demander la validation de "
"l'équipe." "l'équipe."
#: apps/participation/views.py:133 #: apps/participation/views.py:136
msgid "The validation of the team is already done or pending." msgid "The validation of the team is already done or pending."
msgstr "La validation de l'équipe est déjà faite ou en cours." msgstr "La validation de l'équipe est déjà faite ou en cours."
#: apps/participation/views.py:146 #: apps/participation/views.py:149
msgid "You are not an administrator." msgid "You are not an administrator."
msgstr "Vous n'êtes pas administrateur." msgstr "Vous n'êtes pas administrateur."
#: apps/participation/views.py:149 #: apps/participation/views.py:152
msgid "This team has no pending validation." msgid "This team has no pending validation."
msgstr "L'équipe n'a pas de validation en attente." msgstr "L'équipe n'a pas de validation en attente."
#: apps/participation/views.py:159 #: apps/participation/views.py:174
msgid "You must specify if you validate the registration or not." msgid "You must specify if you validate the registration or not."
msgstr "Vous devez spécifier si vous validez l'inscription ou non." msgstr "Vous devez spécifier si vous validez l'inscription ou non."
#: apps/participation/views.py:216 apps/registration/views.py:213 #: apps/participation/views.py:231 apps/registration/views.py:213
#, python-brace-format #, python-brace-format
msgid "Photo authorization of {student}.{ext}" msgid "Photo authorization of {student}.{ext}"
msgstr "Autorisation de droit à l'image de {student}.{ext}" msgstr "Autorisation de droit à l'image de {student}.{ext}"
#: apps/participation/views.py:220 #: apps/participation/views.py:235
#, python-brace-format #, python-brace-format
msgid "Photo authorizations of team {trigram}.zip" msgid "Photo authorizations of team {trigram}.zip"
msgstr "Autorisations de droit à l'image de l'équipe {trigram}.zip" msgstr "Autorisations de droit à l'image de l'équipe {trigram}.zip"
#: apps/participation/views.py:242 #: apps/participation/views.py:257
msgid "The team is not validated yet." msgid "The team is not validated yet."
msgstr "L'équipe n'est pas encore validée." msgstr "L'équipe n'est pas encore validée."
@ -440,7 +440,7 @@ msgstr "rôle"
msgid "participant" msgid "participant"
msgstr "participant" msgstr "participant"
#: apps/registration/forms.py:16 apps/registration/models.py:139 #: apps/registration/forms.py:16 apps/registration/models.py:143
msgid "coach" msgid "coach"
msgstr "encadrant" msgstr "encadrant"
@ -448,88 +448,88 @@ msgstr "encadrant"
msgid "The uploaded file must be a PDF, PNG of JPEG file." msgid "The uploaded file must be a PDF, PNG of JPEG file."
msgstr "Le fichier envoyé doit être au format PDF, PNG ou JPEG." msgstr "Le fichier envoyé doit être au format PDF, PNG ou JPEG."
#: apps/registration/models.py:21 #: apps/registration/models.py:22
msgid "Grant Animath to contact me in the future about other actions" msgid "Grant Animath to contact me in the future about other actions"
msgstr "" msgstr ""
"Autoriser Animath à me recontacter à l'avenir à propos d'autres actions" "Autoriser Animath à me recontacter à l'avenir à propos d'autres actions"
#: apps/registration/models.py:26 #: apps/registration/models.py:27
msgid "email confirmed" msgid "email confirmed"
msgstr "email confirmé" msgstr "email confirmé"
#: apps/registration/models.py:30 #: apps/registration/models.py:31
msgid "Activate your Correspondances account" msgid "Activate your Correspondances account"
msgstr "Activez votre compte des Correspondances" msgstr "Activez votre compte des Correspondances"
#: apps/registration/models.py:70 #: apps/registration/models.py:74
msgid "registration" msgid "registration"
msgstr "inscription" msgstr "inscription"
#: apps/registration/models.py:71 #: apps/registration/models.py:75
msgid "registrations" msgid "registrations"
msgstr "inscriptions" msgstr "inscriptions"
#: apps/registration/models.py:90 #: apps/registration/models.py:94
msgid "12th grade" msgid "12th grade"
msgstr "Terminale" msgstr "Terminale"
#: apps/registration/models.py:91 #: apps/registration/models.py:95
msgid "11th grade" msgid "11th grade"
msgstr "Première" msgstr "Première"
#: apps/registration/models.py:92 #: apps/registration/models.py:96
msgid "10th grade or lower" msgid "10th grade or lower"
msgstr "Seconde ou inférieur" msgstr "Seconde ou inférieur"
#: apps/registration/models.py:94 #: apps/registration/models.py:98
msgid "student class" msgid "student class"
msgstr "classe" msgstr "classe"
#: apps/registration/models.py:99 #: apps/registration/models.py:103
msgid "school" msgid "school"
msgstr "école" msgstr "école"
#: apps/registration/models.py:103 #: apps/registration/models.py:107
msgid "photo authorization" msgid "photo authorization"
msgstr "autorisation de droit à l'image" msgstr "autorisation de droit à l'image"
#: apps/registration/models.py:111 #: apps/registration/models.py:115
msgid "student" msgid "student"
msgstr "étudiant" msgstr "étudiant"
#: apps/registration/models.py:119 #: apps/registration/models.py:123
msgid "student registration" msgid "student registration"
msgstr "inscription d'élève" msgstr "inscription d'élève"
#: apps/registration/models.py:120 #: apps/registration/models.py:124
msgid "student registrations" msgid "student registrations"
msgstr "inscriptions d'élève" msgstr "inscriptions d'élève"
#: apps/registration/models.py:134 #: apps/registration/models.py:138
msgid "professional activity" msgid "professional activity"
msgstr "activité professionnelle" msgstr "activité professionnelle"
#: apps/registration/models.py:147 #: apps/registration/models.py:151
msgid "coach registration" msgid "coach registration"
msgstr "inscription d'encadrant" msgstr "inscription d'encadrant"
#: apps/registration/models.py:148 #: apps/registration/models.py:152
msgid "coach registrations" msgid "coach registrations"
msgstr "inscriptions d'encadrants" msgstr "inscriptions d'encadrants"
#: apps/registration/models.py:153 #: apps/registration/models.py:157
msgid "role of the administrator" msgid "role of the administrator"
msgstr "rôle de l'administrateur" msgstr "rôle de l'administrateur"
#: apps/registration/models.py:158 #: apps/registration/models.py:162
msgid "admin" msgid "admin"
msgstr "admin" msgstr "admin"
#: apps/registration/models.py:166 #: apps/registration/models.py:170
msgid "admin registration" msgid "admin registration"
msgstr "inscription d'administrateur" msgstr "inscription d'administrateur"
#: apps/registration/models.py:167 #: apps/registration/models.py:171
msgid "admin registrations" msgid "admin registrations"
msgstr "inscriptions d'administrateur" msgstr "inscriptions d'administrateur"
@ -617,7 +617,7 @@ msgid "Your password has been set. You may go ahead and log in now."
msgstr "Votre mot de passe a été changé. Vous pouvez désormais vous connecter." msgstr "Votre mot de passe a été changé. Vous pouvez désormais vous connecter."
#: apps/registration/templates/registration/password_reset_complete.html:10 #: apps/registration/templates/registration/password_reset_complete.html:10
#: templates/base.html:113 templates/base.html:197 templates/base.html:198 #: templates/base.html:123 templates/base.html:210 templates/base.html:211
#: templates/registration/login.html:7 templates/registration/login.html:8 #: templates/registration/login.html:7 templates/registration/login.html:8
#: templates/registration/login.html:25 #: templates/registration/login.html:25
msgid "Log in" msgid "Log in"
@ -772,11 +772,11 @@ msgstr "Mail de confirmation de l'adresse mail envoyé"
msgid "Resend email validation link" msgid "Resend email validation link"
msgstr "Renvoyé le lien de validation de l'adresse mail" msgstr "Renvoyé le lien de validation de l'adresse mail"
#: corres2math/settings.py:150 #: corres2math/settings.py:151
msgid "English" msgid "English"
msgstr "Anglais" msgstr "Anglais"
#: corres2math/settings.py:151 #: corres2math/settings.py:152
msgid "French" msgid "French"
msgstr "Français" msgstr "Français"
@ -853,23 +853,27 @@ msgstr "Faire un don"
msgid "Administration" msgid "Administration"
msgstr "Administration" msgstr "Administration"
#: templates/base.html:104 #: templates/base.html:105
msgid "Search..."
msgstr "Chercher ..."
#: templates/base.html:114
msgid "Return to admin view" msgid "Return to admin view"
msgstr "Retourner à l'interface administrateur" msgstr "Retourner à l'interface administrateur"
#: templates/base.html:109 #: templates/base.html:119
msgid "Register" msgid "Register"
msgstr "S'inscrire" msgstr "S'inscrire"
#: templates/base.html:125 #: templates/base.html:135
msgid "My account" msgid "My account"
msgstr "Mon compte" msgstr "Mon compte"
#: templates/base.html:128 #: templates/base.html:138
msgid "Log out" msgid "Log out"
msgstr "Déconnexion" msgstr "Déconnexion"
#: templates/base.html:144 #: templates/base.html:154
#, python-format #, python-format
msgid "" msgid ""
"Your email address is not validated. Please click on the link you received " "Your email address is not validated. Please click on the link you received "
@ -880,10 +884,14 @@ msgstr ""
"avez reçu par mail. Vous pouvez renvoyer un mail en cliquant sur <a href=" "avez reçu par mail. Vous pouvez renvoyer un mail en cliquant sur <a href="
"\"%(send_email_url)s\">ce lien</a>." "\"%(send_email_url)s\">ce lien</a>."
#: templates/base.html:167 #: templates/base.html:177
msgid "Contact us" msgid "Contact us"
msgstr "Nous contacter" msgstr "Nous contacter"
#: templates/base.html:208
msgid "Search results"
msgstr "Résultats de la recherche"
#: templates/registration/logged_out.html:8 #: templates/registration/logged_out.html:8
msgid "Thanks for spending some quality time with the Web site today." msgid "Thanks for spending some quality time with the Web site today."
msgstr "Merci d'avoir utilisé la plateforme des Correspondances." msgstr "Merci d'avoir utilisé la plateforme des Correspondances."
@ -904,3 +912,11 @@ msgstr ""
#: templates/registration/login.html:23 #: templates/registration/login.html:23
msgid "Forgotten your password or username?" msgid "Forgotten your password or username?"
msgstr "Mot de passe oublié ?" msgstr "Mot de passe oublié ?"
#: templates/search/search.html:6 templates/search/search.html:11
msgid "Search"
msgstr "Chercher"
#: templates/search/search.html:16
msgid "Results"
msgstr "Résultats"

View File

@ -100,11 +100,11 @@
</ul> </ul>
<ul class="navbar-nav ml-auto"> <ul class="navbar-nav ml-auto">
{% if user.registration.is_admin %} {% if user.registration.is_admin %}
<form class="navbar-form" action="{% url "haystack_search" %}" role="search"> <form class="navbar-form" role="search" onsubmit="event.preventDefault()">
<div class="input-group"> <div class="input-group">
<input type="text" class="form-control" placeholder="Rechercher" name="q" id="search-term" value="{{ request.GET.q }}"> <input type="text" class="form-control" placeholder="{% trans "Search..." %}" name="q" id="search-term" value="{{ request.GET.q }}">
<div class="input-group-btn"> <div class="input-group-btn">
<button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button> <button class="btn btn-default" data-toggle="modal" data-target="#searchModal"><i class="fa fa-search"></i></button>
</div> </div>
</div> </div>
</form> </form>
@ -204,6 +204,9 @@
</div> </div>
</footer> </footer>
{% trans "Search results" as modal_title %}
{% include "base_modal.html" with modal_id="search" modal_form_method="get" modal_additional_class="modal-lg" %}
{% trans "Log in" as modal_title %} {% trans "Log in" as modal_title %}
{% trans "Log in" as modal_button %} {% trans "Log in" as modal_button %}
{% url "login" as modal_action %} {% url "login" as modal_action %}
@ -224,6 +227,11 @@
$(".invalid-feedback").addClass("d-block"); $(".invalid-feedback").addClass("d-block");
$(document).ready(function () { $(document).ready(function () {
$('button[data-target="#searchModal"]').click(function() {
let modalBody = $("#searchModal div.modal-body");
let q = $("#search-term").val();
modalBody.load("{% url "haystack_search" %}?q=" + q + " #search-results");
});
$('a[data-target="#loginModal"]').click(function() { $('a[data-target="#loginModal"]').click(function() {
let modalBody = $("#loginModal div.modal-body"); let modalBody = $("#loginModal div.modal-body");
if (!modalBody.html().trim()) if (!modalBody.html().trim())

View File

@ -1,8 +1,8 @@
{% load i18n %} {% load i18n %}
<div id="{{ modal_id }}Modal" class="modal fade" tabindex="-1" role="dialog"> <div id="{{ modal_id }}Modal" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document"> <div class="modal-dialog {{ modal_additional_class }}" role="document">
<form method="post" action="{{ modal_action }}" enctype="{{ modal_enctype|default:"application/x-www-form-urlencoded" }}"> <form method="{{ modal_form_method|default:"post" }}" action="{{ modal_action }}" enctype="{{ modal_enctype|default:"application/x-www-form-urlencoded" }}">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title">{{ modal_title }}</h5> <h5 class="modal-title">{{ modal_title }}</h5>
@ -12,7 +12,9 @@
</div> </div>
<div class="modal-body">{{ modal_content }}</div> <div class="modal-body">{{ modal_content }}</div>
<div class="modal-footer"> <div class="modal-footer">
{% if modal_button %}
<button type="submit" class="btn btn-{{ modal_button_type|default:"primary" }}">{{ modal_button }}</button> <button type="submit" class="btn btn-{{ modal_button_type|default:"primary" }}">{{ modal_button }}</button>
{% endif %}
<button type="button" class="btn btn-secondary" data-dismiss="modal">{% trans "Close" %}</button> <button type="button" class="btn btn-secondary" data-dismiss="modal">{% trans "Close" %}</button>
</div> </div>
</div> </div>

View File

@ -1,9 +1,21 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load crispy_forms_filters %}
{% load crispy_forms_filters i18n %}
{% block content %} {% block content %}
<h3>Results</h3> <h2>{% trans "Search" %}</h2>
<form>
{% csrf_token %}
{{ form|crispy }}
<button type="submit" class="btn btn-primary">{% trans "Search" %}</button>
</form>
<hr>
<h3>{% trans "Results" %}</h3>
<div id="search-results">
{% for result in page.object_list %} {% for result in page.object_list %}
<p> <p>
<a href="{{ result.object.get_absolute_url }}">{{ result.object }}</a> <a href="{{ result.object.get_absolute_url }}">{{ result.object }}</a>
@ -19,4 +31,5 @@
{% if page.has_next %}<a href="?q={{ query }}&amp;page={{ page.next_page_number }}">{% endif %}Next &raquo;{% if page.has_next %}</a>{% endif %} {% if page.has_next %}<a href="?q={{ query }}&amp;page={{ page.next_page_number }}">{% endif %}Next &raquo;{% if page.has_next %}</a>{% endif %}
</div> </div>
{% endif %} {% endif %}
</div>
{% endblock %} {% endblock %}