From 74cf0226a3690c521b6275faa73e8fe33b6f5dba Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 22 Mar 2018 16:49:12 +0100 Subject: Fix property decoration of the marker on the directory view --- .../templates/chimere/category_item_detail.html | 40 ---------------------- chimere/templates/chimere/detail_description.html | 2 +- chimere/views.py | 6 +++- 3 files changed, 6 insertions(+), 42 deletions(-) diff --git a/chimere/templates/chimere/category_item_detail.html b/chimere/templates/chimere/category_item_detail.html index 87cc7f3..4232d46 100644 --- a/chimere/templates/chimere/category_item_detail.html +++ b/chimere/templates/chimere/category_item_detail.html @@ -3,44 +3,4 @@ {% with marker=current_marker %} {% include "chimere/detail.html" %} {% endwith %} - - {% comment %} -

{{ current_marker.name }}

-
- {% if current_marker.default_pictures or current_marker.default_pictures or current_marker.default_multimedia_items%} - - {%endif%} -
- {% if dated %} -

{{current_marker.start_date|date:"D d M Y"}} - {% if current_marker.end_date %} - {{current_marker.end_date|date:"D d M Y"}}{% endif %}

- {% endif %} - {% if current_marker.description %} -

{{ current_marker.description|sanitize:"p b i br hr strong em img:src:alt span:style a:href:target ul li ol h1 h2 h3 h4 table td tr th"|safe}}

- {% endif %} - {% for property in current_marker.getProperties %} -

{{ property.value|sanitize:"p b i br hr strong em img:src:alt span:style a:href:target ul li ol h1 h2 h3 h4 table td tr th"|safe}}

- {% endfor %} - {% if current_marker.origin %}

{% trans "Source:" %} {{current_marker.origin}}

{% endif %} - {% if current_marker.license %}

{% trans "License:" %} {{current_marker.license}}

{% endif %} - {% share_bar current_marker %} - {% trans "See on the map" %} -

- {% trans "Submit an amendment" %} - -

- {% if moderator_emails %} - - {% trans "Propose amendment" %} - {%endif%} -
-
- {% endcomment %} \ No newline at end of file diff --git a/chimere/templates/chimere/detail_description.html b/chimere/templates/chimere/detail_description.html index 3487962..5cd0891 100644 --- a/chimere/templates/chimere/detail_description.html +++ b/chimere/templates/chimere/detail_description.html @@ -6,6 +6,6 @@ {% if marker.description %}
{{ marker.description|sanitize:"p b i br hr strong em span:style a:href:target ul li ol h1 h2 h3 h4 h5 table td tr th"|safe}}
{% endif %} -{% for property in marker.getProperties %}{% if property.value %} +{% for property in properties %}{% if property.value %}
{{property.propertymodel.name}} : {% if 'http://' in property.value or 'https://' in property.value %}{%endif%}{{ property.value|sanitize:"p b i br hr strong em span:style a:href:target ul li ol h1 h2 h3 h4 table td tr th"|safe}}{% if 'http://' in property.value or 'https://' in property.value %}{%endif%}
{%endif%}{% endfor %} diff --git a/chimere/views.py b/chimere/views.py index 50afd87..f6014b2 100644 --- a/chimere/views.py +++ b/chimere/views.py @@ -1108,8 +1108,12 @@ class CategoryItemView(CategoryView): context = super(CategoryItemView, self).get_context_data( *args, **kwargs) try: - context['current_marker'] = models.Marker.objects.get( + marker = models.Marker.objects.get( pk=self.kwargs['item_id'], status='A') + marker.set_properties_attributes(area_name=self.area_name) + context['current_marker'] = marker + context['properties'] = marker.getProperties( + area_name=self.area_name) except models.Marker.DoesNotExists: pass return context -- cgit v1.2.3