Commit c0d3b361 by aa.gusti

perbaikan file_upload widget

1 parent 99aad6a3
......@@ -14,7 +14,8 @@ ${field.start_mapping()}
style="${style}"
onload="window.URL.revokeObjectURL(this.src);"></img>
<video tal:condition="ext in video" style="${style}" controls
src="${preview_url}" type="video/${ext}">
src="${preview_url}" type="video/${ext}"
id="preview-${oid}">
Your browser does not support the video tag.
</video>
......@@ -23,14 +24,16 @@ ${field.start_mapping()}
controls
style="${style}"
src="${preview_url}"
type="video/mp4">
type="video/mp4"
id="preview-${oid}">
Your browser does not support the video tag.
</video>
<embed tal:condition="ext=='pdf'" src="${preview_url}" style="${style}">
<embed tal:condition="ext=='pdf'" src="${preview_url}" style="${style}"
id="preview-${oid}">
<a id="label-${oid}" tal:condition="preview_url" class="label label-default" href="${preview_url}"
target="_blank"><i class="fa fa-search"></i> View</a>
<a class="label label-default" href="${preview_url}"
target="_blank" id="a-preview-${oid}"><i class="fa fa-search"></i> View</a>
<input type="file" name="upload" id="${oid}"
tal:attributes="style style;
......
......@@ -6,14 +6,17 @@
fname str(cstruct.get('filename'))|'';
delete cstruct.get('delete')|'';
ext str(cstruct.get('filename').split('.')[-1:][0]).lower()|[];
oid oid|field.oid;
img ['jpg', 'jpeg', 'gif', 'png', 'svg', 'eps', 'psd'];
video ['avi', 'mov', 'mpv'];
">
<img tal:condition="ext in img" id="preview-${oid}" alt="" src="${preview_url}"
style="${style}"
onload="window.URL.revokeObjectURL(this.src);"></img>
<video tal:condition="ext in video" style="${style}" controls
src="${preview_url}" type="video/${ext}">
<video tal:condition="ext in video"
style="${style}" controls
src="${preview_url}" type="video/${ext}"
id="preview-${oid}">
Your browser does not support the video tag.
</video>
......@@ -22,16 +25,17 @@
controls
style="${style}"
src="${preview_url}"
type="video/mp4">
type="video/mp4"
id="preview-${oid}">
Your browser does not support the video tag.
</video>
<embed tal:condition="ext=='pdf'" src="${preview_url}" style="${style}">
<embed tal:condition="ext=='pdf'" src="${preview_url}" style="${style}" id="preview-${oid}">
<tal:block tal:condition="preview_url and ext in ['jpg','jpeg','png','bmp','gif']">
<img src="${structure: preview_url}" style="width:100px;height:auto;"></img>
<br>
</tal:block>
<a class="label label-default" href="${structure: preview_url}"
target="_blank"><i class="fa fa-search"></i> View</a>
<a id="a-preview-${oid}" class="label label-default" href="${structure: preview_url}"
target="_blank" ><i class="fa fa-search"></i> View</a>
</p>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!