Commit db13bd61 authored by Matúš Valko's avatar Matúš Valko
Browse files

updated

parent b7bd53ff
Pipeline #141721 passed with stage
in 1 minute and 33 seconds
...@@ -66,4 +66,16 @@ public class TeamController { ...@@ -66,4 +66,16 @@ public class TeamController {
redirectAttributes.addFlashAttribute("alert_success", "Team " + id + " was created"); redirectAttributes.addFlashAttribute("alert_success", "Team " + id + " was created");
return "redirect:" + uriBuilder.path("/team/view/{id}").buildAndExpand(id).encode().toUriString(); return "redirect:" + uriBuilder.path("/team/view/{id}").buildAndExpand(id).encode().toUriString();
} }
@RequestMapping(value = "/delete/{uuid}", method = RequestMethod.POST)
public String delete(@PathVariable String uuid, UriComponentsBuilder uriBuilder, RedirectAttributes redirectAttributes) {
TeamDTO player = teamFacade.getTeamById(uuid);
try {
teamFacade.delete(uuid);
redirectAttributes.addFlashAttribute("alert_success", "Team \"" + player.getId() + "\" was deleted.");
} catch (Exception ex) {
redirectAttributes.addFlashAttribute("alert_danger", "Team \"" + player.getId() + "\" cannot be deleted.");
}
return "redirect:" + uriBuilder.path("/team/list").toUriString();
}
} }
...@@ -8,22 +8,24 @@ ...@@ -8,22 +8,24 @@
<my:pagetemplate title="Team Administration"> <my:pagetemplate title="Team Administration">
<jsp:attribute name="body"> <jsp:attribute name="body">
<table class="table"> <td><c:out value="${team.name}"/></td>
<thead>
<tr> <table class="tablePlayers">
<th>id</th> <thead>
<th>name</th>
<th>country</th>
</tr>
</thead>
<tbody>
<tr> <tr>
<td><c:out value="${team.id}"/></td> <th>id</th>
<td><c:out value="${team.name}"/></td> <th>name</th>
<td><c:out value="${player.country}"/></td> <th>country</th>
</tr> </tr>
</tbody> </thead>
</table> <tbody>
<tr>
<td><c:out value="${team.id}"/></td>
<td><c:out value="${team.name}"/></td>
<td><c:out value="${player.country}"/></td>
</tr>
</tbody>
</table>
</jsp:attribute> </jsp:attribute>
</my:pagetemplate> </my:pagetemplate>
\ No newline at end of file
Supports Markdown
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