update template file_upload

1 parent c33d806e
...@@ -5,13 +5,9 @@ ...@@ -5,13 +5,9 @@
css css|[]; css css|[];
js js|[]; js js|[];
"> ">
<head> <head>
<!--<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">--> <!--<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">-->
<title>${request.app_name} | ${request.company}</title> <title>${request.app_name} | ${request.company}</title>
<meta name="description" content=""> <meta name="description" content="">
<meta name="author" content=""> <meta name="author" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
...@@ -207,8 +203,6 @@ ...@@ -207,8 +203,6 @@
</span> </span>
</aside> </aside>
<!-- END NAVIGATION --> <!-- END NAVIGATION -->
<!-- JS --> <!-- JS -->
<script src="${home}/static/v3/js/jquery-2.1.1.min.js"></script> <script src="${home}/static/v3/js/jquery-2.1.1.min.js"></script>
<script> <script>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
css_class css_class|field.widget.css_class; css_class css_class|field.widget.css_class;
style style|field.widget.style; style style|field.widget.style;
preview_url cstruct.get('preview_url')|''; preview_url cstruct.get('preview_url')|'';
ext str(cstruct.get('filename').split('.')[-1:][0]).lower()|[]; ext str(cstruct.get('filename').split('.')[-1:][0]).lower()|'';
fname str(cstruct.get('filename'))|''; fname str(cstruct.get('filename'))|'';
delete cstruct.get('delete')|''; delete cstruct.get('delete')|'';
maxsize field.widget.size|5242880; maxsize field.widget.size|5242880;
...@@ -10,8 +10,12 @@ ...@@ -10,8 +10,12 @@
video ['avi', 'mov', 'mp4'] video ['avi', 'mov', 'mp4']
"> ">
${field.start_mapping()} ${field.start_mapping()}
<div class="thumbnail" tal:condition="not ext or ext ==''">
<img id="preview-${oid}" alt="" src="${preview_url}" style="${style}"
onload="window.URL.revokeObjectURL(this.src);"></img>
</div>
<div class="thumbnail" tal:condition="ext in img or ext in video or ext=='pdf'"> <div class="thumbnail" tal:condition="ext in img or ext in video or ext=='pdf'">
<img tal:condition="ext in img" id="preview-${oid}" alt="" src="${preview_url}" style="${style}" <img tal:condition="ext in img or ext" id="preview-${oid}" alt="" src="${preview_url}" style="${style}"
onload="window.URL.revokeObjectURL(this.src);"></img> 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}"> id="preview-${oid}">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!