byceps/byceps

View on GitHub
byceps/blueprints/site/core/templates/layout/_current_user.html

Summary

Maintainability
Test Coverage
{%- from 'macros/icons.html' import render_icon %}
{%- from 'macros/user.html' import render_user_avatar %}


<div class="current-user">
  {%- if g.user.authenticated %}
  <div class="dropdown">
    <a href="{{ url_for('user_settings.view') }}" class="dropdown-toggle">
      {{ render_user_avatar(g.user, size=32) }}
      {{ render_icon('chevron-down') }}
    </a>
    <ol class="dropdown-menu dropdown-menu--right">
{% include 'layout/_current_user_menu_items.html' %}
    </ol>
  </div>
  {%- else %}
  <div>
    <a href="{{ url_for('authn_login.log_in_form') }}" class="button">{{ render_icon('log-in') }} <span>{{ _('Log in') }}</span></a>
  </div>
  {%- endif %}
</div>