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
b72937ce
Commit
b72937ce
authored
Nov 02, 2020
by
Andreas Heimann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added pronouns to profile
parent
d716e231
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
63 additions
and
21 deletions
+63
-21
public/assets/css/settings.css
public/assets/css/settings.css
+6
-8
public/assets/css/settings.less
public/assets/css/settings.less
+6
-5
public/assets/css/userdetail.css
public/assets/css/userdetail.css
+11
-1
public/assets/css/userdetail.less
public/assets/css/userdetail.less
+12
-0
src/Controller/UserSettingsController.php
src/Controller/UserSettingsController.php
+13
-6
templates/user/detail.html.twig
templates/user/detail.html.twig
+1
-1
templates/user/settings/index.html.twig
templates/user/settings/index.html.twig
+14
-0
No files found.
public/assets/css/settings.css
View file @
b72937ce
...
...
@@ -78,8 +78,6 @@
font-size
:
12px
;
color
:
#fff
;
background
:
rgba
(
255
,
255
,
255
,
0.2
);
text-transform
:
uppercase
;
font-weight
:
700
;
border-radius
:
4px
;
padding
:
7px
14px
;
border
:
0px
;
...
...
@@ -117,12 +115,6 @@
.section-settings
.settings-content
.settings-box
.settings-item
.settings-input
input
[
type
=
"email"
]
:disabled
{
opacity
:
0.4
;
}
.section-settings
.settings-content
.settings-box
.settings-item
.settings-input
input
[
type
=
"text"
],
.section-settings
.settings-content
.settings-box
.settings-item
.settings-input
input
[
type
=
"password"
],
.section-settings
.settings-content
.settings-box
.settings-item
.settings-input
input
[
type
=
"email"
]
{
text-transform
:
initial
;
font-weight
:
normal
;
}
.section-settings
.settings-content
.settings-box
.settings-item
.settings-input
input
[
type
=
"text"
]
:hover
,
.section-settings
.settings-content
.settings-box
.settings-item
.settings-input
input
[
type
=
"password"
]
:hover
,
.section-settings
.settings-content
.settings-box
.settings-item
.settings-input
input
[
type
=
"email"
]
:hover
{
...
...
@@ -131,6 +123,12 @@
.section-settings
.settings-content
.settings-box
.settings-item
.settings-input
select
:hover
{
cursor
:
pointer
;
}
.section-settings
.settings-content
.settings-box
.settings-item
.settings-input
span
{
font-size
:
12px
;
line-height
:
1.25em
;
margin-top
:
10px
;
opacity
:
0.6
;
}
.section-settings
.settings-content
.settings-box
.settings-save
{
margin-top
:
15px
;
display
:
flex
;
...
...
public/assets/css/settings.less
View file @
b72937ce
...
...
@@ -80,8 +80,6 @@
font-size: 12px;
color: #fff;
background: rgba(255,255,255,0.2);
text-transform: uppercase;
font-weight: 700;
border-radius: 4px;
padding: 7px 14px;
border: 0px;
...
...
@@ -106,9 +104,6 @@
}
}
& input[type="text"], input[type="password"], input[type="email"] {
text-transform: initial;
font-weight: normal;
&:hover {
cursor: text;
}
...
...
@@ -116,6 +111,12 @@
& select:hover {
cursor: pointer;
}
span {
font-size: 12px;
line-height: 1.25em;
margin-top: 10px;
opacity: 0.6;
}
}
}
& .settings-save {
...
...
public/assets/css/userdetail.css
View file @
b72937ce
...
...
@@ -55,6 +55,17 @@
font-size
:
22px
;
margin-bottom
:
22px
;
}
.section-user-detail
header
.detail
.user-data
.user-name
span
{
display
:
inline-block
;
background
:
rgba
(
255
,
255
,
255
,
0.2
);
color
:
#fff
;
font-size
:
8px
;
font-weight
:
bold
;
padding
:
4px
6px
;
border-radius
:
2px
;
transform
:
translateY
(
-3px
);
margin-right
:
5px
;
}
.section-user-detail
header
.detail
.user-data
.user-actions
.button
{
margin-right
:
7px
;
}
...
...
@@ -265,4 +276,3 @@
.card-overlay
.overlay-content
.button
{
display
:
inline-block
;
}
/*# sourceMappingURL=userdetail.css.map */
\ No newline at end of file
public/assets/css/userdetail.less
View file @
b72937ce
...
...
@@ -60,6 +60,18 @@
& .user-name {
font-size: 22px;
margin-bottom: 22px;
& span {
display: inline-block;
background: rgba(255,255,255,0.2);
color: #fff;
font-size: 8px;
font-weight: bold;
padding: 4px 6px;
border-radius: 2px;
transform: translateY(-3px);
margin-right: 5px;
}
}
& .user-actions {
& .button {
...
...
src/Controller/UserSettingsController.php
View file @
b72937ce
...
...
@@ -32,13 +32,20 @@ class UserSettingsController extends AbstractController
$existingUserEmail
=
$em
->
getRepository
(
User
::
class
)
->
findOneBy
(
array
(
'email'
=>
$formData
->
get
(
'email'
)));
$existingUserUsername
=
$em
->
getRepository
(
User
::
class
)
->
findOneBy
(
array
(
'username'
=>
$formData
->
get
(
'username'
)));
if
(
$formData
->
get
(
'email'
)
!=
$user
->
getEmail
()
||
$formData
->
get
(
'username'
)
!=
$user
->
getUsername
())
{
if
(
$existingUserEmail
==
null
&&
$existingUserEmail
!=
$user
||
$existingUserUsername
==
null
&&
$existingUserUsername
!=
$user
)
{
$user
->
setEmail
(
$formData
->
get
(
'email'
));
$user
->
setUsername
(
$formData
->
get
(
'username'
));
$this
->
addFlash
(
'success'
,
'Saved
successfully!'
);
$this
->
addFlash
(
'success'
,
'Saved new username/email
successfully!'
);
}
else
{
$this
->
addFlash
(
'error'
,
'Email or username are already in use!'
);
}
}
if
(
$formData
->
get
(
'pronouns'
)
!=
$user
->
getPronouns
())
{
$user
->
setPronouns
(
$formData
->
get
(
'pronouns'
));
$this
->
addFlash
(
'success'
,
'Saved preferred pronouns successfully!'
);
}
}
else
{
$this
->
addFlash
(
'error'
,
'Email and username can\'t be empty!'
);
}
...
...
templates/user/detail.html.twig
View file @
b72937ce
...
...
@@ -18,7 +18,7 @@
{%
endif
%}
</div>
<div
class=
"user-data"
>
<div
class=
"user-name"
>
{{
user.username
}}
{%
if
user.isPatreon
%}
<i
class=
"mdi mdi-patreon"
></i>
{%
endif
%}
</div>
<div
class=
"user-name"
>
{
%
if
user.pronouns
!=
""
%}
<span>
{{
user.pronouns
}}
</span>
{%
endif
%}{
{
user.username
}}
{%
if
user.isPatreon
%}
<i
class=
"mdi mdi-patreon"
></i>
{%
endif
%}
</div>
<div
class=
"user-actions"
>
<a
href=
"
{{
path
(
'report.user'
,
{
userId
:
user.id
}
)
}}
"
class=
"button"
>
Report
</a>
<a
href=
"spinshare-user://
{{
user.id
}}
"
class=
"button"
>
Open in Client
</a>
...
...
templates/user/settings/index.html.twig
View file @
b72937ce
...
...
@@ -25,6 +25,20 @@
<input
type=
"text"
name=
"username"
value=
"
{{
my.username
}}
"
required
/>
</div>
</div>
<div
class=
"settings-item"
>
<div
class=
"settings-label"
>
Preferred Pronouns
</div>
<div
class=
"settings-input"
>
<select
name=
"pronouns"
>
<option
value=
""
{{
my.pronouns
==
""
?
"selected"
:
""
}}
>
-
</option>
<option
value=
"he/him"
{{
my.pronouns
==
"he/him"
?
"selected"
:
""
}}
>
he/him
</option>
<option
value=
"she/her"
{{
my.pronouns
==
"she/her"
?
"selected"
:
""
}}
>
she/her
</option>
<option
value=
"they/them"
{{
my.pronouns
==
"they/them"
?
"selected"
:
""
}}
>
they/them
</option>
<option
value=
"he/they"
{{
my.pronouns
==
"he/they"
?
"selected"
:
""
}}
>
he/they
</option>
<option
value=
"she/they"
{{
my.pronouns
==
"she/they"
?
"selected"
:
""
}}
>
she/they
</option>
</select>
<span>
This will be shown on your profile and on tournaments, so please take this field serious.
</span>
</div>
</div>
<div
class=
"settings-save"
>
<input
type=
"submit"
class=
"button"
name=
"save"
value=
"Save"
/>
</div>
...
...
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