diff --git a/avisstage/api.py b/avisstage/api.py index 9c8e833..c00b86a 100644 --- a/avisstage/api.py +++ b/avisstage/api.py @@ -16,7 +16,7 @@ class LieuResource(ModelResource): class Meta: queryset = Lieu.objects.all() resource_name = "lieu" - fields = ["nom", "pays", "coord", "type_lieu", "id"] + fields = ["nom", "ville", "pays", "coord", "type_lieu", "id"] authentication = SessionAuthentication() def build_filters(self, filters=None, **kwargs): diff --git a/avisstage/static/js/select_lieu.js b/avisstage/static/js/select_lieu.js index 426ccec..b462f57 100644 --- a/avisstage/static/js/select_lieu.js +++ b/avisstage/static/js/select_lieu.js @@ -124,6 +124,7 @@ function SelectLieuWidget(STATIC_ROOT, API_LIEU, target, callback) { break; case "country": data.pays = obj.short_name; + data.pays_nom = obj.long_name; break; } } @@ -180,7 +181,7 @@ function SelectLieuWidget(STATIC_ROOT, API_LIEU, target, callback) { data.marqueur = marqueur; var desc = $("
").append($("

").text(data.nom)) - .append($("

").text(data.ville+", "+data.pays)); + .append($("

").text(data.ville+", "+data.pays_nom)); var activeBtn = $("", {href:"javascript:void(0);"}) .prop("_lieustage_data", data) .on("click", choixLieuStage); diff --git a/avisstage/templates/avisstage/detail/stage.html b/avisstage/templates/avisstage/detail/stage.html index 02b7275..7bebd46 100644 --- a/avisstage/templates/avisstage/detail/stage.html +++ b/avisstage/templates/avisstage/detail/stage.html @@ -79,7 +79,8 @@ }); {% endif %} -

{{ object.auteur.nom }} a fait ce {{ object.get_type_stage_display|lower }} du {{ object.date_debut }} au {{ object.date_fin }}, supervisé par {{ object.encadrants }}

+

{{ object.auteur.nom }} a fait ce {{ object.get_type_stage_display|lower }} + du {{ object.date_debut }} au {{ object.date_fin }}{% if object.structure %}, au sein de {{ object.structure }}{% endif %}{% if object.encadrants %}, supervisé par {{ object.encadrants }}{% endif %}.