ninegate/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/File/view.html.twig

84 lines
3.2 KiB
Twig

{% extends '@CadolesCore/base.html.twig' %}
{% block pagewrapper %}
<div class="nav navbar-default" style="margin: 10px 0px">
<ul class="nav navbar-top-links navbar-left">
<li><a>{{ filename }}</a></li>
</ul>
<ul class="nav navbar-top-links navbar-right" style="position:static">
<li><a href="{{ path('cadoles_core_'~access~'_file_download',{'directory':directory,'subdirectory':subdirectory,'filename':filename }) }}" style="cursor:pointer"><i class="fa fa-download"></i></a></li>
<li></li>
<li><a onClick="window.parent.document.location.reload()" style="cursor:pointer"><i class="fas fa-times-circle"></i></a></li>
</ul>
</div>
{% if minefamily == "image" %}
{% if prev is not empty %}
<a href="{{ path('cadoles_core_'~access~'_file_view',{'directory':directory,'subdirectory':subdirectory,'filename':prev.name,'navigation':true }) }}">
<div style="background: url({{ prev.thumb }}); background-size:cover; background-position:center; width: 90px; height:90px;float:left;margin-bottom:5px;text-align:center; line-height:90px; color:#fff">
<i class="fa fa-arrow-circle-left fa-4x" style="padding-top:15px"></i>
</div>
</a>
{% endif %}
{% if next is not empty %}
<a href="{{ path('cadoles_core_'~access~'_file_view',{'directory':directory,'subdirectory':subdirectory,'filename':next.name,'navigation':true }) }}">
<div style="background: url({{ next.thumb }}); background-size:cover; background-position:center; width: 90px; height:90px;float:right;margin-bottom:5px;text-align:center; line-height:90px; color:#fff">
<i class="fa fa-arrow-circle-right fa-4x" style="padding-top:15px"></i>
</div>
</a>
{% endif %}
<img id="image" src="{{image}}" style="display:block; margin:auto; max-width:100%;">
{% else %}
<iframe id="frameviewfile" src="{{ path('cadoles_core_'~access~'_file_show',{'directory':directory,'subdirectory':subdirectory,'filename':filename }) }}"
style="width:100%; height:100%">
</iframe>
{% endif %}
{% endblock %}
{% block localjavascript %}
$(document).ready(function() {
$(window).resize(function() {
AjustFrame();
});
AjustFrame();
});
// Ajustement des frames
function AjustFrame() {
var heightbody = $('html').height();
var heightheader = $('.nav').height();
var heightframe = heightbody-heightheader-50;
var widthbody = $('body').width();
if($("#frameviewfile").length>0) {
$("#frameviewfile").height(heightframe);
}
if($("#image").length>0) {
widthbody=widthbody-250;
if(widthbody<950) widthbody="100%";
//$("#image").css({});
$("#image").css("height","auto");
$("#image").css("max-width",widthbody);
if($("#image").height()>heightframe)
$("#image").css({height:heightframe});
}
}
{% endblock %}