<style type="text/css">
body {
    padding-top: 35px;
}
#login_as {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: #000;
    font-size: 12px;
    height: 35px;
    line-height: 34px;
    color: #fff;
    margin: 0;
    padding: 3px 0;
}
#login_as * {
    margin: 0;
    padding: 0;
    font-size: 12px;
    font-family: arial, helvetica, sans-serif;
}
#login_as form {
    display: block;
    text-align: center;
}
#login_as form input[type=text],
#login_as form input[type=submit],
#login_as form a {
    border: 1px solid #555;
    color: #fff;
    padding: 0 5px;
    text-transform: lowercase;
    border-radius: 0;
}
#login_as form input[type=text] {
    border-radius: 0;
    border: 0;
    background: #222;
    margin: 0 3px;
    width: 120px;
}
#login_as form input[type=submit],
#login_as form a {
    font-size: 11px;
    padding: 0 8px;
    height: auto;
    line-height: 22px;
    display: inline-block;
    vertical-align: middle;
    text-align: center;
    border: 1px solid #444;
    border-radius: 3px;
    text-shadow: -1px -1px 0 rgba(0,0,0,0.3);
    background-color: #111;
    color: #fff;
    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #333), color-stop(100%, #111));
    background-image: -webkit-linear-gradient(top, #333, #111);
    background-image: -moz-linear-gradient(top, #333, #111);
    background-image: -ms-linear-gradient(top, #333, #111);
    background-image: -o-linear-gradient(top, #333, #111);
    background-image: linear-gradient(top, #333, #111);
    filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#333, endColorstr=#111);
}
#login_as form input[type=submit] {
    line-height: 22px;
}
#login_as form a {
    font-weight: bold;
}
</style>

<menu id="login_as">
    <form method="POST">
        <strong>{{ request.actual_user.username }}</strong> is logged in as: <input type="text" name="login_as" value="{{ request.user.username }}"/> <input type="submit" value="Go"/> {% if request.actual_user.username != request.user.username %}<input type="submit" onclick="this.form['login_as'].value = ''" value="Logout"/>{% endif %}
    </form>
</menu>
