{% if (global.flags.isLogged) %}
	<div class="login-box" id="login-box" title="{{ global.user.name }}">
		<div class="lb-user">
			<div class="lb-ava img-box" id="lb-ava"><img src="{{ avatar_url }}" title="{{ global.user.name }}" alt="{{ global.user.name }}" /></div>
			<div class="lb-name">
				<div>{{ global.user.name }}</div>
				{% if (global.flags.isLogged and (global.user['status'] <= 3)) %}
					<a href="{{ admin_url }}" target="_blank">{{ lang.admin_panel }}</a>
				{% endif %}
			</div>
		</div>
		<ul class="lb-menu icon-l">
			{% if pluginIsActive('nsm') %}
				<li><a href="{{ p.nsm.link }}"><span class="fa fa-plus"></span>{{ lang.add_news }}</a></li>
			{% endif %}
			{% if pluginIsActive('uprofile') %}
				<li><a href="{{ user_link }}"><span class="fa fa-user"></span>{{ lang.myprofile }}</a></li>
				<li><a href="{{ profile_link }}"><span class="fa fa-cog"></span>{{ lang.edit_profile }}</a></li>
			{% endif %}
			{% if pluginIsActive('pm') %}
				<li><a href="{{ p.pm.link }}"><span class="fa fa-envelope-o"></span>{{ lang.theme.usermenu_pm }}: ({{ p.pm.pm_unread }})</a></li>
			{% endif %}
			{% if pluginIsActive('bookmarks') %}
				<li><a href="{{ p.bookmarks.link }}"><span class="fa fa-heart-o"></span>{{ lang.theme.usermenu_bookmarks }}: ( {{ p.bookmarks.count }} )</a></li>
			{% endif %}
			<li><a href="{{ logout_link }}"><span class="fa fa-sign-out"></span>{{ lang.log_out }}</a></li>
		</ul>
	</div>
{% else %}
	<script language="javascript">
		var set_login = 0;
		var set_pass  = 0;
	</script>
	<div class="login-box" id="login-box" title="{{ lang.theme.usermenu_authorization }}">
		<form name="login" method="post" action="{{ form_action }}" id="login">
			<input type="text" name="username" placeholder="{{ lang.username }}"/>
			<input type="password" name="password" placeholder="{{ lang.password }}" />
			<button type="submit" title="{{ lang.login }}">{{ lang.login }}</button>
			<input type="hidden" name="redirect" value="{{ redirect }}" />
			<div class="lb-check">
				<input type="checkbox" checked>
				<label>{{ lang.remember_me }}</label> 
			</div>
			<div class="lb-lnk flex-row">
				<a href="{{ lost_link }}">{{ lang.lostpassword }}</a>
				<a href="{{ reg_link }}" class="log-register">{{ lang.registration }}</a>
			</div>
		</form>
		<div class="lb-soc">
			<div>{{ lang.theme.usermenu_soc }}:</div>
			<a href="#" target="_blank"><img src="{{ tpl_url }}/images/social/vk.png" /></a>
			<a href="#" target="_blank"><img src="{{ tpl_url }}/images/social/ok.png" /></a>
			<a href="#" target="_blank"><img src="{{ tpl_url }}/images/social/fb.png" /></a>
			<a href="#" target="_blank"><img src="{{ tpl_url }}/images/social/mail.png" /></a>
			<a href="#" target="_blank"><img src="{{ tpl_url }}/images/social/google.png" /></a>
			<a href="#" target="_blank"><img src="{{ tpl_url }}/images/social/yandex.png" /></a>
		</div>
	</div>
{% endif %}