Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Matúš Valko
Online Gaming Management System
Commits
db13bd61
Commit
db13bd61
authored
May 20, 2022
by
Matúš Valko
Browse files
updated
parent
b7bd53ff
Pipeline
#141721
passed with stage
in 1 minute and 33 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
gaming-spring-mvc/src/main/java/cz/muni/fi/pa165/mvc/controllers/TeamController.java
View file @
db13bd61
...
@@ -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
();
}
}
}
gaming-spring-mvc/src/main/webapp/WEB-INF/jsp/team/view.jsp
View file @
db13bd61
...
@@ -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>
<t
d><c:out
value=
"
${
team
.
id
}
"
/>
</t
d
>
<t
h>
id
</t
h
>
<t
d><c:out
value=
"
${
team
.
name
}
"
/>
</t
d
>
<t
h>
name
</t
h
>
<t
d><c:out
value=
"
${
player
.
country
}
"
/>
</t
d
>
<t
h>
country
</t
h
>
</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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment