{% load xsl_transform_tag %}
{% load blob_tags %}
{% load tz %}

<div class="row">
    <div class="col-md-12">
        {% include 'core_main_app/common/blob/tools_blob.html'%}
        <div class="col-xs-6" id="data-title">
            <h2>{{ data.blob.filename }}</h2>
        </div>
    </div>
</div>

<b>Created on: </b> {{data.blob.creation_date|localtime}} <br/>
<b>Author:</b> {{ data.blob.owner_name}}


{% for metadata in data.blob|blob_metadata:request.user %}
<p>
<h3>{{ metadata.title }}</h3>
<div id="xslt-representation">
    {% xsl_transform_detail xml_content=metadata.xml_content template_id=metadata.template.id xslt_id=data.xsl_transformation_id template_hash=metadata.template.hash request=request as xml_representation %}
    {% if 'core_file_preview_app' in INSTALLED_APPS %}
        {% render_blob_links_in_span xml_string=xml_representation as xml_representation %}
    {% endif %}
    {{ xml_representation|safe}}
</div>
</p>
{% empty%}
<p><b>Metadata: </b> No metadata files attached, or user not authorized to see them.</p>
{% endfor %}

