... |
... |
@@ -94,29 +94,24 @@ |
94 |
94 |
== Images and Videos == |
95 |
95 |
|
96 |
96 |
{{velocity}} |
97 |
|
-#panelheader('Gallery') |
98 |
|
- |
99 |
99 |
#set($attachments = $doc.getAttachmentList()) |
100 |
|
-#set($imageCount = 0) |
101 |
|
- |
|
98 |
+#if($attachments.size() > 0) |
|
99 |
+<div style="display: flex; flex-wrap: wrap; gap: 10px;"> |
102 |
102 |
#foreach($attachment in $attachments) |
103 |
|
- #if($attachment.filename.endsWith(".jpg") || $attachment.filename.endsWith(".png") || $attachment.filename.endsWith(".webp")) |
104 |
|
- #set($imageCount = $imageCount + 1) |
|
101 |
+ #set($filename = $attachment.getFilename()) |
|
102 |
+ #set($ext = $stringtool.substringAfterLast($filename, ".")) |
|
103 |
+ #if($ext.equalsIgnoreCase("jpg") || $ext.equalsIgnoreCase("jpeg") || $ext.equalsIgnoreCase("png") || $ext.equalsIgnoreCase("webp")) |
|
104 |
+ <div style="flex: 1 1 300px; max-width: 300px;"> |
|
105 |
+ <img src="$xwiki.getURL($doc.fullName, 'download', "filename=$escapetool.url($filename)")" |
|
106 |
+ alt="$filename" |
|
107 |
+ style="max-width: 100%; height: auto; border: 1px solid #444;"/> |
|
108 |
+ </div> |
105 |
105 |
#end |
106 |
106 |
#end |
107 |
|
- |
108 |
|
-#if($imageCount > 0) |
109 |
|
- {{gallery}} |
110 |
|
- #foreach($attachment in $attachments) |
111 |
|
- #if($attachment.filename.endsWith(".jpg") || $attachment.filename.endsWith(".png") || $attachment.filename.endsWith(".webp")) |
112 |
|
- image:$attachment.filename |
113 |
|
- #end |
114 |
|
- #end |
115 |
|
- {{/gallery}} |
|
111 |
+</div> |
116 |
116 |
#end |
117 |
|
- |
118 |
|
-#panelfooter() |
119 |
119 |
{{/velocity}} |
120 |
120 |
|
121 |
121 |
|
|
116 |
+ |
122 |
122 |
{{putFootnotes/}} |