-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin.html
More file actions
145 lines (113 loc) · 3.53 KB
/
Copy pathadmin.html
File metadata and controls
145 lines (113 loc) · 3.53 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<!DOCTYPE html>
<html>
<head>
<title>Admin Panel</title>
<link rel="stylesheet" href="/static/style.css">
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
</head>
<body>
<div class="sidebar">
<h2>🚀 Admin</h2>
<a href="/home">🏠 Home</a>
<a href="/admin" class="active">📊 Dashboard</a>
<a href="/logout">🚪 Logout</a>
</div>
<div class="main">
<h2>📊 Admin Dashboard</h2>
<p class="subtitle">System Overview</p>
<!-- STATS -->
<div class="kpi-grid">
<div class="kpi-card">
<h3>Total Users</h3>
<p>{{users|length}}</p>
</div>
<div class="kpi-card">
<h3>Total Reports</h3>
<p>{{reports|length}}</p>
</div>
<div class="kpi-card">
<h3>Avg Score</h3>
<p>
{{
(reports | map(attribute=2) | sum / (reports|length if reports|length > 0 else 1)) | round(1)
}}%
</p>
</div>
</div>
<!-- 🔍 SEARCH -->
<div class="card">
<input type="text" id="searchInput" placeholder="🔍 Search users...">
</div>
<!-- 👥 USERS TABLE -->
<div class="card table-card">
<h3>👥 Users</h3>
<table id="userTable">
<tr>
<th>ID</th>
<th>Name</th>
<th>Email</th>
<th>Action</th>
</tr>
{% for user in users %}
<tr>
<td>{{user[0]}}</td>
<td class="username">{{user[1]}}</td>
<td>{{user[2]}}</td>
<td>
<a href="/delete_user/{{user[0]}}" class="btn outline">Delete</a>
</td>
</tr>
{% endfor %}
</table>
</div>
<!-- 🚀 NEW INTERACTIVE REPORT CARDS -->
<div class="card">
<h3>📄 ATS Reports</h3>
<div class="report-grid">
{% for r in reports %}
<div class="report-card">
<h3>👤 {{r[1]}}</h3>
<p>Uploaded by: <b>{{r[0]}}</b></p>
<p>💼 Role: {{r[3]}}</p>
<p>📊 ATS Score: <b>{{r[2]}}%</b></p>
<div class="progress">
<div class="bar" style="width: {{r[2]}}%"></div>
</div>
<p>🎯 JD Match: {{r[4]}}%</p>
<details>
<summary>🔍 View Skills</summary>
<p>✅ Matched: {{r[5]}}</p>
<p>❌ Missing: {{r[6]}}</p>
</details>
</div>
{% endfor %}
</div>
</div>
</div>
<!-- JS -->
<script>
// 🔍 SEARCH
document.getElementById("searchInput").addEventListener("keyup", function() {
let filter = this.value.toLowerCase();
let rows = document.querySelectorAll("#userTable tr");
rows.forEach(row => {
let name = row.querySelector(".username");
if (name) {
row.style.display = name.innerText.toLowerCase().includes(filter) ? "" : "none";
}
});
});
// 📊 CHART (UPDATED INDEX)
new Chart(document.getElementById("adminChart"), {
type: "bar",
data: {
labels: [{% for r in reports %}"{{r[1]}}",{% endfor %}],
datasets: [{
label: "ATS Scores",
data: [{% for r in reports %}{{r[2]}},{% endfor %}]
}]
}
});
</script>
</body>
</html>