{# /** * This file is part of HumanResources plugin for FacturaScripts. * FacturaScripts Copyright (C) 2015-2020 Carlos Garcia Gomez * HumanResources Copyright (C) 2018-2021 Jose Antonio Cuello Principal * * This program and its files are under the terms of the license specified in the LICENSE file. * * @author Jose Antonio Cuello Principal */ #} {% set firstView = fsc.views | first %} {% set doc = firstView.model %} {% set currentView = fsc.getCurrentView() %}
{# -- New form -- #}
{{ formToken() }}
  {{ currentView.title }}
{{ _self.inputTextArea('') }}

{{ trans('help-server-accepts-filesize', {'%size%': currentView.model.getMaxFileUpload()}) }}

{# -- Attached files -- #}
{% for counter, docfile in currentView.cursor %} {% set formName = currentView.getViewName() ~ (counter + 1) %} {% set file = docfile.getFile() %} {% set urlDownload = file.url('download') %}
{{ formToken() }}
 {{ file.filename }}
{{ _self.inputTextArea(docfile.observations) }}
{{ _self.buttonDelete(formName) }}
{{ docfile.nick }}   {{ docfile.creationdate }}
{{ trans('download') }}
{{ _self.previewFile(urlDownload, file.filename, file.getExtension()) }}
{% endfor %}
{% macro inputTextArea(text) %}
{% endmacro %} {% macro previewFile(url, filename, extFile) %} {% if extFile in ['gif','jpg', 'jpeg','png', 'svg', 'webp'] %} {{ filename }} {% elseif extFile in ['mp4', 'ogg', 'webm'] %}
{% elseif extFile == 'pdf' %} {% else %}

{{ trans('preview-file-type-not-soported') }}

{% endif %} {% endmacro %} {% macro buttonDelete(formName) %} {% set label = trans('delete-file') %} {% set text = trans('are-you-sure') %} {% set cancel = trans('cancel') %} {% set confirm = trans('confirm') %} {% endmacro %}