Changes for page Status

Last modified by Scott Gagan on 2025/08/19 20:33

From version 8.1
edited by Scott Gagan
on 2025/08/19 20:33
Change comment: Install extension [com.xwiki.pro:xwiki-pro-macros-ui/1.27.3]
To version 1.1
edited by superadmin
on 2021/09/09 17:04
Change comment: Install extension [com.xwiki.pro:xwiki-pro-macros/1.1.1]

Summary

Details

Page properties
Parent
... ... @@ -1,1 +1,1 @@
1 -WebHome
1 +xwiki:XWiki.Macros.WebHome
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.scottg
1 +XWiki.superadmin
Content
... ... @@ -3,10 +3,10 @@
3 3  
4 4  == Parameters ==
5 5  
6 -|=Parameter|=Name|=Description|=Default
7 -|colour|$services.localization.render('rendering.macro.status.parameter.colour.name')|$services.localization.render('rendering.macro.status.parameter.colour.description')|Grey
8 -|title|$services.localization.render('rendering.macro.status.parameter.title.name')|$services.localization.render('rendering.macro.status.parameter.title.description')|Colour value(e.g.:Grey)
9 -|subtle|$services.localization.render('rendering.macro.status.parameter.subtle.name')|$services.localization.render('rendering.macro.status.parameter.subtle.description')|false
6 +|=Name|=Description|=Default
7 +|colour|$services.localization.render('rendering.macro.status.parameter.colour.description')|Grey
8 +|title|$services.localization.render('rendering.macro.status.parameter.title.description')|Colour value(e.g.:Grey)
9 +|subtle|$services.localization.render('rendering.macro.status.parameter.subtle.description')|false
10 10  
11 11  == Examples ==
12 12  
XWiki.WikiMacroClass[0]
Macro code
... ... @@ -1,30 +1,20 @@
1 1  {{velocity}}
2 -#macro (executeMacro)
3 - #set ($discard = $xwiki.ssx.use('XWiki.Macros.Status'))
4 - #set ($color = $escapetool.xml($xcontext.macro.params.colour))
5 - #if (!$color)
6 - #set ($color = 'Grey')
7 - #end
8 - #set ($title = $escapetool.xml($xcontext.macro.params.title))
9 - #if (!$title)
10 - #set ($title = $color)
11 - #end
12 - #set ($statusCssClass = "${color.toLowerCase()}Status statusBox")
13 - #set ($subtle = $xcontext.macro.params.subtle)
14 - #set ($subtleCssClass = 'subtle')
15 - #if ($subtle == 'true')
16 - #set ($statusCssClass = "$statusCssClass subtle")
17 - #end
18 - {{html}}
19 - <span class="$statusCssClass" title="$title">$title</span>
20 - {{/html}}
2 +#set ($discard = $xwiki.ssx.use('XWiki.Macros.Status'))
3 +#set ($color = $xcontext.macro.params.colour)
4 +#if (!$color)
5 + #set ($color = 'Grey')
21 21  #end
22 -## We need to check if there is a valid license because the macro is registered even if the user doesn't have view right
23 -## on the macro definition page. See XWIKI-14828: Rendering macros defined in wiki pages are available to users that
24 -## don't have view right on those pages.
25 -#if ($services.promacrolicensing.hasLicensureForEntity($xcontext.macro.doc.documentReference))
26 - #executeMacro
27 -#else
28 - {{missingLicenseMessage extensionName="proMacros.extension.name"/}}
7 +#set ($title = $xcontext.macro.params.title)
8 +#if (!$title)
9 + #set ($title = $color)
29 29  #end
11 +#set ($statusCssClass = "${color.toLowerCase()}Status statusBox")
12 +#set ($subtle = $xcontext.macro.params.subtle)
13 +#set ($subtleCssClass = 'subtle')
14 +#if ($subtle == 'true')
15 + #set ($statusCssClass = "$statusCssClass subtle")
16 +#end
17 +{{html}}
18 + <span class="$statusCssClass" title="$title">$title</span>
19 +{{/html}}
30 30  {{/velocity}}
Macro description
... ... @@ -1,0 +1,1 @@
1 +Insert a colored label in the text to highlight the status of an item.
XWiki.WikiMacroParameterClass[0]
Parameter description
... ... @@ -1,0 +1,1 @@
1 +The text of the status. If not specified, the color name will be displayed (e.g.:"Grey").
XWiki.WikiMacroParameterClass[1]
Parameter description
... ... @@ -1,0 +1,1 @@
1 +The color of the status(text color and background color). The following colors are available: "Blue", "Green", "Grey", "Purple", "Red" and "Yellow". Default: "Grey".
XWiki.WikiMacroParameterClass[2]
Parameter description
... ... @@ -1,0 +1,1 @@
1 +The aspect of the status: either white text on dark color background or dark color text on light color background. This is a boolean parameter so it should be filled with "true" or "false". Default: "false".