0 Votes

Changes for page SubmitIncidentMacro

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

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

Summary

Details

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

XWiki AI Chat