Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Logged in as: XXX - logout" navigation item #875

Closed
simonw opened this issue Jun 29, 2020 · 3 comments
Closed

"Logged in as: XXX - logout" navigation item #875

simonw opened this issue Jun 29, 2020 · 3 comments

Comments

@simonw
Copy link
Owner

simonw commented Jun 29, 2020

Originally posted by @simonw in #840 (comment)

@simonw simonw added this to the Datasette 0.45 milestone Jun 29, 2020
@simonw simonw changed the title "Logged in as: XXX - logout" navigation item. "Logged in as: XXX - logout" navigation item Jun 29, 2020
@simonw
Copy link
Owner Author

simonw commented Jun 29, 2020

I could borrow the implementation for this from datasette-auth-github
https://github.com/simonw/datasette-auth-github/blob/182298b034ecb647971b65057d1d3e7b7fbbb482/datasette_auth_github/templates/base.html

{% extends "default:base.html" %}

{% block extra_head %}
<style type="text/css">
.hd .logout {
    float: right;
    text-align: right;
    padding-left: 1em;
}
</style>
{% endblock %}

{% block nav %}
    {{ super() }}
    {% if auth and auth.username %}
        <p class="logout">
            <strong>{{ auth.username }}</strong> &middot; <a href="/-/logout">Log out</a>
        </p>
    {% endif %}
{% endblock %}

@simonw
Copy link
Owner Author

simonw commented Jun 29, 2020

From #840 (comment)

Another problem: what to display in the "you are logged in as", since we don't dictate an actor design.

I'm going to use a includes template for this that can easily be over-ridden by administrators or by plugins.

The default will look for the first available of the following keys:

* display
* name
* username
* login
* id

simonw added a commit that referenced this issue Jun 29, 2020
@simonw
Copy link
Owner Author

simonw commented Jun 29, 2020

_memory_

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant