# HG changeset patch # User Alexandre Segura # Date 1488387492 -3600 # Node ID d7f556b0bd2ae95470e4ca453183cc7178b1f25f # Parent 74b01659ee40d98cd9eaf12ddc691e094cc744ab Display stats icons on images list. diff -r 74b01659ee40 -r d7f556b0bd2a src/iconolab/templates/iconolab/collection_home.html --- a/src/iconolab/templates/iconolab/collection_home.html Wed Mar 01 17:35:13 2017 +0100 +++ b/src/iconolab/templates/iconolab/collection_home.html Wed Mar 01 17:58:12 2017 +0100 @@ -60,9 +60,6 @@ {% for item in items_pagination_data.list %}
{% include "partials/item_images_preview.html" with item=item %} -
{% endfor %} diff -r 74b01659ee40 -r d7f556b0bd2a src/iconolab/templates/partials/item_images_preview.html --- a/src/iconolab/templates/partials/item_images_preview.html Wed Mar 01 17:35:13 2017 +0100 +++ b/src/iconolab/templates/partials/item_images_preview.html Wed Mar 01 17:58:12 2017 +0100 @@ -1,65 +1,46 @@ {% load thumbnail %}
- {% if item.images.count > 1 %} - {% with item.images_sorted_by_name.first as main_image %} - {% if main_image.wh_ratio < 1.3 %} - - {% else %} - - {% endif %} - {% endwith %} - {% else %} - {% with item.images.first as main_image %} -
- {% thumbnail main_image.media "250x250" crop=False as im %} - - - + + {% with item.images_sorted_by_name.first as first_image %} + +
+ {% thumbnail first_image.media "250x250" crop=False as im %} + + + + {% endthumbnail %} +
+ + {% if item.images.count > 1 %} +
+ {% for image in item.images_sorted_by_name %} + {% if image != first_image %} + {% thumbnail image.media "100x100" crop=False as im %} + + + {% endthumbnail %} -
- {% endwith %} - {% endif %} + {% endif %} + {% endfor %} +
+ {% endif %} + +

+ + {{ first_image.stats.views_count }} + + + {{ first_image.stats.annotations_count }} + + + {{ first_image.stats.comments_count }} + + + {{ first_image.stats.tag_count }} + +

+ + {% endwith %} +
diff -r 74b01659ee40 -r d7f556b0bd2a src_js/iconolab-bundle/src/iconolab.scss --- a/src_js/iconolab-bundle/src/iconolab.scss Wed Mar 01 17:35:13 2017 +0100 +++ b/src_js/iconolab-bundle/src/iconolab.scss Wed Mar 01 17:58:12 2017 +0100 @@ -19,23 +19,33 @@ flex-direction: row; flex-wrap: wrap; .item-grid-item { - // flex: 1; padding: 0 10px 20px; @media (min-width: $screen-sm-min) { width: 25%; } - .main-image { + .main-image, .other-images { margin-bottom: 10px; img { width: 100%; height: auto; } } - .item-image-container { + .other-images { + display: flex; + > * { + width: 50%; + } + } + .main-image { a { display: block; } } + .item-image-stats { + display: flex; + justify-content: space-around; + padding: 0 10px; + } } }