Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
aa.gusti
/
opensipkd-base
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit c0d3b361
authored
Dec 17, 2024
by
aa.gusti
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
perbaikan file_upload widget
1 parent
99aad6a3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
11 deletions
opensipkd/base/views/widgets/file_upload.pt
opensipkd/base/views/widgets/readonly/file_upload.pt
opensipkd/base/views/widgets/file_upload.pt
View file @
c0d3b36
...
...
@@ -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;
...
...
opensipkd/base/views/widgets/readonly/file_upload.pt
View file @
c0d3b36
...
...
@@ -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
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment