diff options
-rw-r--r-- | admin/index.js | 2 | ||||
-rw-r--r-- | admin/public/prediction.js | 6 | ||||
-rw-r--r-- | admin/public/style.css | 9 |
3 files changed, 13 insertions, 4 deletions
diff --git a/admin/index.js b/admin/index.js index 37e5914..49bdee8 100644 --- a/admin/index.js +++ b/admin/index.js @@ -76,7 +76,7 @@ app.get("/api/participation", checkAdmin, async (req, res) => { app.get("/api/prediction", checkAdmin, async (req, res) => { const prediction = await db.query( - "SELECT u.name uname, u.middlename umid, u.surname usur, t.id tid, t.name tname, t.surname tsur, c.name class FROM users u INNER JOIN teacher_prediction p ON u.id = p.user_id INNER JOIN users t ON t.id = p.teacher_id INNER JOIN class c ON c.id = u.class_id", + "SELECT u.name uname, u.middlename umid, u.surname usur, t.id tid, t.name tname, t.surname tsur, c.name class FROM users u INNER JOIN teacher_prediction p ON u.id = p.user_id INNER JOIN users t ON t.id = p.teacher_id INNER JOIN class c ON c.id = u.class_id ORDER BY t.surname, t.name", ); res.json(prediction); }); diff --git a/admin/public/prediction.js b/admin/public/prediction.js index 914f910..e2e1855 100644 --- a/admin/public/prediction.js +++ b/admin/public/prediction.js @@ -12,8 +12,10 @@ fetch("api/prediction") const div = document.createElement("div"); div.dataset.teacher = `${d.tid}`; const h3 = document.createElement("h3"); - const email = `${san(d.tname)}.${san(d.tsur)}@rbs-ulm.de`; - h3.textContent = `${d.tname} ${d.tsur}: ${email}`; + const a = document.createElement("a"); + a.href = `mailto:${san(d.tname)}.${san(d.tsur)}@rbs-ulm.de`; + a.textContent = `${d.tname} ${d.tsur}`; + h3.append(a); const ul = document.createElement("ul"); addLI(d, ul); div.append(h3, ul); diff --git a/admin/public/style.css b/admin/public/style.css index f1bbc9e..f889abb 100644 --- a/admin/public/style.css +++ b/admin/public/style.css @@ -28,8 +28,15 @@ div { background: white; } -#list span { +#list h3 a { cursor: pointer; + text-decoration: none; + color: #4c4c4c; + font-style: italic; +} + +#list h3 a:hover { + opacity: 0.7; } @media only screen and (max-width: 700px) { |