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
5424e66b
Commit
5424e66b
authored
Apr 16, 2020
by
Andreas Heimann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
all songs button
parent
bf43c4f9
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
232 additions
and
43 deletions
+232
-43
public/assets/css/main.css
public/assets/css/main.css
+16
-0
public/assets/css/main.less
public/assets/css/main.less
+15
-0
public/assets/css/search.css
public/assets/css/search.css
+49
-8
public/assets/css/search.less
public/assets/css/search.less
+62
-16
public/assets/js/search.js
public/assets/js/search.js
+9
-0
src/Controller/SearchController.php
src/Controller/SearchController.php
+30
-18
src/Entity/Song.php
src/Entity/Song.php
+17
-0
templates/moderation/reports/song.html.twig
templates/moderation/reports/song.html.twig
+1
-1
templates/search/index.html.twig
templates/search/index.html.twig
+33
-0
No files found.
public/assets/css/main.css
View file @
5424e66b
...
@@ -82,6 +82,7 @@ button,
...
@@ -82,6 +82,7 @@ button,
border
:
0px
;
border
:
0px
;
text-decoration
:
none
;
text-decoration
:
none
;
text-align
:
center
;
text-align
:
center
;
user-select
:
none
;
transition
:
0.2s
ease-in-out
background
,
0.2s
ease-in-out
color
;
transition
:
0.2s
ease-in-out
background
,
0.2s
ease-in-out
color
;
}
}
button
:hover
,
button
:hover
,
...
@@ -94,6 +95,21 @@ button:focus,
...
@@ -94,6 +95,21 @@ button:focus,
.button
:focus
{
.button
:focus
{
outline
:
0
;
outline
:
0
;
}
}
button
.button-label
,
.button.button-label
{
background
:
transparent
;
}
button
.button-label
:hover
,
.button.button-label
:hover
{
background
:
rgba
(
255
,
255
,
255
,
0.2
);
color
:
#fff
;
}
button
.button-label
:active
,
.button.button-label
:active
{
background
:
#fff
;
color
:
#222
;
cursor
:
pointer
;
}
.song-row
{
.song-row
{
display
:
grid
;
display
:
grid
;
grid-template-rows
:
auto
1
fr
;
grid-template-rows
:
auto
1
fr
;
...
...
public/assets/css/main.less
View file @
5424e66b
...
@@ -86,6 +86,7 @@ button, .button {
...
@@ -86,6 +86,7 @@ button, .button {
border: 0px;
border: 0px;
text-decoration: none;
text-decoration: none;
text-align: center;
text-align: center;
user-select: none;
transition: 0.2s ease-in-out background, 0.2s ease-in-out color;
transition: 0.2s ease-in-out background, 0.2s ease-in-out color;
&:hover {
&:hover {
...
@@ -96,6 +97,20 @@ button, .button {
...
@@ -96,6 +97,20 @@ button, .button {
&:focus {
&:focus {
outline: 0;
outline: 0;
}
}
&.button-label {
background: transparent;
&:hover {
background: rgba(255,255,255,0.2);
color: #fff;
}
&:active {
background: #fff;
color: #222;
cursor: pointer;
}
}
}
}
.song-row {
.song-row {
display: grid;
display: grid;
...
...
public/assets/css/search.css
View file @
5424e66b
...
@@ -4,27 +4,68 @@
...
@@ -4,27 +4,68 @@
grid-gap
:
25px
;
grid-gap
:
25px
;
padding
:
50px
;
padding
:
50px
;
}
}
.section-search
.search-bar
input
{
.section-search
.search-bar
form
{
width
:
100%
;
background
:
rgba
(
255
,
255
,
255
,
0.2
);
border-radius
:
4px
;
display
:
grid
;
grid-template-columns
:
auto
auto
1
fr
;
}
.section-search
.search-bar
form
.show-all
{
height
:
100%
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
padding-left
:
10px
;
}
.section-search
.search-bar
form
input
{
font-family
:
'Open Sans'
,
sans-serif
;
font-family
:
'Open Sans'
,
sans-serif
;
font-size
:
14px
;
font-size
:
14px
;
color
:
#fff
;
color
:
#fff
;
background
:
rgba
(
255
,
255
,
255
,
0.2
);
background
:
transparent
;
border-radius
:
4px
;
padding
:
14px
28px
;
padding
:
14px
28px
;
border
:
0px
;
border
:
0px
;
transition
:
0.2s
ease-in-out
background
,
0.2s
ease-in-out
color
;
transition
:
0.2s
ease-in-out
background
,
0.2s
ease-in-out
color
;
}
}
.section-search
.search-bar
input
:hover
{
.section-search
.search-bar
form
input
:hover
{
background
:
rgba
(
255
,
255
,
255
,
0.
4
);
background
:
rgba
(
255
,
255
,
255
,
0.
2
);
color
:
#fff
;
color
:
#fff
;
}
}
.section-search
.search-bar
input
:focus
{
.section-search
.search-bar
form
input
:focus
{
outline
:
0
;
outline
:
0
;
}
}
.section-search
.search-bar
input
::placeholder
{
.section-search
.search-bar
form
input
::placeholder
{
color
:
rgba
(
255
,
255
,
255
,
0.6
);
color
:
rgba
(
255
,
255
,
255
,
0.6
);
}
}
.section-search
.search-bar
form
.multi-select
{
position
:
relative
;
z-index
:
99
;
}
.section-search
.search-bar
form
.multi-select
.label
{
height
:
100%
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
padding
:
0px
10px
;
}
.section-search
.search-bar
form
.multi-select
.box
{
position
:
absolute
;
z-index
:
99
;
background
:
#000000
;
border-radius
:
6px
;
width
:
250px
;
left
:
0px
;
user-select
:
none
;
display
:
none
;
}
.section-search
.search-bar
form
.multi-select
.box
.item
{
display
:
grid
;
grid-template-columns
:
25px
1
fr
;
grid-gap
:
25px
;
padding
:
10px
;
}
.section-search
.search-bar
form
.multi-select
.box.active
{
display
:
block
;
}
.section-search
.search-results
{
.section-search
.search-results
{
display
:
grid
;
display
:
grid
;
grid-template-rows
:
auto
auto
auto
1
fr
;
grid-template-rows
:
auto
auto
auto
1
fr
;
...
...
public/assets/css/search.less
View file @
5424e66b
...
@@ -5,19 +5,32 @@
...
@@ -5,19 +5,32 @@
padding: 50px;
padding: 50px;
& .search-bar {
& .search-bar {
input {
width: 100%;
& form {
background: rgba(255,255,255,0.2);
border-radius: 4px;
display: grid;
grid-template-columns: auto auto 1fr;
& .show-all {
height: 100%;
display: flex;
justify-content: center;
align-items: center;
padding-left: 10px;
}
& input {
font-family: 'Open Sans', sans-serif;
font-family: 'Open Sans', sans-serif;
font-size: 14px;
font-size: 14px;
color: #fff;
color: #fff;
background: rgba(255,255,255,0.2);
background: transparent;
border-radius: 4px;
padding: 14px 28px;
padding: 14px 28px;
border: 0px;
border: 0px;
transition: 0.2s ease-in-out background, 0.2s ease-in-out color;
transition: 0.2s ease-in-out background, 0.2s ease-in-out color;
&:hover {
&:hover {
background: rgba(255,255,255,0.4
);
background: rgba(255,255,255,0.2
);
color: #fff;
color: #fff;
}
}
&:focus {
&:focus {
...
@@ -27,6 +40,39 @@
...
@@ -27,6 +40,39 @@
color: rgba(255,255,255,0.6);
color: rgba(255,255,255,0.6);
}
}
}
}
& .multi-select {
position: relative;
z-index: 99;
& .label {
height: 100%;
display: flex;
justify-content: center;
align-items: center;
padding: 0px 10px;
}
& .box {
position: absolute;
z-index: 99;
background: rgba(0,0,0,1);
border-radius: 6px;
width: 250px;
left: 0px;
user-select: none;
display: none;
& .item {
display: grid;
grid-template-columns: 25px 1fr;
grid-gap: 25px;
padding: 10px;
}
&.active {
display: block;
}
}
}
}
}
}
& .search-results {
& .search-results {
display: grid;
display: grid;
...
...
public/assets/js/search.js
0 → 100644
View file @
5424e66b
let
DOMSearchDifficultiesSelect
=
document
.
querySelector
(
"
.multi-select-difficulties
"
);
function
ToggleDifficultiesBox
()
{
if
(
DOMSearchDifficultiesSelect
.
querySelector
(
"
.box
"
).
classList
.
contains
(
"
active
"
))
{
DOMSearchDifficultiesSelect
.
querySelector
(
"
.box
"
).
classList
.
remove
(
"
active
"
);
}
else
{
DOMSearchDifficultiesSelect
.
querySelector
(
"
.box
"
).
classList
.
add
(
"
active
"
);
}
}
\ No newline at end of file
src/Controller/SearchController.php
View file @
5424e66b
...
@@ -5,6 +5,7 @@ namespace App\Controller;
...
@@ -5,6 +5,7 @@ namespace App\Controller;
use
Symfony\Bundle\FrameworkBundle\Controller\AbstractController
;
use
Symfony\Bundle\FrameworkBundle\Controller\AbstractController
;
use
Symfony\Component\Routing\Annotation\Route
;
use
Symfony\Component\Routing\Annotation\Route
;
use
Symfony\Component\HttpFoundation\Request
;
use
Symfony\Component\HttpFoundation\Request
;
use
App\Utils\HelperFunctions
;
use
App\Entity\Song
;
use
App\Entity\Song
;
use
App\Entity\User
;
use
App\Entity\User
;
...
@@ -20,7 +21,17 @@ class SearchController extends AbstractController
...
@@ -20,7 +21,17 @@ class SearchController extends AbstractController
$data
=
[];
$data
=
[];
$searchQuery
=
$request
->
query
->
get
(
'q'
);
$searchQuery
=
$request
->
query
->
get
(
'q'
);
if
(
$searchQuery
)
{
$resultsUsers
=
[];
$resultsSongs
=
[];
if
(
$request
->
query
->
get
(
'showAll'
)
==
"1"
)
{
$resultsSongs
=
$em
->
getRepository
(
Song
::
class
)
->
findAll
();
$data
[
'results'
][
'users'
]
=
$resultsUsers
;
$data
[
'results'
][
'songs'
]
=
$resultsSongs
;
}
else
{
if
(
$searchQuery
!=
null
)
{
$resultsUsers
=
$em
->
getRepository
(
User
::
class
)
->
createQueryBuilder
(
'o'
)
$resultsUsers
=
$em
->
getRepository
(
User
::
class
)
->
createQueryBuilder
(
'o'
)
->
where
(
'o.username LIKE :query'
)
->
where
(
'o.username LIKE :query'
)
->
setParameter
(
'query'
,
'%'
.
$searchQuery
.
'%'
)
->
setParameter
(
'query'
,
'%'
.
$searchQuery
.
'%'
)
...
@@ -40,8 +51,9 @@ class SearchController extends AbstractController
...
@@ -40,8 +51,9 @@ class SearchController extends AbstractController
$data
[
'results'
][
'users'
]
=
$resultsUsers
;
$data
[
'results'
][
'users'
]
=
$resultsUsers
;
$data
[
'results'
][
'songs'
]
=
$resultsSongs
;
$data
[
'results'
][
'songs'
]
=
$resultsSongs
;
$data
[
'searchQuery'
]
=
$searchQuery
;
}
}
}
$data
[
'searchQuery'
]
=
$searchQuery
;
return
$this
->
render
(
'search/index.html.twig'
,
$data
);
return
$this
->
render
(
'search/index.html.twig'
,
$data
);
}
}
...
...
src/Entity/Song.php
View file @
5424e66b
...
@@ -91,6 +91,11 @@ class Song
...
@@ -91,6 +91,11 @@ class Song
*/
*/
private
$hasXDDifficulty
;
private
$hasXDDifficulty
;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private
$previewStart
;
public
function
getId
()
:
?
int
public
function
getId
()
:
?
int
{
{
return
$this
->
id
;
return
$this
->
id
;
...
@@ -275,4 +280,16 @@ class Song
...
@@ -275,4 +280,16 @@ class Song
return
$this
;
return
$this
;
}
}
public
function
getPreviewStart
()
:
?
bool
{
return
$this
->
previewStart
;
}
public
function
setPreviewStart
(
bool
$previewStart
)
:
self
{
$this
->
previewStart
=
$previewStart
;
return
$this
;
}
}
}
templates/moderation/reports/song.html.twig
View file @
5424e66b
...
@@ -61,7 +61,7 @@
...
@@ -61,7 +61,7 @@
{%
elseif
report.reason
==
"metadata"
%}
{%
elseif
report.reason
==
"metadata"
%}
This song has wrong meta data
This song has wrong meta data
{%
elseif
report.reason
==
"other"
%}
{%
elseif
report.reason
==
"other"
%}
Other reson
Other re
a
son
{%
endif
%}
{%
endif
%}
</div>
</div>
</div>
</div>
...
...
templates/search/index.html.twig
View file @
5424e66b
...
@@ -6,6 +6,35 @@
...
@@ -6,6 +6,35 @@
<section
class=
"section-search"
>
<section
class=
"section-search"
>
<div
class=
"search-bar"
>
<div
class=
"search-bar"
>
<form
action=
""
method=
"get"
>
<form
action=
""
method=
"get"
>
<div
class=
"show-all"
>
<a
href=
"
{{
path
(
'search.index'
,
{
showAll
:
true
}
)
}}
"
class=
"button button-label"
>
Show all
</a>
</div>
<div
class=
"multi-select multi-select-difficulties"
>
{#
<div class="label"><div onclick="ToggleDifficultiesBox()" class="button button-label">Difficulties <i class="mdi mdi-chevron-down"></i></div></div>
<div class="box">
<label for="easyDifficulty" class="item">
<input type="checkbox" name="easyDifficulty" id="easyDifficulty" checked />
<span>Easy</span>
</label>
<label for="normalDifficulty" class="item">
<input type="checkbox" name="normalDifficulty" id="normalDifficulty" checked />
<span>Normal</span>
</label>
<label for="hardDifficulty" class="item">
<input type="checkbox" name="hardDifficulty" id="hardDifficulty" checked />
<span>Hard</span>
</label>
<label for="extremeDifficulty" class="item">
<input type="checkbox" name="extremeDifficulty" id="extremeDifficulty" checked />
<span>Extreme</span>
</label>
<label for="XDDifficulty" class="item">
<input type="checkbox" name="XDDifficulty" id="XDDifficulty" checked />
<span>XD</span>
</label>
</div> #}
</div>
<input
name=
"q"
type=
"search"
placeholder=
"Search for songs, tags & profiles..."
value=
"
{{
searchQuery
|
default
(
''
)
}}
"
/>
<input
name=
"q"
type=
"search"
placeholder=
"Search for songs, tags & profiles..."
value=
"
{{
searchQuery
|
default
(
''
)
}}
"
/>
</form>
</form>
</div>
</div>
...
@@ -74,6 +103,10 @@
...
@@ -74,6 +103,10 @@
</section>
</section>
{%
endblock
%}
{%
endblock
%}
{%
block
scripts
%}
<script
src=
"
{{
asset
(
'assets/js/search.js'
)
}}
"
></script>
{%
endblock
%}
{%
block
styles
%}
{%
block
styles
%}
<link
rel=
"stylesheet"
href=
"
{{
asset
(
'assets/css/search.css'
)
}}
"
/>
<link
rel=
"stylesheet"
href=
"
{{
asset
(
'assets/css/search.css'
)
}}
"
/>
{%
endblock
%}
{%
endblock
%}
\ No newline at end of file
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