Commit 1f4dea0b authored by Enrico Zini's avatar Enrico Zini
Browse files

Ported whoami template to signon. refs: #4

parent 0074cc8d
...@@ -2,25 +2,50 @@ ...@@ -2,25 +2,50 @@
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
{% if request.sso_username %} {% if request.signon_identities %}
{% if visitor %} {% if visitor %}
{% blocktrans with request_user_username=request.user.username visitor_a_link=visitor.a_link %}You
are currently logged in with {% blocktrans with visitor_a_link=visitor.a_link %}
<a href="https://wiki.debian.org/DebianSingleSignOn">SSO username</a> You are currently logged in, and recognized as {{visitor_a_link}}.
<b>{{request_user_username}}</b>, and recognized as {{visitor_a_link}}.{% endblocktrans %} {% endblocktrans %}
{% else %} {% else %}
{% url 'dm_claim' as dm_claim_url %} {% url 'dm_claim' as dm_claim_url %}
{% blocktrans with request_user_username=request.user.username %}You {% blocktrans with request_user_username=request.user.username %}You
are currently logged in with are currently logged in, but not mapped to any person in the site.
<a href="https://wiki.debian.org/DebianSingleSignOn">SSO username</a>
<b>{{request_user_username}}</b>, but not mapped to any person in the site.
If you are a Debian Maintainer, you can try to correct the situation using the If you are a Debian Maintainer, you can try to correct the situation using the
<a href="{{dm_claim}}">claim interface</a>.{% endblocktrans %} <a href="{{dm_claim}}">claim interface</a>.{% endblocktrans %}
<p>{% trans "You are logged in as:" %}</p>
<ul>
{% for identity in request.signon_identities.values %}
<li>
{% with identity.get_provider as provider %}
{% if identity.picture %}
<img class="personpic ml-auto" src="{{identity.picture}}"></img>
{% elif provider.icon %}
<img style="vertical-align: text-top; height: 1em" class="mr-2" src="{{STATIC_URL}}{{provider.icon}}"></img>
{% else %}
<span class="mr-2 fa fa-sign-in"></span>
{% endif %} {% endif %}
{% if identity.profile %}<a href="{{identity.profile}}">{% endif %}
{{provider.label}}:
{{identity.fullname}}{% if identity.username %} &lt;{{identity.username}}&gt;{% endif %}
{% if identity.profile %}</a>{% endif %}
{% endwith %}
</li>
{% endfor %}
</ul>
{% endif %}
{% else %} {% else %}
{% blocktrans %}You are not currently logged in. See the {% blocktrans %}You are not currently logged in. See the
<a href="https://wiki.debian.org/DebianSingleSignOn">Single Sign-On page</a> <a href="https://wiki.debian.org/DebianSingleSignOn">Single Sign-On page</a>
for details.{% endblocktrans %} for details.{% endblocktrans %}
{% endif %} {% endif %}
</div> </div>
</div> </div>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment