File: _menu.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 (80 lines) | stat: -rw-r--r-- 3,132 bytes parent folder | download
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
{% if security.registerable or security.recoverable or security.confirmable or
 security.unified_signin or security.two_factor or security.webauthn or security.change_username or
  security.username_recovery %}
  <hr>
  <h2>{{ _fsdomain('Menu') }}</h2>
  <ul>
    {% if _fs_is_user_authenticated(current_user) %}
      {# already authenticated user #}
      <li>
        <a href="{{ url_for_security('logout') }}">{{ _fsdomain("Sign out") }}</a>
      </li>
      {% if security.changeable %}
        <li>
          <a href="{{ url_for_security('change_password') }}">{{ _fsdomain("Change Password") }}</a>
        </li>
      {% endif %}
      {% if security.recoverable %}
        <li>
          <a href="{{ url_for_security('forgot_password') }}">{{ _fsdomain('Forgot password?') }}</a>
        </li>
      {% endif %}
      {% if security.change_email %}
        <li>
          <a href="{{ url_for_security('change_email') }}">{{ _fsdomain("Change Registered Email") }}</a>
        </li>
      {% endif %}
      {% if security.change_username %}
        <li>
          <a href="{{ url_for_security('change_username') }}">{{ _fsdomain("Change Username") }}</a>
        </li>
      {% endif %}
      {% if security.two_factor %}
        <li>
          <a href="{{ url_for_security('two_factor_setup') }}">{{ _fsdomain("Two-Factor Setup") }}</a>
        </li>
      {% endif %}
      {% if security.unified_signin %}
        <li>
          <a href="{{ url_for_security('us_setup') }}">{{ _fsdomain("Unified Signin Setup") }}</a>
        </li>
      {% endif %}
      {% if security.webauthn %}
        <li>
          <a href="{{ url_for_security('wan_register') }}">{{ _fsdomain("Passkey Setup") }}</a>
        </li>
      {% endif %}
    {% else %}
      {% if not skip_login_menu %}
        <li>
          <a href="{{ url_for_security('login') }}{%- if 'next' in request.args -%}?next={{ request.args.next|urlencode }}{%- endif -%}">{{ _fsdomain('Login') }}</a>
        </li>
      {% endif %}
      {% if security.unified_signin and not skip_login_menu %}
        <li>
          <a href="{{ url_for_security('us_signin') }}{%- if 'next' in request.args -%}?next={{ request.args.next|urlencode }}{%- endif -%}">{{ _fsdomain('Unified Sign In') }}</a>
        </li>
      {% endif %}
      {% if security.registerable %}
        <li>
          <a href="{{ url_for_security('register') }}{%- if 'next' in request.args -%}?next={{ request.args.next|urlencode }}{%- endif -%}">{{ _fsdomain('Register') }}</a>
        </li>
      {% endif %}
      {% if security.recoverable %}
        <li>
          <a href="{{ url_for_security('forgot_password') }}">{{ _fsdomain('Forgot password?') }}</a>
        </li>
      {% endif %}
      {% if security.username_recovery %}
        <li>
          <a href="{{ url_for_security('recover_username') }}">{{ _fsdomain('Recover Username') }}</a>
        </li>
      {% endif %}
      {% if security.confirmable %}
        <li>
          <a href="{{ url_for_security('send_confirmation') }}">{{ _fsdomain('Confirm account') }}</a>
        </li>
      {% endif %}
    {% endif %}
  </ul>
{% endif %}