mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 17:39:06 +02:00
Mark usernames with @.
This commit is contained in:
parent
73c2aa232d
commit
743423432e
3 changed files with 3 additions and 3 deletions
|
@ -513,7 +513,7 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
|
||||||
public function getFullName(bool $including_username = false): string
|
public function getFullName(bool $including_username = false): string
|
||||||
{
|
{
|
||||||
if ($including_username) {
|
if ($including_username) {
|
||||||
return sprintf('%s %s (%s)', $this->getFirstName(), $this->getLastName(), $this->getName());
|
return sprintf('%s %s (@%s)', $this->getFirstName(), $this->getLastName(), $this->getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
return sprintf('%s %s', $this->getFirstName(), $this->getLastName());
|
return sprintf('%s %s', $this->getFirstName(), $this->getLastName());
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
{% if app.user %}<i class="fa fa-user" aria-hidden="true"></i>{% else %}<i class="far fa-user" aria-hidden="true"></i>{% endif %} <span class="caret"></span></a>
|
{% if app.user %}<i class="fa fa-user" aria-hidden="true"></i>{% else %}<i class="far fa-user" aria-hidden="true"></i>{% endif %} <span class="caret"></span></a>
|
||||||
<ul class="dropdown-menu dropdown-menu-right" id="login-menu">
|
<ul class="dropdown-menu dropdown-menu-right" id="login-menu">
|
||||||
{% if app.user %}
|
{% if app.user %}
|
||||||
<a class="dropdown-item disabled" href="#" >{% trans %}user.loggedin.label{% endtrans %} {{ app.user.firstName }} {{app.user.lastName}} ({{app.user.name}})</a>
|
<a class="dropdown-item disabled" href="#" >{% trans %}user.loggedin.label{% endtrans %} <b>{{ app.user.firstName }} {{app.user.lastName}}</b> (@{{app.user.name}})</a>
|
||||||
<a class="dropdown-item" href="{{ path("user_settings") }}"><i class="fa fa-cogs fa-fw" aria-hidden="true"></i> {% trans %}user.settings.label{% endtrans %}</a>
|
<a class="dropdown-item" href="{{ path("user_settings") }}"><i class="fa fa-cogs fa-fw" aria-hidden="true"></i> {% trans %}user.settings.label{% endtrans %}</a>
|
||||||
<a class="dropdown-item" href="{{ path("user_info_self") }}"><i class="fa fa-info-circle fa-fw" aria-hidden="true"></i> {% trans %}user.info.label{% endtrans %}</a>
|
<a class="dropdown-item" href="{{ path("user_info_self") }}"><i class="fa fa-info-circle fa-fw" aria-hidden="true"></i> {% trans %}user.info.label{% endtrans %}</a>
|
||||||
<li role="separator" class="dropdown-divider"></li>
|
<li role="separator" class="dropdown-divider"></li>
|
||||||
|
|
|
@ -39,7 +39,7 @@ class UserTest extends TestCase
|
||||||
$user->setLastName('Doe');
|
$user->setLastName('Doe');
|
||||||
|
|
||||||
$this->assertSame('John Doe', $user->getFullName(false));
|
$this->assertSame('John Doe', $user->getFullName(false));
|
||||||
$this->assertSame('John Doe (username)', $user->getFullName(true));
|
$this->assertSame('John Doe (@username)', $user->getFullName(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function googleAuthenticatorEnabledDataProvider(): array
|
public function googleAuthenticatorEnabledDataProvider(): array
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue