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
Hide 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()}
...
@@ -14,7 +14,8 @@ ${field.start_mapping()}
style="${style}"
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
<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.
Your browser does not support the video tag.
</video>
</video>
...
@@ -23,14 +24,16 @@ ${field.start_mapping()}
...
@@ -23,14 +24,16 @@ ${field.start_mapping()}
controls
controls
style="${style}"
style="${style}"
src="${preview_url}"
src="${preview_url}"
type="video/mp4">
type="video/mp4"
id="preview-${oid}">
Your browser does not support the video tag.
Your browser does not support the video tag.
</video>
</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}"
<a class="label label-default" href="${preview_url}"
target="_blank"><i class="fa fa-search"></i> View</a>
target="_blank"
id="a-preview-${oid}"
><i class="fa fa-search"></i> View</a>
<input type="file" name="upload" id="${oid}"
<input type="file" name="upload" id="${oid}"
tal:attributes="style style;
tal:attributes="style style;
...
...
opensipkd/base/views/widgets/readonly/file_upload.pt
View file @
c0d3b36
...
@@ -6,14 +6,17 @@
...
@@ -6,14 +6,17 @@
fname str(cstruct.get('filename'))|'';
fname str(cstruct.get('filename'))|'';
delete cstruct.get('delete')|'';
delete cstruct.get('delete')|'';
ext str(cstruct.get('filename').split('.')[-1:][0]).lower()|[];
ext str(cstruct.get('filename').split('.')[-1:][0]).lower()|[];
oid oid|field.oid;
img ['jpg', 'jpeg', 'gif', 'png', 'svg', 'eps', 'psd'];
img ['jpg', 'jpeg', 'gif', 'png', 'svg', 'eps', 'psd'];
video ['avi', 'mov', 'mpv'];
video ['avi', 'mov', 'mpv'];
">
">
<img tal:condition="ext in img" id="preview-${oid}" alt="" src="${preview_url}"
<img tal:condition="ext in img" id="preview-${oid}" alt="" src="${preview_url}"
style="${style}"
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
<video tal:condition="ext in video"
src="${preview_url}" type="video/${ext}">
style="${style}" controls
src="${preview_url}" type="video/${ext}"
id="preview-${oid}">
Your browser does not support the video tag.
Your browser does not support the video tag.
</video>
</video>
...
@@ -22,16 +25,17 @@
...
@@ -22,16 +25,17 @@
controls
controls
style="${style}"
style="${style}"
src="${preview_url}"
src="${preview_url}"
type="video/mp4">
type="video/mp4"
id="preview-${oid}">
Your browser does not support the video tag.
Your browser does not support the video tag.
</video>
</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']">
<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>
<img src="${structure: preview_url}" style="width:100px;height:auto;"></img>
<br>
<br>
</tal:block>
</tal:block>
<a class="label label-default" href="${structure: preview_url}"
<a
id="a-preview-${oid}"
class="label label-default" href="${structure: preview_url}"
target="_blank"><i class="fa fa-search"></i> View</a>
target="_blank"
><i class="fa fa-search"></i> View</a>
</p>
</p>
\ No newline at end of file
\ 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