Skip to content

Instantly share code, notes, and snippets.

@westonplatter
Created October 25, 2013 17:04
Show Gist options
  • Select an option

  • Save westonplatter/7158117 to your computer and use it in GitHub Desktop.

Select an option

Save westonplatter/7158117 to your computer and use it in GitHub Desktop.
<script id="template-upload" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-upload fade">
<td class="preview"><span class="fade"></span></td>
<td class="name"><span>{%=file.name%}</span></td>
<td><label>Caption: <input name="asset[caption]" required></label></td>
<td><label>Start: <input name="asset[start]" required></label></td>
<td><label>Stop: <input name="asset[stop]" required></label></td>
<div class="hidden crop-dimensions">
<input name="asset[x1]" value="" />
<input name="asset[y1]" value="" />
<input name="asset[x2]" value="" />
<input name="asset[y2]" value="" />
<input name="asset[width]" value="" />
<input name="asset[height]" value="" />
</div>
{% if (file.error) { %}
<td class="error" colspan="2">
<span class="label label-important">{%=locale.fileupload.error%}</span> {%=locale.fileupload.errors[file.error] || file.error%}
</td>
{% } else if (o.files.valid && !i) { %}
<td>
<div class="progress progress-success progress-striped active"><div class="bar" style="width:0%;"></div></div>
</td>
<td class="start">{% if (!o.options.autoUpload) { %}
<button class="btn btn-primary">
<i class="icon-upload icon-white"></i>
<span>{%=locale.fileupload.start%}</span>
</button>
{% } %}</td>
{% } else { %}
<td colspan="2"></td>
{% } %}
<td class="cancel">{% if (!i) { %}
<button class="btn btn-warning">
<i class="icon-ban-circle icon-white"></i>
<span>{%=locale.fileupload.cancel%}</span>
</button>
{% } %}</td>
</tr>
{% } %}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment