Commit 7f4d43fb authored by Robert Czechowski's avatar Robert Czechowski
Browse files

Show group results to contest with members names und links to groups and members

parent 95f039b7
Pipeline #249 failed with stages
in 4 minutes and 27 seconds
......@@ -286,13 +286,13 @@ pub fn show_contest_results<T: MedalConnection>(conn: &T, contest_id: i32, sessi
let session = conn.get_session(&session_token).ensure_logged_in().ok_or(MedalError::NotLoggedIn)?;
let (tasknames, resultdata) = conn.get_contest_groups_grades(, contest_id);
let mut results: Vec<(String, Vec<(String, Vec<String>)>)> = Vec::new();
let mut results: Vec<(String, i32, Vec<(String, i32, Vec<String>)>)> = Vec::new();
for (group, groupdata) in resultdata {
let mut groupresults: Vec<(String, Vec<String>)> = Vec::new();
let mut groupresults: Vec<(String, i32, Vec<String>)> = Vec::new();
//TODO: use user
for (_user, userdata) in groupdata {
for (user, userdata) in groupdata {
let mut userresults: Vec<String> = Vec::new();
......@@ -309,10 +309,10 @@ pub fn show_contest_results<T: MedalConnection>(conn: &T, contest_id: i32, sessi
userresults[0] = format!("{}", summe);
groupresults.push((format!("Name"), userresults))
groupresults.push((format!("{} {}", user.firstname.unwrap_or_default(), user.lastname.unwrap_or("–".to_string())),, userresults))
results.push((format!("{}",, groupresults));
results.push((format!("{}",,, groupresults));
let mut data = json_val::Map::new();
......@@ -24,11 +24,11 @@
{{#each result}}
{{#each this.1}}
<tr><td><a href="/group/{{this.1}}">{{this.0}}</a></td></tr>
{{#each this.2}}
{{#each this.1}}
<td><a href="/user/{{this.1}}">{{this.0}}</a></td>
{{#each this.2}}
......@@ -17,7 +17,7 @@
<p>Sie können auch Gruppen über einen <a href="csv">CSV-Upload</a> anlegen.
<h2>Meine bestehenden Gruppen</h2>
<p><a href="/contest/">Wettbewerbsergebnisse meiner Gruppen</a></p>
<p>Für die Wettbewerbsergebnisse meiner Gruppen bitte zunächst <a href="/contest/">einen Wettbewerb auswählen</a></p>
{{#if group}}
......@@ -61,7 +61,17 @@
<div class="columns alogin">
<div class="column is-8 is-offset-2">
<div class="notification is-info">
<h3 class="title is-5">Gruppenergebnisse</h3>
<a href="/contest/{{ }}/result/">Ergebnisse meiner Gruppen für diesen Wettbewerb einsehen</a>
<div class="columns" id="bare_content">
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment