]> git.parisson.com Git - mezzo.git/commitdiff
Person : detail view + refacto block heritage
authorEmilie <zawadzki@ircam.fr>
Thu, 29 Sep 2016 14:17:06 +0000 (16:17 +0200)
committerEmilie <zawadzki@ircam.fr>
Thu, 29 Sep 2016 14:17:06 +0000 (16:17 +0200)
app/organization/network/views.py
app/templates/core/inc/files.html [new file with mode: 0644]
app/templates/network/person_detail.html
app/templates/pages/page.html

index 85872c11159aaebe2c80c0b119d899362b3a04ad..13a4d465721905c286eb0c79b28a3295375206ea 100644 (file)
@@ -14,7 +14,7 @@ class PersonListView(ListView):
 class PersonDetailView(SlugMixin, DetailView):
 
     model = Person
-    template_name='team/person_detail.html'
+    template_name='network/person_detail.html'
     context_object_name = 'person'
 
 
diff --git a/app/templates/core/inc/files.html b/app/templates/core/inc/files.html
new file mode 100644 (file)
index 0000000..619df9a
--- /dev/null
@@ -0,0 +1,6 @@
+{% load i18n %}
+{% for file in files %}
+    <h3>{{ file.title }}</h3>
+    <p>{{ file.description }}</p>
+    <a href="{{ file.file.url }}" class="button button--small">{% trans "download" %}</a>
+{% endfor %}
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..1f5777a4e74b91c356bfb62e6241fe3b9f94c31d 100644 (file)
@@ -0,0 +1,69 @@
+{% extends "pages/page.html" %}
+{% load mezzanine_tags keyword_tags i18n organization_tags pages_tags %}
+
+{% block meta_title %}{{ person.meta_title }}{% endblock %}
+
+{% block meta_keywords %}{% metablock %}
+{% keywords_for person as keywords %}
+{% for keyword in keywords %}
+    {% if not forloop.first %}, {% endif %}
+    {{ keyword }}
+{% endfor %}
+{% endmetablock %}{% endblock %}
+
+{% block page_class %}
+    person
+{% endblock %}
+
+{% block breadcrumb_menu %}
+    {{ block.super }}
+    <li class="breadcrumb__item active">{{ person }}</li>
+{% endblock %}
+
+{% block page_title %}
+    {% editable person.title %}
+        <h1 class="dotted">{{ person.title }}</h1>
+    {% endeditable %}
+{% endblock %}
+
+{% block page_content %}
+    {% editable person.bio %}
+        {{ person.bio|richtext_filters|safe }}
+    {% endeditable %}
+{% endblock %}
+
+{% block page_sidebar %}
+    {% if person.images.all %}
+        {% with person.images.all|get_type:'page_featured' as images %}
+            {% if images.first %}
+                <figure class="person-list-box__image">
+                    <img src="{{ MEDIA_URL }}{% thumbnail images.first 135 135 top=0.5 %}" alt="person"/>
+                </figure>
+            {% endif %}
+        {% endwith %}
+    {% endif%}
+{% endblock %}
+
+{% block page_link %}
+    {{ block.super }}
+{% endblock %}
+
+{% block page_audio %}
+    {{ block.super }}
+{% endblock %}
+
+{% block page_slider %}
+    {{ block.super }}
+{% endblock %}
+
+{% block page_video %}
+    {{ block.super }}
+{% endblock %}
+
+{% block page_file %}
+    {{ block.super }}
+{% endblock %}
+
+{% block page_sub_content %}
+   {{ block.super }}
+{% endblock %}
index b2690f510556a85f6749ed196cc4c7a5af4f1c88..1cc12abcaa3403a1e6f6515f3079663708ae8ad5 100644 (file)
@@ -1,5 +1,5 @@
 {% extends "base.html" %}
-{% load i18n mezzanine_tags keyword_tags  pages_tags %}
+{% load i18n mezzanine_tags keyword_tags organization_tags pages_tags %}
 
 {% block meta_title %}{{ page.meta_title }}{% endblock %}
 
                         {{ page.content }}
                     {% endblock %}
                     {% block page_link %}
+                        {% with object.links.all as links %}
+                            {% if links %}
+                                {% include 'core/inc/link.html' %}
+                            {% endif %}
+                        {% endwith %}
                     {% endblock %}
                     {% block page_audio %}
+                        {% with object.audios.all as audios %}
+                            {% if audios %}
+                                {% include 'core/inc/audio.html' %}
+                            {% endif %}
+                        {% endwith %}
                     {% endblock %}
                 </div>
 
 
         </div>
         {% block page_slider %}
+        {% with object.images.all|get_type:'page_slider' as slider_images %}
+            {% if slider_images %}
+                {% include 'core/inc/slider.html' %}
+            {% endif %}
+        {% endwith %}
         {% endblock %}
         {% block page_video %}
+            {% with object.videos.all as videos %}
+                {% if videos %}
+                    {% include 'core/inc/slider_video.html' %}
+                {% endif %}
+            {% endwith %}
         {% endblock %}
         {% block page_person_list %}
         {% endblock %}
+        {% block page_file %}
+            {% with object.files.all as files %}
+                {% if files %}
+                    {% include 'core/inc/files.html' %}
+                {% endif %}
+            {% endwith %}
+        {% endblock %}
         {% block products %}
         {% endblock %}
         {% block page_sub_content %}
+            {% with object.blocks.all as blocks %}
+                {% include "core/inc/block.html" %}
+            {% endwith %}
         {% endblock %}
         {% block page_related_content %}
         {% endblock %}