{% extends '@RxConnexion/Admin/content.html.twig' %}
{% block content %}
    <form method="POST" action="{{ path('accounting_file_form', {action: action, id: id}) }}" enctype="multipart/form-data">
        <div class="row max-width-initial">
            <div class="large-6 columns">
                <h5>Basic information</h5>
                <p class="form-hint-text">Enter basic information below</p>
                <div class="row">
                    <div class="large-3 large-text-right columns">
                        {{ form_label(form.fileType_desc) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.fileType_desc) }}
                        {{ form_widget(form.fileType) }}
                    </div>
                </div>
                <div class="row">
                    <div class="large-3 large-text-right columns">
                        {{ form_label(form.note) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.note) }}
                    </div>
                </div>
                <div class="large-12 columns dropzone" id="accounting-file-dropzone">
                    {#<div class="fallback">
                    </div>#}
                    {#<div class="fallback">
                        <input type="file" name="file" accept="image/*" />
                    </div>#}
                    <div class="dz-message" data-dz-message>
                        <span>Drop image file or click to select file to upload.</span>
                        <div class="dropzone-previews"></div>
                    </div>
                </div>
            </div>
            <div class="large-6 columns">
            </div>
            <div class="small-12 columns">
                <hr class="max-width-initial">
                <div class="button-container">
                    <button type="submit" class="button just-continue" name="action" value="{{ action }}"
                            data-message="Are you sure you want to save this information?"
                    >Save</button>
                    {% if action == 'u' and (userData.type == 'Super Admin' or 'Admin Province Delete' in userData.accesses) %}
                        <button type="submit" class="ask-continue button alert" name="action" value="d"
                                data-message="Are you sure you want to delete this record?"
                        >Delete</button>
                    {% endif %}
                    <a href="{{ path('accounting_file') }}" class="button secondary">Back</a>
                </div>
            </div>
        </div>
        {{ form_widget(form.action) }}
        {{ form_widget(form.id) }}
        {{ form_widget(form.file_temp_name) }}
        {{ form_widget(form._token) }}
    </form>
    {% include '@RxConnexion/Admin/js.html.twig' %}
    <script>
        //<![CDATA[
        accounting_file_form.settings.file_type_autocomplete_url = '{{ path('file_type_autocomplete') }}';
        accounting_file_form.settings.tmpFileProcessRemoveUrl = '{{ path('accounting_file_process_remove_file') }}';
        accounting_file_form.settings.tmpFileProcessUrl = '{{ path('accounting_file_proccess_file') }}';
        jQ(document).ready(function(){
            accounting_file_form.init();
        });
        //]]>
    </script>
{% endblock %}