File: _nav.html

package info (click to toggle)
flask-security 5.7.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,524 kB
  • sloc: python: 23,478; javascript: 204; makefile: 138
file content (20 lines) | stat: -rw-r--r-- 798 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{%- if _fs_is_user_authenticated(current_user) -%}
  <p>{{ _fsdomain('Welcome') }} {{ current_user.calc_username() }}</p>
{%- endif %}
<ul>
  <li><a href="{{ url_for('index') }}">Index</a></li>
  <li><a href="{{ url_for('profile') }}">Profile</a></li>
  {% if current_user and current_user.has_role('admin') -%}
  <li><a href="{{ url_for('admin') }}">Admin</a></li>
  {% endif -%}
  {% if current_user and (current_user.has_role('admin') or current_user.has_role('editor')) -%}
  <li><a href="{{ url_for('admin_or_editor') }}">Admin or Editor</a></li>
  {% endif -%}
  <li>
    {%- if _fs_is_user_authenticated(current_user) -%}
      <a href="{{ url_for('security.logout') }}">Log out</a>
    {%- else -%}
      <a href="{{ url_for('security.login') }}">Log in</a>
    {%- endif -%}
  </li>
</ul>