app/views/uploader/default/_download.html.erb in rails-uploader-0.0.3 vs app/views/uploader/default/_download.html.erb in rails-uploader-0.0.4
- old
+ new
@@ -1,29 +1,17 @@
<!-- The template to display files available for download -->
<script id="template-download" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
- <tr class="template-download fade">
- {% if (file.error) { %}
- <td></td>
- <td class="name"><span>{%=file.name%}</span></td>
- <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
- <td class="error" colspan="2"><span class="label label-important">{%=locale.fileupload.error%}</span> {%=locale.fileupload.errors[file.error] || file.error%}</td>
- {% } else { %}
- <td class="preview">{% if (file.thumbnail_url) { %}
- <a href="{%=file.url%}" title="{%=file.name%}" rel="gallery" download="{%=file.name%}"><img src="{%=file.thumbnail_url%}"></a>
- {% } %}</td>
- <td class="name">
- <a href="{%=file.url%}" title="{%=file.name%}" rel="{%=file.thumbnail_url&&'gallery'%}" download="{%=file.name%}">{%=file.name%}</a>
- </td>
- <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
- <td colspan="2"></td>
- {% } %}
- <td class="delete">
- <button class="btn btn-danger" data-type="{%=file.delete_type%}" data-url="{%=file.delete_url%}">
- <i class="icon-trash icon-white"></i>
- <span>{%=locale.fileupload.destroy%}</span>
- </button>
- <input type="checkbox" name="delete" value="1">
- </td>
- </tr>
+ <div class="attach_item template-download">
+ <div class="delete">
+ <a href="/" class="del_btn" data-type="DELETE" data-url="/uploader/attachments/{%=file.id%}?klass=<%= field.klass %>"></a>
+ </div>
+ <div class="thumbnail preview">
+ <a href="{%=file.url%}"><img src="{%=file.thumb_url%}" title="{%=file.filename%}" rel="gallery"></a>
+ </div>
+ <div class="infoHolder">
+ <div class="fileName">{%=file.filename%}</div>
+ <div class="fileWeight">{%=o.formatFileSize(file.size)%}</div>
+ </div>
+ </div>
{% } %}
</script>