Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
B
Backend Server
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SpinShare
Backend Server
Commits
54dbd003
Commit
54dbd003
authored
Aug 02, 2020
by
SpinShare
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added tournament switch for mods
parent
1d2185cf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
0 deletions
+28
-0
src/Controller/Moderation/ModactionsController.php
src/Controller/Moderation/ModactionsController.php
+17
-0
templates/song/detail.html.twig
templates/song/detail.html.twig
+11
-0
No files found.
src/Controller/Moderation/ModactionsController.php
View file @
54dbd003
...
@@ -320,4 +320,21 @@ class ModactionsController extends AbstractController
...
@@ -320,4 +320,21 @@ class ModactionsController extends AbstractController
return
$this
->
redirectToRoute
(
'user.detail'
,
array
(
'userId'
=>
$userId
));
return
$this
->
redirectToRoute
(
'user.detail'
,
array
(
'userId'
=>
$userId
));
}
}
/**
* @Route("/moderation/song/toggleTournament/{songId}", name="moderation.song.toggleTournament")
*/
public
function
userToggleTournament
(
Request
$request
,
int
$songId
)
{
$em
=
$this
->
getDoctrine
()
->
getManager
();
$data
=
[];
$songToToggle
=
$em
->
getRepository
(
Song
::
class
)
->
findOneBy
(
array
(
'id'
=>
$songId
));
$songToToggle
->
setIsTournament
(
!
$songToToggle
->
getIsTournament
());
$em
->
persist
(
$songToToggle
);
$em
->
flush
();
return
$this
->
redirectToRoute
(
'song.detail'
,
array
(
'songId'
=>
$songId
));
}
}
}
templates/song/detail.html.twig
View file @
54dbd003
...
@@ -68,6 +68,17 @@
...
@@ -68,6 +68,17 @@
</a>
</a>
{%
endif
%}
{%
endif
%}
{%
endif
%}
{%
endif
%}
{%
if
is_granted
(
'ROLE_MODERATOR'
)
%}
<a
href=
"
{{
path
(
'moderation.song.toggleTournament'
,
{
songId
:
song.id
}
)
}}
"
class=
"action"
>
<div
class=
"icon"
>
{%
if
song.isTournament
%}
<i
class=
"mdi mdi-heart-remove"
></i>
{%
else
%}
<i
class=
"mdi mdi-heart-plus"
></i>
{%
endif
%}
</div>
</a>
{%
endif
%}
</div>
</div>
<div
class=
"song-statistics"
>
<div
class=
"song-statistics"
>
<div
class=
"stat"
>
<div
class=
"stat"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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