Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
irul
/
opensipkd-base
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit de32e5c8
authored
Oct 29, 2025
by
iWan Mustaqim
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
File Upload PDF
1 parent
6a8fa480
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
5 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 @
de32e5c
...
...
@@ -7,7 +7,8 @@
delete cstruct.get('delete')|'';
maxsize field.widget.size|5242880;
img ['jpg', 'jpeg', 'gif', 'png', 'svg', 'eps', 'psd'];
video ['avi', 'mov', 'mpv']
video ['avi', 'mov', 'mpv'];
pdf ['pdf'];
">
${field.start_mapping()}
<img tal:condition="ext in img" id="preview-${oid}" alt="" src="${preview_url}"
...
...
@@ -18,7 +19,7 @@ ${field.start_mapping()}
Your browser does not support the video tag.
</video>
<!-- Preview Video -->
<video tal:condition="ext=='mp4'"
controls
style="${style}"
...
...
@@ -27,7 +28,18 @@ ${field.start_mapping()}
Your browser does not support the video tag.
</video>
<embed tal:condition="ext=='pdf'" src="${preview_url}" style="${style}">
<!-- Preview PDF -->
<tal:block tal:condition="ext in pdf">
<embed id="preview-${oid}"
src="${preview_url}"
type="application/pdf"
width="100%"
height="600px"
style="${style or 'border:1px solid #ddd;border-radius:4px;'}" />
<p>
<a href="${preview_url}" target="_blank">Buka PDF di tab baru</a>
</p>
</tal:block>
<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>
...
...
opensipkd/base/views/widgets/readonly/file_upload.pt
View file @
de32e5c
...
...
@@ -8,6 +8,7 @@
ext str(cstruct.get('filename').split('.')[-1:][0]).lower()|[];
img ['jpg', 'jpeg', 'gif', 'png', 'svg', 'eps', 'psd'];
video ['avi', 'mov', 'mpv'];
pdf ['pdf'];
">
<img tal:condition="ext in img" id="preview-${oid}" alt="" src="${preview_url}"
style="${style}"
...
...
@@ -17,7 +18,7 @@
Your browser does not support the video tag.
</video>
<!-- Preview Video -->
<video tal:condition="ext=='mp4'"
controls
style="${style}"
...
...
@@ -26,7 +27,17 @@
Your browser does not support the video tag.
</video>
<embed tal:condition="ext=='pdf'" src="${preview_url}" style="${style}">
<!-- Preview PDF -->
<tal:block tal:condition="ext in pdf">
<embed src="${preview_url}"
type="application/pdf"
width="100%"
height="600px"
style="${style or 'border:1px solid #ddd;border-radius:4px;'}" />
<p>
<a href="${preview_url}" target="_blank">Buka PDF di tab baru</a>
</p>
</tal:block>
<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>
...
...
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