diff --git a/monstage/templates/monstage/stage.html b/monstage/templates/monstage/stage.html index 18c5707..c1531b7 100644 --- a/monstage/templates/monstage/stage.html +++ b/monstage/templates/monstage/stage.html @@ -41,13 +41,15 @@ {% endif %}
+ {% if stage.lieux.all %}
+ {% endif %}
{% if modifiable %}

Modifier la description du stage (sujet, ...)

{% endif %}

{{ stage.profil_user.user.first_name }} {{ stage.profil_user.user.last_name }} a fait ce stage du {{ stage.start_date }} au {{ stage.end_date }}{% if stage.encadrants %}, supervisé par {{ stage.encadrants }}{% endif %}.

Matières : {% for matiere in stage.matieres.all %}{% if not forloop.first %}, {% endif %}{{ matiere.name }}{% endfor %}

Thématiques : {% for tag in stage.thematiques.names %}{% if not forloop.first %}, {% endif %}{{ tag }}{% endfor %}

-

À {% for lieu in stage.lieux.all %}{% if not forloop.first %}{% if forloop.last %} et {% else %}, {% endif %}{% endif %}{{ lieu.name }} ({{ lieu.ville }}){% endfor %}

+ {% if stage.lieux.all %}

À {% for lieu in stage.lieux.all %}{% if not forloop.first %}{% if forloop.last %} et {% else %}, {% endif %}{% endif %}{{ lieu.name }} ({{ lieu.ville }}){% endfor %}

{% endif %} {% if modifiable %}

Modifier les lieux du stage

{% endif %}
diff --git a/monstage/templates/monstage/stage_edit_lieu.html b/monstage/templates/monstage/stage_edit_lieu.html index 050293a..9f8ba0d 100644 --- a/monstage/templates/monstage/stage_edit_lieu.html +++ b/monstage/templates/monstage/stage_edit_lieu.html @@ -30,7 +30,7 @@
- + {% endblock %} diff --git a/monstage/views.py b/monstage/views.py index bdabb37..a2f45fb 100644 --- a/monstage/views.py +++ b/monstage/views.py @@ -10,6 +10,7 @@ from django.contrib.gis.geos import GEOSGeometry from django.contrib.gis import measure from django.forms.widgets import HiddenInput from django.core.mail import send_mail +from django.template.defaultfilters import slugify from monstage.models import * @@ -312,7 +313,7 @@ def search(request): if thematiques: q = Q() for thematique in thematiques: - q |= Q(thematiques__slug__icontains = thematique) + q |= Q(thematiques__slug__contains = slugify(thematique)) stages = stages.filter(q).distinct() stages = stages.all() else: