Added better formatting and links for team listings in course entity page.

This commit is contained in:
Andrew Lalis 2019-04-16 23:39:04 +02:00 committed by andrewlalis
parent 7322436ab1
commit f5dc04a720
3 changed files with 30 additions and 4 deletions

View File

@ -74,6 +74,10 @@ public abstract class Person extends BasicEntity {
return this.lastName; return this.lastName;
} }
public String getFullName() {
return this.getFirstName() + ' ' + this.getLastName();
}
public String getEmailAddress() { public String getEmailAddress() {
return this.emailAddress; return this.emailAddress;
} }

View File

@ -75,6 +75,10 @@ public abstract class Team<P extends Person> extends BasicEntity {
this.course = course; this.course = course;
} }
/**
* Gets a list of all members of this team.
* @return A list of all the members in this team.
*/
public List<P> getMembers() { public List<P> getMembers() {
return this.members; return this.members;
} }

View File

@ -10,18 +10,36 @@
<h1><span th:text="${course.getName()}"></span> (Code: <span th:text="${course.getCode()}"></span>)</h1> <h1><span th:text="${course.getName()}"></span> (Code: <span th:text="${course.getCode()}"></span>)</h1>
<h2>Created on: <span th:text="${course.getCreatedOn()}"></span></h2> <h2>Created on: <span th:text="${course.getCreatedOn()}"></span></h2>
<hr> <hr>
<h3>Teaching Assistant Groups (<span th:text="${course.getTeachingAssistantTeams().size()}"></span>):</h3> <h3>Teaching Assistant Groups (<span th:text="${course.getTeachingAssistantTeams().size()}"></span>):</h3>
<table> <table>
<tr th:each="teachingAssistantTeam: ${course.getTeachingAssistantTeams()}"> <tr th:each="teachingAssistantTeam: ${course.getTeachingAssistantTeams()}">
<td th:text="${teachingAssistantTeam.getId()}"></td> <td>
<td th:text="${teachingAssistantTeam.toString()}"></td> <a
th:href="@{/courses/{code}/ta_teams/{team_id}
(code=${course.getCode()}, team_id=${teachingAssistantTeam.getId()})}">
TA Team <span th:text="${teachingAssistantTeam.getId()}"></span>
</a>
</td>
<td th:each="teachingAssistant: ${teachingAssistantTeam.getMembers()}">
<span th:text="${teachingAssistant.getFullName()}"></span>
</td>
</tr> </tr>
</table> </table>
<h3>Student Groups (<span th:text="${course.getStudentTeams().size()}"></span>):</h3> <h3>Student Groups (<span th:text="${course.getStudentTeams().size()}"></span>):</h3>
<table> <table>
<tr th:each="studentTeam: ${course.getStudentTeams()}"> <tr th:each="studentTeam: ${course.getStudentTeams()}">
<td th:text="${studentTeam.getId()}"></td> <td>
<td th:text="${studentTeam.toString()}"></td> <a
th:href="@{/courses/{code}/student_teams/{team_id}
(code=${course.getCode()}, team_id=${studentTeam.getId()})}">
Student Team <span th:text="${studentTeam.getId()}"></span>
</a>
</td>
<td th:each="student: ${studentTeam.getMembers()}">
<span th:text="${student.getFullName()}"></span>
</td>
</tr> </tr>
</table> </table>
</div> </div>