sftpbrowser/templates/Home/home.html.twig

142 lines
5.7 KiB
Twig
Raw Normal View History

2022-12-23 16:27:07 +01:00
{% extends "base.html.twig" %}
{% block body %}
<div class="float-end">
2023-01-03 10:50:07 +01:00
{% if fakeAfnor %}
<button id="addafnor" onClick="showAfnor()" type="button" class="btn btn_link" data-toggle="modal" data-target="#afnor">
AFNOR
</button>
{% endif %}
2022-12-23 16:27:07 +01:00
<button id="addfolder" onClick="showFolder()" type="button" class="btn btn_link" data-toggle="modal" data-target="#folder">
<i class="fa fa-folder-plus fa-2x fa-fw"></i>
</button>
<a class="btn btn_link btn-modal" data-modalid="mymodallarge" data-modalurl="{{ path('app_home_upload',{folder:infolder}) }}">
<i class="fa fa-upload fa-2x fa-fw"></i>
</a>
</div>
<div style="font-size:180%">
{% for folder in tree %}
{% if not loop.first %}&nbsp;/&nbsp;{%endif%}
<a href='{{path("app_home",{folder:folder.folder})}}'>{{folder.name}}</a>
{% endfor %}
</div>
<ul class="list-group mt-3">
{% for folder in folders %}
<li class="list-group-item">
<a href='{{path("app_home",{folder:(infolder~"/"~folder)})}}'>
<i class="fa-solid fa-folder fa-fw fa-2x"></i>
<span style="font-size:180%">{{folder}}</span>
</a>
<span class="btn_link btn-action float-end">
<a onClick="showFile('{{folder}}')"><i class="fa-solid fa-pencil fa-fw"></i></a>
<a href='{{path("app_home_delete",{folder:infolder,file:(infolder~"/"~folder)})}}'><i class="fa-solid fa-trash fa-fw"></i></a>
</span>
</li>
{%endfor%}
{% for file in files %}
<li class="list-group-item">
<a href='{{path("app_home_download",{file:(infolder~"/"~file)})}}' target="_blank">
<i class="fa-solid fa-file fa-fw fa-2x"></i>
<span style="font-size:180%">{{file}}</span>
</a>
<span class="btn_link btn-action float-end">
<a onClick="showFile('{{file}}')"><i class="fa-solid fa-pencil fa-fw"></i></a>
<a href='{{path("app_home_delete",{folder:infolder,file:(infolder~"/"~file)})}}'><i class="fa-solid fa-trash fa-fw"></i></a>
</span>
</li>
{%endfor%}
</ul>
<div id="folder" class="modal" tabindex="-1">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Création Répertoire</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
{{ form_start(formfolder) }}
{{ form_end(formfolder) }}
</div>
</div>
</div>
</div>
<div id="file" class="modal" tabindex="-1">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Modification</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
{{ form_start(formfile) }}
{{ form_end(formfile) }}
</div>
</div>
</div>
</div>
2023-01-03 10:50:07 +01:00
<div id="afnor" class="modal" tabindex="-1">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Génération Fichier AFNOR</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
{{ form_start(formafnor) }}
{{ form_row(formafnor.submit) }}
{{ form_row(formafnor.id) }}
{{ form_row(formafnor.codeproduct) }}
{{ form_label(formafnor.codequalifications) }}
<ul id="codequalifications-list"
data-prototype="{{ form_widget(formafnor.codequalifications.vars.prototype)|e }}"
data-widget-tags="{{ '<li></li>'|e }}"
data-widget-counter="{{ formafnor.codequalifications|length }}">
{% for codequalification in formafnor.codequalifications %}
<li>
{{ form_errors(codequalification) }}
{{ form_widget(codequalification) }}
</li>
{% endfor %}
</ul>
{{ form_end(formafnor, {render_rest: false}) }}
<button type="button" class="add-another-collection-widget btn btn-primary" data-list-selector="#codequalifications-list">Ajouter Qualification</button>
</div>
</div>
</div>
</div>
2022-12-23 16:27:07 +01:00
{% endblock %}
{% block localscript %}
<script>
function showFolder() {
$('#folder').modal('show');
$('#folder_name').focus();
}
function showFile(file) {
$('#file').modal('show');
$('#file_oldname').val(file);
$('#file_name').val(file);
$('#file_name').focus();
}
2023-01-03 10:50:07 +01:00
function showAfnor() {
$('#afnor').modal('show');
}
2022-12-23 16:27:07 +01:00
</script>
{% endblock %}