Skip to content

Commit 47b35b4

Browse files
authored
Merge pull request #340 from symfony-cmf/admin_popup
Improve user block design
2 parents b2bf486 + e78830a commit 47b35b4

File tree

3 files changed

+25
-6
lines changed

3 files changed

+25
-6
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Switch to :
1+
Read in
22
{% for locale in locales %}
3-
{% if loop.index > 1 %} | {% endif %}<a href="{{ locale.link }}" title="{{ locale.locale_target_language }}">{{ locale.locale_target_language }}</a>
3+
<a href="{{ locale.link }}" title="{{ locale.locale_target_language }}"><img src="{{ asset('/bundles/sonatatranslation/img/flags/' ~ locale.locale ~ '.png') }}"></a>
44
{% endfor %}
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
{% extends 'SonataAdminBundle:Core:user_block.html.twig' %}
22

33
{% block user_block %}
4-
{{ locale_switcher(null, null, 'admin/switcher_links.html.twig') }}
5-
- Welcome {{ app.user.username }} {# <a href="{{ path('fos_user_security_logout') }}">Logout</a> #}
6-
{{ parent() }}
4+
<div class="admin-user-info">
5+
Hi {{ app.user.username }}!
6+
<a href="{{ path('logout') }}">Logout</a>
7+
</div>
8+
9+
<div class="admin-user-locale">
10+
{{ locale_switcher(null, null, 'admin/switcher_links.html.twig') }}
11+
</div>
712
{% endblock %}

web/assets/css/sonata_admin.css

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,18 @@
55
.sonata-admin-menu-item a.sonata-admin-frontend-link:before {
66
font-family: FontAwesome;
77
content: "\f08e";
8-
}
8+
}
9+
10+
.dropdown-user{
11+
box-shadow:1px 1px 4px #eee;
12+
}
13+
14+
.admin-user-info{
15+
padding:5px;
16+
}
17+
.admin-user-locale{
18+
border-top:1px solid #eaeaea;
19+
margin:5px;
20+
margin-top:0;
21+
padding-top:5px;
22+
}

0 commit comments

Comments
 (0)