-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbootstrap-progress-bar.vtl
69 lines (59 loc) · 2.45 KB
/
bootstrap-progress-bar.vtl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#** ===========================================================================
BOOTSTRAP PROGRESS BAR
This Confluence user macro adds a Bootstrap like progress bar to your page.
Requires the bootstrap-progress-bar-styles macro once on that page.
Version: 1.1.0
Updated: 2022-01-08
Author/s: George Lewe
Source: https://github.com/glewe/confluence-user-macros
License: GNU LGPLv3
Macro Body Processing: No macro body
*#
#** ---------------------------------------------------------------------------
PARAMETER
*#
## @param Progress:title=Progress|type=string|required=true|desc=Type in the percentage of the progress here as a number between 1 and 100.|default=50
## @param Color:title=Color|type=enum|enumValues=Blue,Cyan,Green,Orange,Red|desc=Select the progress bar color here.|default=Blue
## @param Style:title=Style|type=enum|enumValues=Plain,Striped,Animated|desc=Select the progress bar style here.|default=Plain
## @param Width:title=Width|type=string|desc=Enter the width in pixel here or use 'Auto' for auto width.|default=Auto
## @param Height:title=Height|type=string|desc=Enter the height in pixel here or use 'Auto' for auto height.|default=Auto
#** ---------------------------------------------------------------------------
PROCESS INPUT
*#
#if (!$paramProgress)
#set ($paramProgress="50")
#end
#set ($paramBarColor="")
#if ($paramColor=="Cyan")
#set ($paramBarColor=" bsprogress-bar-info")
#elseif ($paramColor=="Green")
#set ($paramBarColor=" bsprogress-bar-success")
#elseif ($paramColor=="Orange")
#set ($paramBarColor=" bsprogress-bar-warning")
#elseif ($paramColor=="Red")
#set ($paramBarColor=" bsprogress-bar-danger")
#end
#set ($paramBarStyle="")
#if ($paramStyle=="Striped")
#set ($paramBarStyle=" bsprogress-striped")
#elseif ($paramStyle=="Animated")
#set ($paramBarStyle=" bsprogress-striped active")
#end
#if ($paramWidth=="Auto")
#set ($paramBarWidth="")
#else
#set ($paramBarWidth="width:"+$paramWidth+"px;")
#end
#if ($paramHeight=="Auto")
#set ($paramBarHeight="")
#else
#set ($paramBarHeight="height:"+$paramHeight+"px;")
#end
#** ---------------------------------------------------------------------------
* OUTPUT
*#
<!-- User Macro: Bootstrap Progress Bar START -->
<div class="bsprogress$paramBarStyle" style="margin-bottom: 9px; $paramBarWidth $paramBarHeight">
<div class="bsprogress-bar$paramBarColor" style="width: $paramProgress%"></div>
</div>
<!-- User Macro: Bootstrap Progress Bar END -->