<div class="row">
    <div class="col-sm-12">        
        
        {% if details|length > 0 %}
            <table class="table table-bordered table-striped">
                {% for detail, value in details %}
                    <tr>
                        <th>{{ ('file.detail.' ~ detail)|trans({}, 'VisualMMediaManagerBundle') }}</th>
                        <td>{{ value }}</td>
                    </tr>
                {% endfor %}
            </table>
        {% endif %}
        
        <p>
            {% if extra_args.fs_callback is not null %}
            <a href="javascript:;" onclick='window.opener.{{extra_args.fs_callback}}({{ cb_path|json_encode() }}, {{ extra_args|json_encode() }}); window.close(); return false;' class="btn btn-primary">
                    <i class="glyphicon glyphicon-check"></i> {{ 'file.select'|trans({}, 'VisualMMediaManagerBundle') }}
                </a>
            {% endif %}
            
            <a href="{{ path('visual_m_media_manager_file_download', { 'config' : config, 'path' : rel_path }) }}" download class="btn btn-default">
                <i class="glyphicon glyphicon-cloud-download"></i> {{ 'file.download'|trans({}, 'VisualMMediaManagerBundle') }}
            </a>
        </p>
        
        <br />
        
        {# Display file trough GeSHI #}
        {% if viewer[0] == 'geshi' %}    
            <h2>{{ 'file.preview'|trans({}, 'VisualMMediaManagerBundle') }}</h2>
            {{ geshi_highlight(contents, viewer[2])|raw }}
        
        {# Display image directly #}
        {% elseif viewer[0] == 'image' %}        
            <h2>{{ 'file.preview'|trans({}, 'VisualMMediaManagerBundle') }}</h2>            
            <img style="max-width: 80%" src="{{ path('visual_m_media_manager_file_download', { 'config' : config, 'path' : rel_path }) }}" />

        {# File not supported #}
        {% else %}
            {{ 'file.must_download'|trans({}, 'VisualMMediaManagerBundle') }}
        {% endif %}
        
    </div>
</div>
    