-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathAlertComponent.html
More file actions
97 lines (89 loc) · 3.34 KB
/
AlertComponent.html
File metadata and controls
97 lines (89 loc) · 3.34 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!--
AlertComponent template demonstrating complex fragment-based rendering.
Each alert type has:
- Different CSS classes
- Different icons
- Different content structures (some have expandable details)
-->
<div view:context-root xmlns:view="https://github.com/tschuehly/spring-view-component">
<!-- Info Alert Fragment -->
<div view:context="InfoAlert" class="alert alert-info" role="alert">
<div class="alert-header">
<svg class="alert-icon" aria-hidden="true">
<use href="#icon-info"></use>
</svg>
<span class="alert-message" th:text="${infoAlert.message}">
Information message
</span>
</div>
</div>
<!-- Warning Alert Fragment -->
<div view:context="WarningAlert" class="alert alert-warning" role="alert">
<div class="alert-header">
<svg class="alert-icon" aria-hidden="true">
<use href="#icon-warning"></use>
</svg>
<span class="alert-message" th:text="${warningAlert.message}">
Warning message
</span>
</div>
<details class="alert-details">
<summary>Show Details</summary>
<pre class="alert-details-content" th:text="${warningAlert.details}">
Warning details
</pre>
</details>
</div>
<!-- Error Alert Fragment -->
<div view:context="ErrorAlert" class="alert alert-error" role="alert">
<div class="alert-header">
<svg class="alert-icon" aria-hidden="true">
<use href="#icon-error"></use>
</svg>
<span class="alert-message" th:text="${errorAlert.message}">
Error message
</span>
</div>
<details class="alert-details">
<summary>Show Stack Trace</summary>
<pre class="alert-details-content alert-stacktrace" th:text="${errorAlert.stackTrace}">
Stack trace
</pre>
</details>
</div>
<!-- Success Alert Fragment -->
<div view:context="SuccessAlert" class="alert alert-success" role="alert">
<div class="alert-header">
<svg class="alert-icon" aria-hidden="true">
<use href="#icon-success"></use>
</svg>
<span class="alert-message" th:text="${successAlert.message}">
Success message
</span>
</div>
</div>
</div>
<!--
SVG Icons (normally in a separate file)
-->
<svg style="display: none;">
<symbol id="icon-info" viewBox="0 0 24 24">
<circle cx="12" cy="12" r="10"/>
<line x1="12" y1="16" x2="12" y2="12"/>
<line x1="12" y1="8" x2="12.01" y2="8"/>
</symbol>
<symbol id="icon-warning" viewBox="0 0 24 24">
<path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"/>
<line x1="12" y1="9" x2="12" y2="13"/>
<line x1="12" y1="17" x2="12.01" y2="17"/>
</symbol>
<symbol id="icon-error" viewBox="0 0 24 24">
<circle cx="12" cy="12" r="10"/>
<line x1="15" y1="9" x2="9" y2="15"/>
<line x1="9" y1="9" x2="15" y2="15"/>
</symbol>
<symbol id="icon-success" viewBox="0 0 24 24">
<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/>
<polyline points="22 4 12 14.01 9 11.01"/>
</symbol>
</svg>