~sircmpwn/core.sr.ht

ref: 16834a8a9a4d93789a7583297b082ec061caf169 core.sr.ht/srht/templates/nav.html -rw-r--r-- 1014 bytes
16834a8aDrew DeVault OAuth: error on insufficient scopes 1 year, 7 months ago
                                                                                
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
<a class="navbar-brand" href="/">
  {{site_name}}
  <span class="text-danger">{{site.split(".")[0]}}</span>
</a>
<ul class="navbar-nav">
  {% if current_user %}
  {% for _site in network %}
  <li class="nav-item {{'active' if _site == site else ''}}">
    <a
      class="nav-link"
      href="{{get_origin(_site, external=True)}}"
    >{{_site.split(".")[0]}}</a>
  </li>
  {% endfor %}
  {% endif %}
</ul>
<div class="login">
  {% if current_user %}
  <span class="navbar-text">
    Logged in as
    <a href="{{get_origin("meta.sr.ht", external=True)}}/profile">
      {{current_user.username}}</a>
    &mdash;
    <a href="{{logout_url}}">Log out</a>
  </span>
  {% else %}
  <span class="navbar-text">
    {% if site == 'meta.sr.ht' %}
    <a href="/login">Log in</a>
    &mdash;
    <a href="/">Register</a>
    {% else %}
    <a href="{{ oauth_url }}" rel="nofollow">Log in</a>
    &mdash;
    <a href="{{get_origin("meta.sr.ht", external=True)}}">Register</a>
    {% endif %}
  </span>
  {% endif %}
</div>