-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrenderPermissionError.js
More file actions
78 lines (78 loc) · 2.35 KB
/
renderPermissionError.js
File metadata and controls
78 lines (78 loc) · 2.35 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
/**
* Utility function to render a permission error message.
* Used by interfaces when a user lacks the required permissions.
* @param {HTMLElement} shadowRoot - The shadow root to render the error in
* @param {string} projectInQuery - The project ID from the query string
*/
export function renderPermissionError(shadowRoot, projectInQuery = '') {
shadowRoot.innerHTML = `
<style>
.error-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
padding: 2rem;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
background-color: #f8f9fa;
}
.error-content {
max-width: 600px;
text-align: center;
background: white;
padding: 3rem;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.error-title {
color: #d63031;
font-size: 2rem;
margin-bottom: 1rem;
}
.error-message {
color: #2d3436;
font-size: 1.1rem;
line-height: 1.6;
margin-bottom: 1.5rem;
}
.error-link {
background-color: #00b894;
color: white;
padding: 0.75rem 1.5rem;
text-decoration: none;
border-radius: 5px;
display: inline-block;
margin: 0.5rem;
font-weight: bold;
transition: background-color 0.3s;
}
.error-link:hover {
background-color: #00a383;
}
.error-link.secondary {
background-color: #0984e3;
}
.error-link.secondary:hover {
background-color: #0770c7;
}
</style>
<div class="error-container">
<div class="error-content">
<h1 class="error-title">Permission Denied</h1>
<p class="error-message">
You do not have the appropriate permissions to view this transcription interface.
</p>
<div>
<a href="/project?projectID=${projectInQuery}" class="error-link">
Back to Project
</a>
<a href="/" class="error-link secondary">
Go to Home
</a>
</div>
<img src="/assets/logo/logo-350w.png" alt="Permission Denied Illustration" style="margin-top: 1.5rem; max-width: 100%; height: auto;" />
</div>
</div>
`
}