ajout upload_doc.pt

This commit is contained in:
2019-02-01 16:24:13 +01:00
parent 984ff520fb
commit 339525b8ae
6 changed files with 126 additions and 5 deletions

View File

@@ -206,6 +206,10 @@
</div>
<div id="panel-attaches" class="panel-collapse collapse">
<div class="panel-body">
<p>
<a href="${request.application_url}/upload_doc/${nodossier}" class="btn btn-primary" role="button">
<span class="glyphicon glyphicon-cloud-upload"></span>&nbsp;Télécharger un document</a>
</p>
<ul>
<div tal:repeat="detail docs_attaches">
<li>
@@ -216,7 +220,7 @@
onclick="window.open('${docs_url}${detail.nomrep}/${detail.societe}/${detail.nomfichier},'popup','width=900,height=768'); return false;">
${detail.nomfichier}
</a>
&nbsp;-&nbsp;${detail.cree_le.strftime('%d-%m-%Y')}&nbsp;-&nbsp;${detail.taillefichier}
&nbsp;-&nbsp;crée le ${detail.cree_le.strftime('%d-%m-%Y')}&nbsp;par&nbsp;${detail.usermaj}
</li>
</div>
</ul>

View File

@@ -0,0 +1,52 @@
<metal:block use-macro="main_template">
<div metal:fill-slot="content">
<div tal:condition="message" tal:content="message" class="alert alert-success" />
<div class="row">
<form action="${url}" method="post" accept-charset="utf-8" enctype="multipart/form-data"
data-fv-framework="bootstrap"
data-fv-icon-valid="glyphicon glyphicon-ok"
data-fv-icon-invalid="glyphicon glyphicon-remove"
data-fv-icon-validating="glyphicon glyphicon-refresh">
<div class="form-group">
<label for="uploadfile">Séléctionner un fichier</label>
<input id="uploadfile" name="filename" type="file" value="" required
data-fv-file___extension="jpeg, jpg,png,pdf,doc"
data-fv-file___type="image/jpeg,image/png,application/pdf,application/msword"
data-fv-file___max-size="4194304"
data-fv-file___message="Le format du fichier sélectionné n'est pas valide" />
</div>
<div class="form-group">
<a class="btn btn-default" href="${request.route_url('dossier_view', nodossier=nodossier)}">
<span class="glyphicon glyphicon-arrow-left"></span> Retiur au dossier</a>
<button class="btn btn-primary" type="submit" name="form.submitted">
<span class="glyphicon glyphicon-cloud-upload"></span> Télécharger</button>
</div>
</form>
<ul>
<li>Seuls les documents au format <b>PDF, PNG, JPEG, ou DOC</b> seront acceptés.</li>
<li>La taille de chaque document ne doit <b>pas dépasser 4 Mo</b>.</li>
</ul>
</div>
<h3>Documents déjà téléchargés dans le dossier</h3>
<ul>
<div tal:repeat="detail docs_attaches">
<li>
<span class="glyphicon glyphicon-file" tal:condition="detail.nomfichier[-3:]=='pdf'"></span>
<span class="glyphicon glyphicon-picture" tal:condition="detail.nomfichier[-3:]=='jpg'"></span>
<a href="${docs_url}${detail.nomrep}/${detail.societe}/${detail.nomfichier}"
target="popup"
onclick="window.open('${docs_url}${detail.nomrep}/${detail.societe}/${detail.nomfichier},'popup','width=900,height=768'); return false;">
${detail.nomfichier}
</a>
&nbsp;-&nbsp;crée le ${detail.cree_le.strftime('%d-%m-%Y')}&nbsp;par&nbsp;${detail.usermaj}
</li>
</div>
</ul>
</div>
</metal:block>