{% set thumbSize = 24 %} {% set maxThumbWidth = thumbSize %} {% set maxThumbHeight = "%d"|format(maxThumbWidth * 2/3) %}
{% for file in files %} {% endfor %}
{{ "Name"|t }} {{ "Date Modified"|t }} {{ "Size"|t }}
{% if file.kind == 'image' %}
{% else %}
{% endif %}
{{ file.filename }}
{% if file.dateModified %}{{ file.dateModified.format("Y-m-d H:i:s")|datetime }}{% endif %} {% if file.size %}{{ file.size|filesize }}{% endif %}
{% set thumbCss = '' %} {% set hiResThumbCss = '' %} {% for file in files %} {% if file.kind == 'image' %} {% set thumbData = file.getThumbData(maxThumbWidth, maxThumbHeight) %} {% set topMargin = "%d"|format((thumbSize - thumbData.height) / 2) %} {% set bottomMargin = thumbSize - thumbData.height - topMargin %} {% set leftMargin = "%d"|format((thumbSize - thumbData.width) / 2) %} {% set rightMargin = thumbSize - thumbData.width - leftMargin %} {% set thumbCss = thumbCss ~'.thumb-wrapper.wrapper-'~file.id~' { margin: '~topMargin~'px '~rightMargin~'px '~bottomMargin~'px '~(leftMargin-34)~'px; height: '~thumbData.height~'px; width: '~thumbData.width~"px;}\n" %} {% set thumbCss = thumbCss ~ '.thumb-'~file.id~' { background-image: url('~thumbData.url~'); height: '~thumbData.height~'px; width: '~thumbData.width~"px;}\n" %} {% set hiResThumbCss = hiResThumbCss ~ '.thumb-'~file.id~' { background-image: url('~thumbData.url2X~'); background-size: '~thumbData.width~'px '~thumbData.height~"px; }\n" %} {% endif %} {% endfor %} {% includeCss thumbCss %} {% includeHiResCss hiResThumbCss %} {{ getHeadHtml() }}