jQuery File Upload Widget and Using Templates
<p>I'm trying to implement the <a href="https://github.com/blueimp/jQuery-File-Upload" rel="nofollow">jQuery File Upload</a> Widget on my website.</p>

<p>What I need to do is to create 2 unique widgets wich isn't a problem because I can put <a href="https://github.com/blueimp/jQuery-File-Upload/wiki/Multiple-File-Upload-Widgets-on-the-same-page" rel="nofollow">Multiple File Upload Widgets on the same page</a>.  The only problem is that the templates are hard-coded in the widget.  So, if I want to have multiple widgets, it seems, I would have to only have a template for one of them.  This seems strange since there is support for multiple widgets.  I must be missing something.</p>

<p>This is how I've initialized the widget:</p>

<pre><code>$("#fileupload").fileupload({
    dataType:'json',
    url:'Uploader/server/php/index.php',
    autoUpload:true,
    maxFileSize:5000000,
    acceptFileTypes:/(\.|\/)(pdf|docx|doc|xlsx|xls|rtf|txt)$/i
});
</code></pre>

<p>This is how I've created the templates:</p>

<pre><code>&lt;script id="template-upload" type="text/html"&gt;
    {% for (var i=0, files=o.files, l=files.length, file=files[0]; i&lt;l; file=files[++i]) { %}
        &lt;div class="uploaded"&gt;
        File Name: {%=file.name%}
        {% if (file.error) { %}
            &lt;span class="upload-error"&gt;Error: {%=fileUploadErrors[file.error] || file.error%}&lt;/span&gt;
        {% } else if (o.files.valid &amp;&amp; !i) { %}
            &lt;span class="progress"&gt;&lt;div class="progressbar"&gt;&lt;div style="width:0%;"&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;
        {% } %}
        &lt;/div&gt;
        {% } %}
&lt;/script&gt;
&lt;script id="template-download" type="text/html"&gt;
    {% for (var i=0, files=o.files, l=files.length, file=files[0]; i&lt;l; file=files[++i]) { %}
        &lt;div class="uploaded"&gt;
            File Name: {%=file.name%}
            &lt;span class="delete"&gt;
                &lt;button class="text-button remove" data-type="{%=file.delete_type%}" data-url="{%=file.delete_url%}"&gt;x&lt;/button&gt;
            &lt;/span&gt;
        &lt;/div&gt;
    {% } %}
&lt;/script&gt;
</code></pre>
