chamilo/chamilo-lms

View on GitHub
src/CoreBundle/Resources/views/Resource/preview.html.twig

Summary

Maintainability
Test Coverage
{% extends "@ChamiloCore/Layout/no_layout.html.twig" %}

{% block content %}
    {% autoescape false %}
        <h3>{{ resource }} </h3>
        {% if resource.resourceNode.firstResourceFile %}
            {% if resource.resourceNode.isResourceFileAnImage %}
                Preview:
                <br />
                <img src=
                     "{{ url(
                         'chamilo_core_resource_view', {
                             'id': resource.resourceNode.id,
                             'type' : type,
                             'tool' : tool,
                             'filter' : 'resource_show_preview'
                         }
                     ) }}"
                />
            {% elseif resource.resourceNode.hasEditableTextContent %}
                {% autoescape false %}
                <iframe border="0" frameborder="0" style="width:100%;height:600px" src="{{ url('chamilo_core_resource_view', {
                    'id': resource.resourceNode.id,
                    'type' : type,
                    'tool' : tool
                }
                )
                }}">
                </iframe>
                {% endautoescape %}
            {% else %}
            {% endif %}
            <br />
            Download file:
            <a
                href="{{ url('chamilo_core_resource_download', {
                'id': resource.resourceNode.id,
                'type' : type,
                'tool' : tool
            }
            )
            }}">
                {{ resource.resourceNode.slug }}
            </a>
            <br />
            Size: {{ resource.resourceNode.firstResourceFile.size }}
            <br /><br />
        {% endif %}
    {% endautoescape %}
{% endblock %}