mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-25 17:13:49 +00:00
upload and retrieve document
This commit is contained in:
7
Resources/views/Form/fields.html.twig
Normal file
7
Resources/views/Form/fields.html.twig
Normal file
@@ -0,0 +1,7 @@
|
||||
{% block stored_object_widget %}
|
||||
<div data-stored-object="data-stored-object">
|
||||
{{ form_widget(form.filename) }}
|
||||
{{ form_widget(form.keyInfos, { 'attr': { 'data-stored-object-key': 1 } }) }}
|
||||
{{ form_widget(form.iv, { 'attr': { 'data-stored-object-iv': 1 } }) }}
|
||||
</div>
|
||||
{% endblock %}
|
3
Resources/views/Macro/macro.html.twig
Normal file
3
Resources/views/Macro/macro.html.twig
Normal file
@@ -0,0 +1,3 @@
|
||||
{% macro download_button(storedObject) %}
|
||||
<a class="sc-button bt-download" data-download-button data-key="{{ storedObject.keyInfos|json_encode|escape('html_attr') }}" data-iv="{{ storedObject.iv|json_encode|escape('html_attr') }}" data-temp-url-get="{{ storedObject|file_url }}">{{ 'Download'|trans }}</a>
|
||||
{% endmacro %}
|
@@ -19,8 +19,14 @@
|
||||
|
||||
{% set activeRouteKey = '' %}
|
||||
|
||||
{% import "@ChillDocStore/Macro/macro.html.twig" as m %}
|
||||
|
||||
{% block title %}{{ 'Documents for %name%'|trans({ '%name%': person.firstName|capitalize ~ ' ' ~ person.lastName } )|capitalize }}{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
<script src="{{ asset('build/async_upload.js') }}" type="text/javascript"></script>
|
||||
{% endblock %}
|
||||
|
||||
{% block personcontent %}
|
||||
<h1>{{ 'Document for %name%'|trans({ '%name%': person.firstName|capitalize ~ ' ' ~ person.lastName } )|capitalize }}</h1>
|
||||
|
||||
@@ -42,6 +48,9 @@
|
||||
<td>
|
||||
<ul class="record_actions">
|
||||
{% if is_granted('CHILL_PERSON_DOCUMENT_SEE_DETAILS', document) %}
|
||||
<li>
|
||||
{{ m.download_button(document.object) }}
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ path('person_document_show', {'person': person.id, 'id': document.id}) }}" class="sc-button">
|
||||
{{ 'See'|trans }}
|
||||
|
@@ -38,3 +38,7 @@
|
||||
</ul>
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
<script src="{{ asset('build/async_upload.js') }}" type="text/javascript"></script>
|
||||
{% endblock %}
|
||||
|
Reference in New Issue
Block a user