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 {
redirectAttributes.addFlashAttribute("alert_success", "Team " + id + " was created");
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 @@
<my:pagetemplate title="Team Administration">
<jsp:attribute name="body">
<table class="table">
<thead>
<tr>
<th>id</th>
<th>name</th>
<th>country</th>
</tr>
</thead>
<tbody>
<td><c:out value="${team.name}"/></td>
<table class="tablePlayers">
<thead>
<tr>
<td><c:out value="${team.id}"/></td>
<td><c:out value="${team.name}"/></td>
<td><c:out value="${player.country}"/></td>
<th>id</th>
<th>name</th>
<th>country</th>
</tr>
</tbody>
</table>
</thead>
<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>
</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