Created
August 30, 2019 20:12
-
-
Save peterbe/6e58113ac0013306ca1ddbb746d319bd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/jinja2/includes/login.html b/jinja2/includes/login.html | |
index ddd57a14f..fb4fa5c85 100644 | |
--- a/jinja2/includes/login.html | |
+++ b/jinja2/includes/login.html | |
@@ -1,15 +1,16 @@ | |
<div class="login"> | |
- {% if user.is_authenticated %} | |
- <a class="user-url" href="{{ user.get_absolute_url() }}"> | |
- <img src="{{ gravatar_url(user.email, size=50) }}" alt="{{ user_display(user) }}" width="50" height="50" class="login-photo avatar" /> | |
- <span class="login-name">{{ user_display(user) }}</span> | |
+ | |
+<div id="logged-in" style="display:none"> | |
+ <a class="user-url" href="#template-profile-url"> | |
+ <img src="" alt="#template-user-display" width="50" height="50" class="login-photo avatar" /> | |
+ <span class="login-name"><!-- user-display --></span> | |
{% include 'includes/icons/arrows/caret-down.svg' %} | |
</a> | |
<div class="submenu js-submenu" id="nav-user-submenu"> | |
<div class="submenu-column"> | |
<ul> | |
- <li><a href="{{ user.get_absolute_url() }}">{{ _('View profile') }}</a></li> | |
- <li><a href="{{ url('users.user_edit', username=user.username) }}">{{ _('Edit profile') }}</a></li> | |
+ <li><a href="#template-profile-url">{{ _('View profile') }}</a></li> | |
+ <li><a href="#template-edit-profile-url">{{ _('Edit profile') }}</a></li> | |
<li><form class="login-form" action="{{ url('account_logout') }}" method="post"> | |
<input name="next" type="hidden" value="{{ next_url }}"> | |
<button class="logout button link" type="submit">{{ _('Sign out') }}</button> | |
@@ -17,10 +18,11 @@ | |
</ul> | |
</div> | |
</div> | |
- {% else %} | |
+ </div> | |
+ <span id="not-logged-in"> | |
{% set github_url = provider_login_url('github', next=next_url) %} | |
<a href="{{ github_url }}" class="login-link js-login-link" data-service="GitHub" rel="nofollow"> | |
{{ _('Sign in') }}{% include 'includes/icons/social/github.svg' %} | |
</a> | |
- {% endif %} | |
+ </span> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment