ninegate
Some checks failed
Cadoles/nineskeletor/pipeline/head There was a failure building this commit

This commit is contained in:
2023-02-01 09:03:27 +01:00
parent fb33724d9b
commit 9554b9cdd3
235 changed files with 2964 additions and 1573 deletions

View File

@ -0,0 +1,50 @@
{% extends 'base.html.twig' %}
{% block localstyle %}
<style>
body { height:auto;}
#page { padding: 0px !important;}
</style>
{% endblock %}
{% block body %}
{{ form_start(form) }}
<p>
{{ form_widget(form.submit) }} <a class="btn btn-secondary" onClick="closeModal();">Annuler</a>
</p>
{% if app.session.flashbag.has('error') %}
<div class='alert alert-danger' style='margin: 5px 0px'>
<strong>Erreur</strong><br>
{% for flashMessage in app.session.flashbag.get('error') %}
{{ flashMessage }}<br>
{% endfor %}
</div>
{% endif %}
{{ form_row(form.folder) }}
{{ form_end(form) }}
{% endblock %}
{% block localscript %}
<script>
function closeModal() {
window.parent.$("#mymodalfull").modal('hide');
}
$('document').ready(function(){
$("#form_folder").focus();
{% if toclose %}
href=parent.location.href;
parent.location.href=href;
{% endif %}
});
</script>
{% endblock %}

View File

