forked from ezsystems/DemoBundle
/
page_header_links.html.twig
41 lines (41 loc) · 2.85 KB
/
page_header_links.html.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<ul class="nav">
{% if ezpublish.legacy is defined %}
<li id="tagcloud"><a href="{{ path( 'ez_legacy', {'module_uri': '/content/view/tagcloud/2'} ) }}" title="{{ 'Tag cloud'|trans }}">{{ 'Tag cloud'|trans }}</a></li>
<li id="sitemap"><a href="{{ path( 'ez_legacy', {'module_uri': '/content/view/sitemap/2'} ) }}" title="{{ 'Site map'|trans }}">{{ 'Site map'|trans }}</a></li>
<li id="shoppingbasket"><a href="{{ path( 'ez_legacy', {'module_uri': '/shop/basket/'} ) }}" title="{{ 'Shopping basket'|trans }}">{{ 'Shopping basket'|trans }}</a></li>
{% endif %}
{# Using IS_AUTHENTICATED_REMEMBERED to check if user is logged in as he can come back from another session, with "remember me" token. #}
{# IS_AUTHENTICATED_FULLY inherits from IS_AUTHENTICATED_REMEMBERED, so a fully authenticated user will also have this role. #}
{% if is_granted( 'IS_AUTHENTICATED_REMEMBERED' ) %}
{% if ezpublish.legacy is defined %}<li id="myprofile"><a href="{{ path( 'ez_legacy', {'module_uri': '/user/edit/'} ) }}" title="{{ 'My profile'|trans }}">{{ 'My profile'|trans }}</a></li>{% endif %}
<li id="logout"><a href="{{ path( 'logout' ) }}" title="{{ 'Logout'|trans }}">{{ 'Logout'|trans }} ( {{ app.user.username }} )</a></li>
{% else %}
{% if ezpublish.legacy is defined %}
<li id="registeruser"><a href="{{ path( 'ez_legacy', {'module_uri': '/user/register'} ) }}" title="{{ 'Register'|trans }}">{{ 'Register'|trans }}</a></li>
{% endif %}
<li id="login" class="transition-showed">
<a href="#login" title="show login form" class="show-login-form">{{ 'Login'|trans }}</a>
<a href="#" title="hide login form" class="hide-login-form">{{ 'Login'|trans }}</a>
<form class="login-form" action="{{ path( 'login_check' ) }}" method="post">
<fieldset>
<label>
<span class="hidden">{{ 'Username'|trans }}</span>
<input type="text" name="_username" id="login-username" placeholder="Username">
</label>
<label>
<span class="hidden">{{ 'Password'|trans }}</span>
<input type="password" name="_password" id="login-password" placeholder="Password">
</label>
<div class="clearfix">
{% if ezpublish.legacy is defined %}<a href="{{ path( 'ez_legacy', {'module_uri': '/user/forgotpassword'} ) }}" class="forgot-password">{{ 'Forgot your password?'|trans }}</a>{% endif %}
<button class="btn btn-warning pull-right" id="header-login-button" type="submit">
{{ 'Login'|trans }}
</button>
</div>
</fieldset>
<input type="hidden" name="_target_path" value="" />
<input type="hidden" name="_csrf_token" value="{{ csrf_token("authenticate") }}" />
</form>
</li>
{% endif %}
</ul>