mentorenwahl/backend/templates/html/users.html.ecr

215 lines
5.6 KiB
Plaintext

<!DOCTYPE html>
<html lang="de-DE">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Benutzerexport</title>
<link rel="preconnect" href="https://fonts.bunny.net">
<link href="https://fonts.bunny.net/css?family=jetbrains-mono:400" rel="stylesheet" />
<style>
html,
body {
font-family: "JetBrains Mono", monospace;
}
.column {
width: 25%;
}
.border {
border: 1px solid;
}
.padded {
padding: 1%;
}
.left,
.right {
float: left;
}
hr {
border-top: 1px solid;
}
code {
font-family: "JetBrains Mono", monospace;
background: #f4f4f4;
word-wrap: break-word;
box-decoration-break: clone;
padding: 0.1rem 0.3rem 0.2rem;
border-radius: 0.2rem;
}
ul {
margin: 0;
padding: 0;
}
ul.dashed {
list-style-type: none;
}
ul.dashed > li {
text-indent: -5px;
}
ul.dashed > li:before {
content: "-";
text-indent: -5px;
}
hr {
border: none;
height: 1px;
background: black;
}
.link {
font-style: italic;
font-size: small;
font-weight: lighter;
}
</style>
</head>
<body>
<div>
<h1>Mentorenwahl: Benutzerexport</h1>
<table width="100%" cellspacing="0" border="0">
<colgroup>
<col width="25%" />
<col width="75%" />
</colgroup>
<tr>
<th class="border">Zeitpunkt</th>
<%- time_unix = @time.to_unix -%>
<td class="border padded"><%= @time %> (<%= time_unix.negative? ? "-" : "+" %><%= time_unix %>)</td>
</tr>
<tr>
<th class="border">Anzahl Schüler</th>
<td class="border padded"><%= @students.size %></th>
</tr>
<tr>
<th class="border">Klassen</th>
<td class="border padded">
<ul class="dashed">
<%- @classes.each do |cl| -%>
<li><%= cl[0] %> (<%= cl[1] %>)</li>
<%- end -%>
</ul>
</td>
</tr>
<tr>
<th class="border">Anzahl Lehrer</th>
<td class="border padded"><%= @teachers.size %></td>
</tr>
</table>
</div>
<div>
<h2>Schüler:</h2>
<table width="100%" cellspacing="0" border="0">
<colgroup>
<col class="column" />
<col class="column" />
<col class="column" />
<col class="column" />
</colgroup>
<%- @students.in_groups_of(4).each do |group| -%>
<tr>
<%- group.each do |student| %>
<%- if student -%>
<td class="border padded">
<span class="link">mentorenwahl.dergrimm.net</span>
<table width="100%">
<tr>
<td>
<%= student.user.last_name %>, <%= student.user.first_name %> (<%= student.class_name %>)
<hr />
</td>
</tr>
<tr>
<td>
<code><%= student.user.username %></code>
<hr />
</td>
</tr>
<tr>
<td>
<%- if student.user.password -%>
<code><%= student.user.password %></code>
<%- else -%>
<i>Password geändert</i>
<%- end -%>
</td>
</tr>
</table>
</td>
<%- else -%>
<td class="border-padded" />
<%- end -%>
<%- end -%>
</tr>
<%- end -%>
</table>
<footer></footer>
</div>
<div>
<h2>Lehrer:</h2>
<table width="100%" cellspacing="0" border="0">
<colgroup>
<col class="column" />
<col class="column" />
<col class="column" />
<col class="column" />
</colgroup>
<%- @teachers.in_groups_of(4).each do |group| -%>
<tr>
<%- group.each do |teacher| %>
<%- if teacher -%>
<td class="border padded">
<span class="link">mentorenwahl.dergrimm.net</span>
<table width="100%">
<tr>
<td>
<%= (teacher.first_name ? "#{teacher.last_name}, #{teacher.first_name}" : teacher.last_name).rstrip.rchop(',') %>
<hr />
</td>
</tr>
<tr>
<td>
<code><%= teacher.username %></code>
<hr />
</td>
</tr>
<tr>
<td>
<%- if teacher.password -%>
<code><%= teacher.password %></code>
<%- else -%>
<i>Password geändert</i>
<%- end -%>
</td>
</tr>
</table>
</td>
<%- end -%>
<%- end -%>
</tr>
<%- end -%>
</table>
</div>
</body>
</html>