@ -0,0 +1,346 @@
{% extends 'base.html.twig' %}
{% block localstyle %}
<style>
body { height:auto;}
#page { padding: 0px !important;}
.btn-group>.btn, .btn-group>.btn:active{
background-color: var(--colorbgbodydark);
border: var(--colorbgbodydark);
}
.btn-group>.btn:active{
background-color: var(--colorbgbodydark-darker);
border: var(--colorbgbodydark);
}
.item-small .item-subtitle, .item-list .item-subtitle {
display:block;
}
.item-small .item-subtitle {
font-size:9px;
}
.item-small img {
width:60px;
}
.item-list {
zoom:80%;
}
.item-list img {
width:40px;
}
.breadcrumb {
padding: 5px 10px;
margin: 5px 0px 5px 0px;
list-style: none;
border-radius: 4px;
background-color: var(--colorbgbodydark);
display: inline-flex;
}
.breadcrumb a {
color: var(--colorftbodydark);
}
.item-action .btn-modal {
color: inherit;
}
</style>
{% endblock %}
{% block body %}
<div id="explorer">
<div class="btn-toolbar" role="toolbar" aria-label="Toolbar with button groups">
{% if canadd and not fgtrash %}
<div class="btn-group me-1" role="group" aria-label="First group">
<button type="button" class="btn btn-modal btn-primary"data-modalid="mymodalfull" data-modaltitle="Téléchargez vos Fichiers" data-modalurl="{{ path('app_'~access~'_file_upload',{'category': category, 'id': id,'type':'file','usage':usage,'folder':folder}) }}" title="Ajouter des fichiers">
<i class="fa fa-upload"></i>
</button>
<button type="button" class="btn btn-modal btn-primary"data-modalid="mymodalfull" data-modaltitle="Création Répertoire" data-modalurl="{{ path('app_'~access~'_file_folder',{'category': category, 'id': id,'usage':usage,'folder':folder}) }}" title="Ajouter un Répertoire">
<i class="fa fa-folder-plus"></i>
</button>
</div>
{% endif %}
<div class="btn-group me-1" role="group" aria-label="Second group">
{% if view=="small" %}
{%set action="list" %}
{% else %}
{%set action="small" %}
{% endif %}
<a href="{{ path('app_'~access~'_file_list',{'category': category, 'id': id,'type':'file','usage':usage,'folder':folder, 'view':action }) }}" type="button" class="btn btn-primary">
{% if view=="small" %}
<i class="fas fa-list"></i>
{% else %}
<i class="fas fa-th"></i>
{% endif %}
</a>
{% set active="" %}
{% if sort=="name" %}
{% set active="active" %}
{%endif%}
{% if order=="SORT_ASC" %}
{%set action="SORT_DESC" %}
{% else %}
{%set action="SORT_ASC" %}
{% endif %}
<a href="{{ path('app_'~access~'_file_list',{'category': category, 'id': id,'type':'file','usage':usage,'folder':folder, 'sort': 'name', 'order':action }) }}" type="button" class="btn btn-primary {{active}}">
{% if order=="SORT_ASC" %}
<i class="fas fa-long-arrow-alt-down"></i> Nom
{% else %}
<i class="fas fa-long-arrow-alt-up"></i> Nom
{% endif %}
</a>
{% set active="" %}
{% if sort=="date" %}
{% set active="active" %}
{%endif%}
{% if order=="SORT_ASC" %}
{%set action="SORT_DESC" %}
{% else %}
{%set action="SORT_ASC" %}
{% endif %}
<a href="{{ path('app_'~access~'_file_list',{'category': category, 'id': id,'usage':usage,'folder':folder, 'sort': 'date', 'order':action }) }}" type="button" class="btn btn-primary {{active}}">
{% if order=="SORT_ASC" %}
<i class="fas fa-long-arrow-alt-down"></i> Date
{% else %}
<i class="fas fa-long-arrow-alt-up"></i> Date
{% endif %}
</a>
</div>
{% if canadd %}
<div class="btn-group" role="group" aria-label="Third group">
{% if fgtrash %}
<a href="{{ path('app_'~access~'_file_purgetrash',{'category': category, 'id': id ,'usage':usage}) }}" type="button" class="btn btn-primary" data-method="delete" data-confirm="Souhaitez-vous purger votre poubelle ? Cette action sera irrévocable.">Purger la poubelle</a>
{% else %}
<a href="{{ path('app_'~access~'_file_list',{'category': category, 'id': id,'usage':usage,'folder':'file/'~category~'/'~id~'/.trash/' }) }}" type="button" class="btn btn-primary"><i class="fas fa-trash"></i></a>
{% endif %}
</div>
{% endif %}
</div>
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
{% for parent in parents %}
<li class="breadcrumb-item folder" data-src="{{parent.folder}}"><a href="{{ path('app_'~access~'_file_list',{'category': category, 'id': id,'usage':usage,'folder': parent.folder }) }}">{{ parent.basename}}</a></li>
{% endfor %}
</ol>
</div>
<div class="items-list">
{% for dir in folders %}
<div class="item item-{{view}} folder" data-src="{{dir.Prefix}}" style="background-color: var(--colorbgbodydark);">
<div class="item-container">
<div class="item-content">
<a class="item-link" href="{{ path('app_'~access~'_file_list',{'category': category, 'id': id,'usage':usage,'folder':dir.Prefix }) }}">
<img height="35" src="{{ dir.thumb }}">
<div class="item-title">
<h3>{{ dir.basename }}</h3>
</div>
</a>
<div class="item-action">
{% if canadd %}
{% if fgtrash %}
<a style="display:none" onClick="restaureFile('{{dir.Prefix|e('js')|raw }}')">
<i class="fa fa-undo" title="Restaurer le fichier"></i>
</a>
<a style="display:none" onClick="delFile('{{dir.Prefix|e('js')|raw }}')">
<i class="fa fa-trash" title="Supprimer le dossier"></i>
</a>
{% else %}
<a style="display:none" class="btn-modal" title="Modifier" data-modalid="mymodalfull" data-modaltitle="Modification" data-modalurl="{{ path('app_'~access~'_file_rename',{'category': category, 'id': id,'usage':usage,'file':dir.Prefix}) }}">
<i class="fas fa-file"></i>
</a>
<a style="display:none" onClick="trashFile('{{dir.Prefix|e('js')|raw}}')">
<i class="fas fa-trash" title="Supprimer le dossier"></i>
</a>
{% endif %}
{% endif %}
</div>
</div>
</div>
</div>
{% endfor %}
{% for file in files %}
<div class="item item-{{view}} file" style="background-color: var(--colorbgbodydark);" data-src="{{file.Key}}">
<div class="item-container">
<div class="item-content">
<a class="item-link" href="{{ path('app_'~access~'_file_show',{'category': category, 'id': id,'file':file.Key }) }}" target="_blank">
<img height="35" src="{{ file.thumb }}">
<div class="item-title">
<h3>{{ file.basename }}</h3>
<div class="item-subtitle">le {{ file.LastModified|date("d/m/Y H:i")}}</div>
</div>
</a>
<div class="item-action">
{% if canadd %}
{% if fgtrash %}
<a style="display:none" onClick="restaureFile('{{file.Key|e('js')|raw }}')">
<i class="fa fa-undo" title="Restaurer le fichier"></i>
</a>
<a style="display:none" onClick="delFile('{{file.Key|e('js')|raw }}')">
<i class="fa fa-trash" title="Supprimer le dossier"></i>
</a>
{% else %}
<a style="display:none" class="btn-modal" title="Modifier" data-modalid="mymodalfull" data-modaltitle="Modification" data-modalurl="{{ path('app_'~access~'_file_rename',{'category': category, 'id': id,'usage':usage,'file':file.Key}) }}">
<i class="fas fa-file"></i>
</a>
<a style="display:none" onClick="trashFile('{{file.Key|e('js')|raw}}')">
<i class="fas fa-trash" title="Supprimer le dossier"></i>
</a>
{% endif %}
{% endif %}
</div>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
<div id="mymodalfull" class="modal" tabindex="-1">
<div class="modal-dialog modal-fullscreen">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title"></h4>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<iframe frameborder=0 width="100%" style="min-height:300px;"></iframe>
</div>
</div>
</div>
</div>
{% endblock %}
{% block localscript %}
<script>
$('#mymodalfull').on('shown.bs.modal', function() {
$("#framefile-{{id}}",window.parent.document).css("min-height",$("#mymodalfull").find("iframe").height()+130);
$("#framefile-{{id}}",window.parent.document).parent().css("min-height",$("#mymodalfull").find("iframe").height()+130);
});
$('#mymodalfull').on('hide.bs.modal', function() {
$("#framefile-{{id}}",window.parent.document).css("min-height","unset");
$("#framefile-{{id}}",window.parent.document).parent().css("min-height","unset");
});
$(window).on('load', function(){
$("#framefile-{{id}}",window.parent.document).css("min-height","unset");
$("#framefile-{{id}}",window.parent.document).parent().css("min-height","unset");
});
{% if canadd %}
// Trasher un fichier
function trashFile(file) {
var r = confirm("Confirmez-vous la mise à la poubelle de ce fichier ? Vous pourrez le récupèrer si besoin.");
if (r == true) {
url="{{ path('app_'~access~'_file_trash',{'category': category, 'id': id,'file':'xxx' }) }}";
url=url.replace("xxx",file);
url=url.replace(/&amp;/g,"&");
$.ajax({
method: "POST",
url: url,
success: function() {
location.reload();
}
});
}
}
// Supprimer un fichier
function delFile(file) {
var r = confirm("Confirmez-vous la suppression définitive de ce fichier ?");
if (r == true) {
url="{{ path('app_'~access~'_file_delete',{'category': category, 'id': id,'file':'xxx' }) }}";
url=url.replace("xxx",file);
url=url.replace(/&amp;/g,"&");
$.ajax({
method: "POST",
url: url,
success: function() {
location.reload();
}
});
}
}
// Restaurer un fichier
function restaureFile(file) {
url="{{ path('app_'~access~'_file_restaure',{'category': category, 'id': id,'file':'xxx' }) }}";
url=url.replace("xxx",file);
url=url.replace(/&amp;/g,"&");
$.ajax({
method: "POST",
url: url,
success: function() {
location.reload();
}
});
}
// Déplacement
{% if not fgtrash %}
$('.file').on('dragstart', function (s) {
filesource=$(this).data("src");
});
$('.folder').on('dragstart', function (s) {
filesource=$(this).data("src");
});
$('.folder')
// crucial for the 'drop' event to fire
.on('dragover', false)
.on('drop', function (e) {
// Récupérer la destination
filedestination=$(this).data("src");
// Si la source est la meme que la destination on ne fait rien
if(filesource==filedestination) return false;
url="{{ path('app_'~access~'_file_move',{'category': category, 'id': id,'source':'xxx', 'destination':'zzz' }) }}";
url=url.replace("xxx",filesource);
url=url.replace("zzz",filedestination);
url=url.replace(/&amp;/g,"&");
// On déplace l'element
$.ajax({
method: "POST",
url: url,
success: function() {
location.reload();
}
});
return false;
});
{% endif %}
{% endif %}
</script>
{% endblock %}

