engage_earn_api/templates/report.html
Mitchell Marino ad4377b52c small tweaks
2023-04-16 16:08:47 -05:00

109 lines
2.6 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>Student Point Report</title>
<style>
/* color theme */
:root {
--primary-color: #9aedf4;
--secondary-color: #f2f2f2;
--text-color: #333;
}
/* zebra striping */
tr:nth-child(even) {
background-color: var(--secondary-color);
}
/* table styling */
table {
font-family: Arial, sans-serif;
color: var(--text-color);
width: 100%;
}
.styled-table{
border-collapse: collapse;
width: 100%;
margin: 20px 0;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.inner-table{
margin: 0;
padding: 0;
}
th, td {
text-align: left;
padding: 12px;
border: 1px solid #ddd;
}
th {
background-color: var(--primary-color);
color: white;
font-weight: bold;
}
/* header styling */
header {
background-color: var(--primary-color);
color: white;
padding: 30px 20px;
display: flex;
justify-content: space-between;
align-items: center;
font-family: Arial, sans-serif;
}
h1 {
margin: 0;
font-size: 32px;
font-weight: normal;
}
</style>
</head>
<body>
<header>
<h1>Student Point Report</h1>
<p style="margin: 0;">{{ date }}</p>
</header>
<table class="styled-table">
<thead>
<tr>
<th>Name</th>
<th>Grade</th>
<th>Points</th>
{% if detailed_event_view %}
<th>Events</th>
{% endif %}
</tr>
</thead>
<tbody>
{% for user in users %}
<tr>
<td>{{ user.username }}</td>
<td>{{ user.grade }}</td>
<td>{{ user.points }}</td>
{% if detailed_event_view %}
<td>
<table class="inner-table">
<thead>
<tr>
<th>Points</td>
<th>Type</td>
<th>Title</td>
</tr>
</thead>
<tbody>
{% for i in range(end=user.event_titles|length) %}
<tr>
<td>{{user.event_points[i]}}</td>
<td>{{user.event_types[i]}}</td>
<td>{{user.event_titles[i]}}</td>
</tr>
{% endfor %}
</tbody>
</table>
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
</body>
</html>