<?php

/* @UVDeskCore/Templates/attachment.html.twig */
class __TwigTemplate_98d30eabf54f8a7b4b20b5a5f6b927bcdd04dda9b8fd4706d77b29322dde05b0 extends Twig_Template
{
    private $source;

    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->source = $this->getSourceContext();

        $this->parent = false;

        $this->blocks = [
        ];
    }

    protected function doDisplay(array $context, array $blocks = [])
    {
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new Twig_Profiler_Profile($this->getTemplateName(), "template", "@UVDeskCore/Templates/attachment.html.twig"));

        // line 1
        echo "<style>
    input.attachment {
        display: none;
    }
</style>
<script type=\"text/javascript\">
    \$(function () {
        var FileView = Backbone.View.extend({
            fileCounter: 0,
            el: '.attachment-block',
            events : {
                'click .uv-file-label': 'createFileType',
                'change .attachment': 'selectFile',
                'click .uv-added-attachment span': 'removeFile'
            },
            createFileType: function(e) {
                currentElement = Backbone.\$(e.currentTarget)
                this.fileCounter += 1;
                currentElement.parents('.attachment-block').append('<div class=\"uv-added-attachment\" style=\"display: none\" id=\"file-' + this.fileCounter + '\"><div class=\"uv-attachment\"><input type=\"file\" name=\"attachments[]\" class=\"attachment\" multiple=\"multiple\"></div><span></span></div>')
                \$('#file-' + this.fileCounter).find('.attachment').trigger('click')
            },
            labelTemplate: _.template('<label class=\"file-name\"><%- fileName %></label><br>'),
            selectFile: function(e) {
                currentElement = Backbone.\$(e.currentTarget)
                var attachmentBlock = currentElement.parents(\".uv-added-attachment\");
                if(currentElement.length) {
                   files = currentElement[0].files; 
                   if(files.length) {
                        for (var i = 0; i < files.length; i++) {
                            var fileName = files[i].name;
                            attachmentBlock.append(this.labelTemplate({'fileName': fileName}));
                        }
                   }
                }

                attachmentBlock.show()
            },
            removeFile: function(e) {
                Backbone.\$(e.currentTarget).parents('.uv-added-attachment').remove()
            }
        });
        
        var fileView = new FileView();
    });
</script>";
        
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);

    }

    public function getTemplateName()
    {
        return "@UVDeskCore/Templates/attachment.html.twig";
    }

    public function getDebugInfo()
    {
        return array (  26 => 1,);
    }

    public function getSourceContext()
    {
        return new Twig_Source("<style>
    input.attachment {
        display: none;
    }
</style>
<script type=\"text/javascript\">
    \$(function () {
        var FileView = Backbone.View.extend({
            fileCounter: 0,
            el: '.attachment-block',
            events : {
                'click .uv-file-label': 'createFileType',
                'change .attachment': 'selectFile',
                'click .uv-added-attachment span': 'removeFile'
            },
            createFileType: function(e) {
                currentElement = Backbone.\$(e.currentTarget)
                this.fileCounter += 1;
                currentElement.parents('.attachment-block').append('<div class=\"uv-added-attachment\" style=\"display: none\" id=\"file-' + this.fileCounter + '\"><div class=\"uv-attachment\"><input type=\"file\" name=\"attachments[]\" class=\"attachment\" multiple=\"multiple\"></div><span></span></div>')
                \$('#file-' + this.fileCounter).find('.attachment').trigger('click')
            },
            labelTemplate: _.template('<label class=\"file-name\"><%- fileName %></label><br>'),
            selectFile: function(e) {
                currentElement = Backbone.\$(e.currentTarget)
                var attachmentBlock = currentElement.parents(\".uv-added-attachment\");
                if(currentElement.length) {
                   files = currentElement[0].files; 
                   if(files.length) {
                        for (var i = 0; i < files.length; i++) {
                            var fileName = files[i].name;
                            attachmentBlock.append(this.labelTemplate({'fileName': fileName}));
                        }
                   }
                }

                attachmentBlock.show()
            },
            removeFile: function(e) {
                Backbone.\$(e.currentTarget).parents('.uv-added-attachment').remove()
            }
        });
        
        var fileView = new FileView();
    });
</script>", "@UVDeskCore/Templates/attachment.html.twig", "/home/users/akshay.kumar/Workstation/apps/uvdesk/releases/uvdesk_community_01_development_php_72/vendor/uvdesk/core-framework/Resources/views/Templates/attachment.html.twig");
    }
}
