{% load i18n thumbnail sekizai_tags %}
{% addtoblock "css" %}<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}cmsplugin_filer_folder/css/slideshow.css" media="screen, projection" />{% endaddtoblock "css" %}
{% addtoblock "js" %}<script type="text/javascript" src="{{ STATIC_URL }}cmsplugin_filer_folder/js/jquery.cycle.lite-1.0.js"></script>{% endaddtoblock "js" %}
{% addtoblock "js" %}
<script type="text/javascript">
//<![CDATA[
jQuery(document).ready(function ($) {
    $('.cmsplugin_filer_folder_slidshow').cycle({
        fx: 'fade'
    });
});
//]]>
</script>
{% endaddtoblock %}


{% firstof object.title object.folder.name  %}

{% if object.view_option == "list" %}
    <div class="cmsplugin_filer_folder_list" id="folder_{{ instance.id }}">
        <!--The files should go there    -->
        {% if folder_children %}
        <p>{% trans "Folders" %}</p>
        <ul>
            {% for folder in folder_children %}
                <li>{{ folder }}</li>
            {% endfor %}
        </ul>
        {% endif %}
        {% if folder_files %}
        <p>{% trans "Files" %}</p>
        <ul>
            {% for files in folder_files %}
                <li>{{ files }}</li>
            {% endfor %}
        </ul>
        {% endif %}
        {% if folder_images %}
        <p>{% trans "Images" %}</p>
        <ul>
            {% for image in folder_images %}
                <li><img src="{% thumbnail image.file 32x32 crop="True" upscale="True" %}" width="32" height="32" alt="{{ image.label }}"></li>
            {% endfor %}
        </ul>
        {% endif %}
    </div>
{% else %}
    <!-- start: slideshow -->
    <div class="cmsplugin_filer_folder_slidshow" id="folder_{{ object.id }}">
        {% for image in folder_images %}
            <img src="{% thumbnail image.file 200x200 crop="True" upscale="True" %}">
        {% endfor %}
    </div>
    <!-- end: gallery -->
{% endif %}