View File

@ -0,0 +1,22 @@
{% extends 'base.html.twig' %}
{% block localstyle %}
<style>
body {
background-color: var(--colorbgbodydark);
}
</style>
{% endblock %}
{% block localscript %}
<script>
parent.location.reload();
</script>
{% endblock %}

View File

@ -0,0 +1,74 @@
{% extends 'base.html.twig' %}
{% block encoretags %}
{{ encore_entry_link_tags('dropzone') }}
{% endblock %}
{% block localstyle %}
<style>
body { height:auto;}
#page { padding: 0px !important;}
</style>
{% endblock %}
{% block body %}
<a class="btn btn-secondary" onClick="closeModal();">Annuler</a>
<form
action="{{ oneup_uploader_endpoint('file') }}"
class="dropzone"
id="mydropzone"
{% if type=="image" %}data-acceptedMimeTypes="image/*"{% endif %}
data-maxFiles="0"
style="margin-top:10px">
</form>
{% endblock %}
{% block localscript %}
{{ encore_entry_script_tags('dropzone') }}
<script>
function dropzoneinit( elmt ) {
var totalFiles = 0;
var completeFiles = 0;
elmt.on("sending", function(file, xhr, formData) {
formData.append("folder", "{{ folder }}");
});
elmt.on("addedfile", function (file) {
totalFiles += 1;
});
elmt.on("removed file", function (file) {
totalFiles -= 1;
});
elmt.on("complete", function (file) {
completeFiles += 1;
if (completeFiles === totalFiles) {
{% if forcereload %}
parent.location.reload();
{% else %}
parent.refreshPJ();
closeModal();
{% endif %}
}
});
}
function dropzonesuccess( file, response ) {
//closeModal();
}
function closeModal() {
window.parent.$("#mymodallarge").modal('hide');
window.parent.$("#mymodalfull").modal('hide');
}
</script>
{% endblock %}

