0 Votes

Changes for page SubmitIncidentMacro

Last modified by Ryan C on 2025/06/08 05:22

From version 2.11
edited by Ryan C
on 2025/06/08 03:59
Change comment: There is no comment for this version
To version 2.9
edited by Ryan C
on 2025/06/08 03:48
Change comment: There is no comment for this version

Summary

Details

XWiki.WikiMacroClass[0]
Macro code
... ... @@ -1,4 +1,5 @@
1 1  {{velocity}}
2 +
2 2  #set($headline = $wikimacro.parameters.headline)
3 3  #set($url = $wikimacro.parameters.url)
4 4  #set($desc = $wikimacro.parameters.description)
... ... @@ -15,20 +15,22 @@
15 15  #end
16 16  
17 17  ## Build incident block
18 -#set($incidentBlock = "(% class=\"incident-block\" %)\n")
19 +#set($block = "(% style=\"margin-bottom:20px; width:100%\" %)\n")
19 19  #if ($resolvedImage && $resolvedImage != "")
20 - #set($incidentBlock = "${incidentBlock}|[[image:${resolvedImage}||width=\"200\" style=\"border:1px solid #ccc\"]]| \n")
21 + #set($block = "${block}|[[image:${resolvedImage}||data-xwiki-image-style=\"thumbnail-clickable\" style=\"border:1px solid #ccc\" width=\"200\"]]| \n")
21 21  #else
22 - #set($incidentBlock = "${incidentBlock}|No image provided.| \n")
23 + #set($block = "${block}|No image provided.| \n")
23 23  #end
24 -#set($incidentBlock = "${incidentBlock}\n=== [[$headline>>$url]] ===\n\n")
25 -#set($incidentBlock = "${incidentBlock}$desc\n[[Read More>>$url]]")
25 +#set($block = "${block}\n=== [[$headline>>$url]] ===\n\n")
26 +#set($block = "${block}$desc\n[[Read More>>$url]]")
26 26  
27 27  ## Append to current document
28 28  #set($doc = $xwiki.getDocument($doc.fullName))
29 29  #set($content = $doc.getContent())
30 -$doc.setContent("${content}\n\n${incidentBlock}")
31 +$doc.setContent("${content}\n\n${block}")
31 31  $doc.save()
32 32  
33 33  <div class="xwiki-messages xwiki-successmessage">Incident added to this page.</div>
35 +
34 34  {{/velocity}}
37 +
XWiki.WikiMacroParameterClass[1]
Parameter description
... ... @@ -1,1 +1,5 @@
1 +
2 +
1 1  The source URL of the incident (link)
4 +
5 +