mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-02 01:04:41 +02:00
Show user avatar next to its name, in all possible locations
This commit is contained in:
parent
29bce6f19f
commit
97b87dee5f
9 changed files with 143 additions and 47 deletions
|
@ -9,7 +9,7 @@
|
|||
<div class="card-body row">
|
||||
<div class="col-md-2">
|
||||
<div class="mx-auto">
|
||||
<img class="img-fluid img-thumbnail img-rounded " alt="User avatar" src="{{ avatar }}">
|
||||
<img class="img-fluid img-thumbnail rounded" alt="User avatar" src="{{ avatar_helper.avatarURL(user) }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
{% import "helper.twig" as helper %}
|
||||
|
||||
<nav class="navbar navbar-expand-md navbar-light bg-light border-bottom shadow-sm fixed-top py-0" id="navbar">
|
||||
<div class="container-fluid">
|
||||
<button type="button" class="navbar-toggler" data-bs-toggle="collapse" data-bs-target="#sidebar-container">
|
||||
|
@ -41,7 +43,7 @@
|
|||
<ul class="dropdown-menu dropdown-menu-end" id="login-menu" aria-labelledby="navbar-user-dropdown-btn">
|
||||
{% if app.user %}
|
||||
<a class="dropdown-item disabled" href="#">{% trans %}user.loggedin.label{% endtrans %}
|
||||
<b>{{ app.user.firstName }} {{ app.user.lastName }}</b> (@{{ app.user.name }})</a>
|
||||
{{ helper.user_icon(app.user) }} <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>
|
||||
|
|
|
@ -160,14 +160,18 @@
|
|||
|
||||
{% if user is not null %}
|
||||
{% if user.fullName is not empty %}
|
||||
(<a href="{{ path('user_info', {"id": user.id}) }}" title="@{{ user.name }}">{{ user.fullName }}</a>)
|
||||
({{ _self.user_icon(user) }} <a href="{{ path('user_info', {"id": user.id}) }}" title="@{{ user.name }}">{{ user.fullName }}</a>)
|
||||
{% else %}
|
||||
(<a href="{{ path('user_info', {"id": user.id}) }}" title="@{{ user.name }}">@{{ user.name }}</a>)
|
||||
({{ _self.user_icon(user) }} <a href="{{ path('user_info', {"id": user.id}) }}" title="@{{ user.name }}">@{{ user.name }}</a>)
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro user_icon(user) %}
|
||||
<img src="{{ avatar_helper.avatarSmURL(user) }}" class="rounded" style="height: 1.2rem;" alt="User avatar">
|
||||
{% endmacro %}
|
||||
|
||||
{% macro parameters_table(parameters) %}
|
||||
<table class="table table-hover table-striped table-sm">
|
||||
<thead>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue