Commit b72937ce authored by Andreas Heimann's avatar Andreas Heimann

added pronouns to profile

parent d716e231
......@@ -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;
......
......@@ -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 {
......
......@@ -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
......@@ -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 {
......
......@@ -32,12 +32,19 @@ 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($existingUserEmail == null && $existingUserEmail != $user || $existingUserUsername == null && $existingUserUsername != $user) {
$user->setEmail($formData->get('email'));
$user->setUsername($formData->get('username'));
$this->addFlash('success', 'Saved successfully!');
} else {
$this->addFlash('error', 'Email or username are already in use!');
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 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!');
......
......@@ -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>
......
......@@ -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>
......
Markdown is supported
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