Your IP : 216.73.217.79


Current Path : /var/www/v3.cesa.co.za/src/ContactBundle/Resources/views/Message/
Upload File :
Current File : /var/www/v3.cesa.co.za/src/ContactBundle/Resources/views/Message/index.html.twig

{% extends '@IGACoreBundle/layout.html.twig' %}

{% block title %}{{ 'Send a Message'|phrase|lower|capitalize }}{% endblock title %}

{% block page_header_h1 %}{{ 'Send a Message'|phrase|lower|capitalize }}{% endblock page_header_h1 %}

{% block head_script %}
    {{ parent() }}
    {{ encore_entry_script_tags('content') }}
    {{ encore_entry_script_tags('form') }}
{% endblock head_script %}

{% block head_style %}
    {{ parent() }}
    {{ encore_entry_link_tags('content') }}
    {{ encore_entry_link_tags('form') }}
    <link rel="stylesheet" href="{{ asset('bundles/igacontent/css/dropzone.css') }}">
{% endblock head_style %}

{% block content %}

    <div class="row">

        {{ include('@ContactBundle/Message/menu.html.twig') }}

        <div class="col-sm-12">
            {% include "@ContactBundle/Form/message.e_mail.html.twig" %}
        </div>

    </div>

{% endblock content %}

{% block foot_script %}
    {{ parent() }}
    <script src="{{ asset('bundles/igacontent/js/dropzone.js') }}"></script>
    <script language="Javascript">
        // init,configure dropzone
        Dropzone.autoDiscover = false;

        var dropzone_default = new Dropzone("#dropzone", {
            url: '{{ path('iga_content_files_upload', { 'cultureString': userLanguage.cultureString, 'messageId': messageId } )|raw }}',
            maxFiles: 5,
            dictMaxFilesExceeded: 'Only 5 files can be uploaded',
            maxFilesize: 3, // in Mb
            addRemoveLinks: true,
            init: function () {
                this.on("maxfilesexceeded", function (file) {
                    this.removeFile(file);
                });
                this.on("sending", function (file, xhr, formData) {
                    // send additional data with the file as POST data if needed.
                    // formData.append("key", "value");
                });
                this.on("success", function (file, response) {
                    if (response.uploaded)
                        alert('File Uploaded: ' + response.fileName);
                });
                this.on("removedfile", function (file) {
                    $.ajax({url: '{{ path('iga_content_files_upload', { 'cultureString': userLanguage.cultureString } )|raw }}?removeFileName=' + file.name});
                });
        {% for file in uploaded %}
                    var mockFile = {name: '{{ file.originalFileName }}', size:{{ file.fileSize(userLanguage) }}, type: '{{ file.fileMime(userLanguage) }}'}
                    ;
                    this.options.addedfile.call(this, mockFile);
                    this.options.thumbnail.call(this, mockFile, "/{{ file.id|file_html(120, true) }}");
        {% endfor %}
                }
            });

            var dropzone_default_img = new Dropzone("#dropzone-img", {
                url: '{{ path('iga_content_files_upload', { 'cultureString': userLanguage.cultureString, 'messageId': messageId, 'tempValName': 'embedded_files_' } )|raw }}',
                maxFiles: 5,
                dictMaxFilesExceeded: 'Only 5 files can be uploaded',
                maxFilesize: 3, // in Mb
                addRemoveLinks: true,
                init: function () {
                    this.on("maxfilesexceeded", function (file) {
                        this.removeFile(file);
                    });
                    this.on("sending", function (file, xhr, formData) {
                        // send additional data with the file as POST data if needed.
                        // formData.append("key", "value");
                    });
                    this.on("success", function (file, response) {
                        if (response.uploaded)
                            alert('File Uploaded: ' + response.fileName);
                    });
                    this.on("removedfile", function (file) {
                        $.ajax({url: '{{ path('iga_content_files_upload', { 'cultureString': userLanguage.cultureString } )|raw }}?tempValName=embedded_files_&removeFileName=' + file.name});
                    });
        {% for file in uploadedImg %}
                    var mockFile = {name: '{{ file.originalFileName }}', size:{{ file.fileSize(userLanguage) }}, type: '{{ file.fileMime(userLanguage) }}'}
                    ;
                    this.options.addedfile.call(this, mockFile);
                    this.options.thumbnail.call(this, mockFile, "/{{ file.id|file_html(120, true) }}");
        {% endfor %}
                }
            });
    </script>
{% endblock foot_script %}