View File

@ -0,0 +1,126 @@
{% extends 'base.html.twig' %}
{% block localstyle %}
<style>
body {
background-color: var(--colorbgbodydark);
}
img {
margin:auto;
display: block;
}
#page {
padding: 0px !important;
}
h3, #filetitle {
margin:0px;
text-align:center;
}
h3, a, a:hover {
color: var(--colorfttitledark);
}
#fileaction {
margin-top: -10px;
}
#bigright{
position:absolute;
top:0px;
right:0px;
width:45%;
height:100%;
line-height:100%;
text-align: right;
vertical-align: middle;
padding:5px;
}
#bigleft{
position:absolute;
top:0px;
left:0px;
width:45%;
height:100%;
vertical-align: middle;
padding:5px;
}
</style>
{% endblock %}
{% block body %}
<div id="filetitle">
<h3>{{basename}}</h3>
<div id="fileaction">
<a href="{{ path("app_"~access~"_file_download",{category:category, id:id, file:file, usage:usage})}}"><i class="fa-solid fa-download"></i></a>
{%if canadd %}
&nbsp;&nbsp;&nbsp;<a href="{{ path("app_"~access~"_file_delete",{category:category, id:id, file:file, usage:usage, navigation: navigation})}}" data-method="delete" data-confirm="Êtes-vous sûr de vouloir supprimer cet enregistrement ?"><i class="fa-solid fa-trash"></i></a>
{%endif%}
</div>
</div>
{% if navigation %}
{% if not next is empty %}
<a id="bigleft" href="{{ path("app_"~access~"_file_view",{category:category, id:id, file:next.Key, usage:usage, navigation: navigation})}}"><i class="fas fa-chevron-left fa-3x"></i></a>
{% endif %}
{% if not prev is empty %}
<a id="bigright" href="{{ path("app_"~access~"_file_view",{category:category, id:id, file:prev.Key, usage:usage, navigation: navigation})}}"><i class="fas fa-chevron-right fa-3x"></i></a>
{% endif %}
{% endif %}
{% if isimage %}
<img id="fileimage" style="display:none" src="{{path("app_"~access~"_file_show",{category:category, id:id, file:file, usage:usage})}}">
{%else%}
<iframe src="{{path("app_"~access~"_file_show",{category:category, id:id, file:file, usage:usage})}}" style="width:100%;height:600px"></iframe>
{%endif%}
{% endblock %}
{% block localscript %}
<script>
function resize() {
height=$(window).height()-($("#filetitle").height() * 2);
$("#fileimage").css({height:height,width:'auto'});
width=$(window).width()-90;
console.log(width);
if($("#fileimage").width()>width) {
$("#fileimage").css({width:width,height:'auto'});
$("#fileimage").css("margin-top",(height/2)-($("#fileimage").height()/2)+"px");
height=$(window).height();
}
height=$(window).height()-($("#filetitle").height() * 2);
$("#bigright").css({height:height,"line-height":height+"px",top:$("#filetitle").height()})
$("#bigleft").css({height:height,"line-height":height+"px",top:$("#filetitle").height()})
$("#fileimage").show();
}
$('#fileimage').imagesLoaded(function() {
resize();
});
$("body").keydown(function(e) {
if(e.keyCode == 37) { // left
var href = $('#bigleft').attr('href');
if(href!=null) window.location.href = href;
}
else if(e.keyCode == 39) {
var href = $('#bigright').attr('href');
if(href!=null) window.location.href = href;
}
});
$(window).resize(function() {
resize();
});
</script>
{% endblock %}