]> git.parisson.com Git - mezzo.git/commitdiff
Fix article department page
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Wed, 24 Aug 2016 13:01:13 +0000 (15:01 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Wed, 24 Aug 2016 13:01:13 +0000 (15:01 +0200)
app/organization/magazine/views.py
app/templates/pages/includes/page_card.html

index d959e75c99f12c089a5208ddd1f947dd4ecbc7f2..445034ce1bb885d0f9c17baab752dfe6d1c769e1 100644 (file)
@@ -11,7 +11,7 @@ from dal import autocomplete
 from dal_select2_queryset_sequence.views import Select2QuerySetSequenceView
 from mezzanine_agenda.models import Event
 from organization.magazine.models import Article, Topic, Brief
-from organization.network.models import Department
+from organization.network.models import DepartmentPage
 from organization.pages.models import CustomPage
 from organization.core.views import SlugMixin
 from django.template.defaultfilters import slugify
@@ -29,7 +29,7 @@ class ArticleDetailView(SlugMixin, DetailView):
         if previous_page_slug:
             #find parents page
             parsed_url = urlparse(previous_page_url)
-            self.department_parent = Department.objects.filter(slug=parsed_url.path[1:][:-1])
+            self.department_parent = DepartmentPage.objects.filter(slug=parsed_url.path[1:][:-1])
             self.topic_parent = Topic.objects.filter(slug=previous_page_slug)
         return super(ArticleDetailView, self).get(request, *args, **kwargs)
 
index 53de457b0c7174471ac15a9723adf8f10d85424f..02c6e84f335a9be2b1372e45140ead1666ca3119 100644 (file)
@@ -1,8 +1,9 @@
 {% load mezzanine_tags %}
 <a href="{{ object.get_absolute_url }}" title="{{ object.title }}" class="page-box">
     <div class="page-box__image">
-        
-        <img src="{{ MEDIA_URL }}{% thumbnail object.get_content_model.photo_card 900 400 %}" />
+      {% with slider.content_object.images.all|get_type:'card' as image %}
+        <img src="{{ MEDIA_URL }}{% thumbnail image.file 900 400 %}" />
+      {% endwith %}
     </div>
     <div class="page-box__content">
         <div>