... |
... |
@@ -1,34 +1,43 @@ |
1 |
1 |
{{velocity}} |
2 |
|
-#set($headline = $wikimacro.parameters.headline) |
3 |
|
-#set($url = $wikimacro.parameters.url) |
4 |
|
-#set($desc = $wikimacro.parameters.description) |
5 |
|
-#set($imageParam = $wikimacro.parameters.image) |
|
2 |
+#set($headline = "$!wikimacro.parameters.headline") |
|
3 |
+#set($url = "$!wikimacro.parameters.url") |
|
4 |
+#set($description = "$!wikimacro.parameters.description") |
|
5 |
+#set($image = "$!wikimacro.parameters.image") |
6 |
6 |
|
7 |
|
-#set($resolvedImage = "") |
8 |
|
-#if ($imageParam && $services.rendering) |
9 |
|
- #set($ref = $services.rendering.resolveDocumentResourceReference($imageParam, 'attachment')) |
10 |
|
- #if ($ref) |
11 |
|
- #set($resolvedImage = $ref.resourceReference.reference) |
12 |
|
- #else |
13 |
|
- #set($resolvedImage = $imageParam) |
14 |
|
- #end |
15 |
|
-#end |
|
7 |
+## Left side: Copyable syntax |
|
8 |
+{{box title="Wiki Syntax (Copy and paste this)" cssClass="infobox" style="width:48%; float:left; margin-right:2%;"}} |
|
9 |
+(% style="margin-bottom:20px; width:100%" %) |
|
10 |
+| #if($image != "") |
|
11 |
+ [[image:$image||data-xwiki-image-style="thumbnail-clickable" style="border:1px solid #ccc" width="200"]] |
|
12 |
+ #else |
|
13 |
+ No image provided. |
|
14 |
+ #end | |
|
15 |
+=== [[$headline>>$url]] === |
16 |
16 |
|
17 |
|
-## Build incident block |
18 |
|
-#set($incidentBlock = "(% class=\"incident-block\" %)\n") |
19 |
|
-#if ($resolvedImage && $resolvedImage != "") |
20 |
|
- #set($incidentBlock = "${incidentBlock}|[[image:${resolvedImage}||width=\"200\" style=\"border:1px solid #ccc\"]]| \n") |
|
17 |
+$description |
|
18 |
+ |
|
19 |
+[[Read More>>$url]] |
|
20 |
+{{/box}} |
|
21 |
+ |
|
22 |
+## Right side: Preview |
|
23 |
+{{box title="Preview" cssClass="floatinginfobox" style="width:48%; float:left;"}} |
|
24 |
+#if($image && $image != "") |
|
25 |
+ [[image:$image||width="200" style="border:1px solid #ccc;"]] |
21 |
21 |
#else |
22 |
|
- #set($incidentBlock = "${incidentBlock}|No image provided.| \n") |
|
27 |
+ (% style="width:200px; height:150px; background:#eee; text-align:center; border:1px solid #ccc;" %) |
|
28 |
+ No image |
|
29 |
+ (%) |
23 |
23 |
#end |
24 |
|
-#set($incidentBlock = "${incidentBlock}\n=== [[$headline>>$url]] ===\n\n") |
25 |
|
-#set($incidentBlock = "${incidentBlock}$desc\n[[Read More>>$url]]") |
26 |
26 |
|
27 |
|
-## Append to current document |
28 |
|
-#set($doc = $xwiki.getDocument($doc.fullName)) |
29 |
|
-#set($content = $doc.getContent()) |
30 |
|
-$doc.setContent("${content}\n\n${incidentBlock}") |
31 |
|
-$doc.save() |
|
32 |
+=== [[$headline>>$url]] === |
32 |
32 |
|
33 |
|
-<div class="xwiki-messages xwiki-successmessage">Incident added to this page.</div> |
|
34 |
+$description |
|
35 |
+ |
|
36 |
+[[Read More>>$url]] |
|
37 |
+{{/box}} |
|
38 |
+ |
|
39 |
+## Clear the floats |
|
40 |
+(% style="clear:both;" %) |
|
41 |
+(%) |
34 |
34 |
{{/velocity}} |
|
43 |
+ |