icon.ftl
1 <#-- Macro: icon
2 Description: Generates an icon element with customizable attributes.
3 Parameters:
4 - prefix (string, optional): the prefix of the icon library.
5 - style (string, optional): the style of the icon.
6 - class (string, optional): additional CSS classes to add to the icon.
7 - title (string, optional): the title attribute of the icon.
8 - id (string, optional): the ID attribute of the icon.
9 - params (string, optional): additional parameters to add to the icon.
10 -->
11 <#macro icon prefix='ti ti-' style='' class='' title='' id='' params='' deprecated...>
12 <@deprecatedWarning args=deprecated />
13 <#-- Compat from Font Awesome to Tabler Icons -->
14 <#local cssStyle = ' ' + style?keep_after(' ') />
15 <#local tiStyle = style?keep_before(' ') />
16 <#switch tiStyle>
17 <#case 'cog'>
18 <#local iconStyle = 'settings' />
19 <#break>
20 <#case 'wrench'>
21 <#local iconStyle = 'tool' />
22 <#break>
23 <#case 'remove'>
24 <#case 'times'>
25 <#local iconStyle = 'x' />
26 <#break>
27 <#case 'puzzle-piece'>
28 <#local iconStyle = 'puzzle' />
29 <#break>
30 <#case 'desktop'>
31 <#local iconStyle = 'device-desktop' />
32 <#break>
33 <#case 'tablet'>
34 <#local iconStyle = 'device-tablet' />
35 <#break>
36 <#case 'mobile'>
37 <#local iconStyle = 'device-mobile' />
38 <#break>
39 <#case 'shield-alt'>
40 <#local iconStyle = 'shield' />
41 <#break>
42 <#case 'eye-slash'>
43 <#local iconStyle = 'eye-off' />
44 <#break>
45 <#case 'envelope'>
46 <#local iconStyle = 'mail' />
47 <#break>
48 <#case 'id-card'>
49 <#local iconStyle = 'id' />
50 <#break>
51 <#case 'user-secret'>
52 <#local iconStyle = 'user-question' />
53 <#break>
54 <#case 'id-card'>
55 <#local iconStyle = 'id' />
56 <#break>
57 <#case 'list-alt'>
58 <#local iconStyle = 'list' />
59 <#break>
60 <#case 'arrows-alt'>
61 <#local iconStyle = 'arrows-maximize' />
62 <#break>
63 <#case 'sync'>
64 <#case 'redo'>
65 <#local iconStyle = 'refresh' />
66 <#break>
67 <#case 'play'>
68 <#local iconStyle = 'player-play-filled' />
69 <#break>
70 <#case 'stop'>
71 <#local iconStyle = 'player-stop-filled' />
72 <#break>
73 <#case 'sort'>
74 <#case 'arrows'>
75 <#local iconStyle = 'arrows-sort' />
76 <#break>
77 <#case 'step-forward'>
78 <#local iconStyle = 'switch-horizontal' />
79 <#break>
80 <#case 'file-pdf-o'>
81 <#local iconStyle = 'pdf' />
82 <#break>
83 <#case 'file-alt'>
84 <#local iconStyle = 'forms' />
85 <#break>
86 <#case 'sticky-note'>
87 <#local iconStyle = 'align-box-left-top' />
88 <#break>
89 <#case 'check-square'>
90 <#local iconStyle = 'square-check' />
91 <#break>
92 <#case 'dot-circle'>
93 <#local iconStyle = 'circle-dot' />
94 <#break>
95 <#case 'hashtag'>
96 <#local iconStyle = 'hash' />
97 <#break>
98 <#case 'image'>
99 <#local iconStyle = 'photo' />
100 <#break>
101 <#case 'comment'>
102 <#local iconStyle = 'message' />
103 <#break>
104 <#case 'futbol'>
105 <#local iconStyle = 'gavel' />
106 <#break>
107 <#case 'map-marked-alt'>
108 <#local iconStyle = 'map-pin' />
109 <#break>
110 <#case 'phone-square'>
111 <#local iconStyle = 'phone' />
112 <#break>
113 <#case 'list-ol'>
114 <#local iconStyle = 'list-numbers' />
115 <#break>
116 <#case 'th-list'>
117 <#local iconStyle = 'list-details' />
118 <#break>
119 <#case 'question'>
120 <#local iconStyle = 'question-mark' />
121 <#break>
122 <#case 'vote-yea'>
123 <#local iconStyle = 'thumb-up' />
124 <#break>
125 <#case 'comments'>
126 <#local iconStyle = 'messages' />
127 <#break>
128 <#case 'plus-circle'>
129 <#local iconStyle = 'circle-plus' />
130 <#break>
131 <#default>
132 <#local iconStyle = style />
133 </#switch>
134 <#if cssStyle?trim !=''><#local iconStyle = iconStyle + cssStyle /></#if>
135 <i class="${prefix}${iconStyle}<#if class!=''> ${class}</#if>" aria-hidden="true"<#if title!=''> title='${title}'</#if><#if id!=''> id="${id}"</#if><#if params!=''> ${params}</#if>></i>
136 </#macro>