]> git.parisson.com Git - mezzo.git/commitdiff
Person block : display the description if the bio is not available
authorJérémy Fabre <Jeremy@iMac-de-Jeremy.local>
Wed, 21 Sep 2016 15:48:26 +0000 (17:48 +0200)
committerJérémy Fabre <Jeremy@iMac-de-Jeremy.local>
Wed, 21 Sep 2016 15:48:26 +0000 (17:48 +0200)
app/static/src/sass/modules/boxes/_person-list-box.scss
app/templates/network/inc/person/list_circle_style.html
app/templates/network/inc/person/list_square_style.html

index bb8f602c6518f6f3ab5ef02e1335f6297b0294e6..c3d184a598590eb3c13053c29aeacc14aea8e1d8 100644 (file)
@@ -26,4 +26,12 @@ $module: ".person-list-box";
 
     }
 
+    &__desc {
+        @include font-size(s);
+        @include line-height(.75);
+        @include typeface(serif);
+        @include margin(1 0 .25 0);
+        font-weight: weight(light);
+    }
+
 }
index 5a4e7ee75d081541b5c659561824d05f3b9d0cfc..ee65dd921c0764681afbbfa5e274d5698be9f994 100644 (file)
 
                                         <h3 class="mt0 fsxl">{{ person }}</h3>
 
-                                        {% if person.description %}
-                                            <p class="fss">{{ person.description|slice:":255" }}</p>
+                                        {% if person.bio %}
+                                            <div class="person-list-box__desc">{{ person.bio|richtext_filters|safe|truncatechars_html:255 }}</div>
+                                        {% elif person.description %}
+                                            <div class="person-list-box__desc">{{ person.description|richtext_filters|safe|truncatechars_html:255 }}</div>
                                         {% endif %}
+
                                         <a href="{{ person.get_absolute_url }}" class="button button--small button--white">{% trans "resume" %}</a>
                                         {% for link in person.links.all %}
                                             {% if link %}
index 8b19168719cb065532b7e2e23baa138eea80ec4d..5dc8cf0ce75b75be06f40626e1d12df6e82ea2e9 100644 (file)
 
                     <div class="col-lg-2 col-md-3 col-sm-4 col-xs-6">
 
-                        <a href="{{ person.get_absolute_url }}" title="{{ person }}" class="article-box article-box--person" >
+                        <div class="article-box article-box--person" >
                             {% with person_list_block_inline.person as person %}
 
                                     {% with person.images.all|get_type:'card' as card_images %}
                                         {% if card_images %}
                                             <div class="article-box__header">
-                                                <figure class="article-box__image">
-                                                    <img class="lazyload" src="{{ MEDIA_URL }}{% thumbnail card_images.first 427 500 top=0.5 %}" alt="person"/>
-                                                </figure>
+                                                <a href="{{ person.get_absolute_url }}" title="{{ person }}">
+                                                    <figure class="article-box__image">
+                                                        <img class="lazyload" src="{{ MEDIA_URL }}{% thumbnail card_images.first 427 500 top=0.5 %}" alt="person"/>
+                                                    </figure>
+                                                </a>
                                             </div>
                                         {% endif %}
                                     {% endwith %}
 
                                     <div class="article-box__content tal">
 
-                                        <h3 class="article-box__title">{{ person }}</h3>
+                                        <a href="{{ person.get_absolute_url }}" title="{{ person }}"><h3 class="article-box__title">{{ person }}</h3></a>
 
-                                        {% if person.description %}
-                                            <div class="article-box__desc">{{ person.description|slice:":255" }}</div>
+                                        {% if person.bio %}
+                                            <div class="article-box__desc">{{ person.bio|richtext_filters|safe|truncatechars_html:255 }}</div>
+                                        {% elif person.description %}
+                                            <div class="article-box__desc">{{ person.description|richtext_filters|safe|truncatechars_html:255 }}</div>
                                         {% endif %}
 
                                     </div>
 
                             {% endwith %}
-                        </a>
+                        </div>
 
                     </div>