Changeset 0f53aae


Ignore:
Timestamp:
Apr 17, 2010, 7:58:23 PM (15 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master, client
Children:
09b7c26
Parents:
ea76b01
git-author:
Alex Dehnert <adehnert@…> (04/17/10 19:57:49)
git-committer:
Alex Dehnert <adehnert@…> (04/17/10 19:58:23)
Message:

Generally improve user account display

When testing, it can be painful to figure out why you can't access pages
because there's no good way to log out or see what account you're using.
This tries to change that, in a way that can also be vaguely useful for
normal users.

Location:
remit
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • remit/media/style/default.css

    r7e8566f r0f53aae  
    4242}
    4343
     44#content > .curuser
     45{
     46    margin-top: -1em;
     47    margin-right: -1em;
     48    float: right;
     49    background-color: #99f;
     50    border: 1px solid #888;
     51
     52    text-align: right;
     53    line-height: 100%;
     54}
     55#content > .curuser p
     56{
     57    margin: 0.2em;
     58}
     59
    4460/* Reset some stuff */
    4561h1, h2, h3, th
  • remit/media/style/style.css

    red4ccc7 r0f53aae  
    8989    font-weight: normal;
    9090}
     91
     92span.username
     93{
     94    font-family: "Courier", monospace;
     95}
  • remit/remit_templates/base.html

    rea76b01 r0f53aae  
    2121    </ul>
    2222    <div id='content'>
     23        {% if user.is_authenticated %}
     24        <div class='curuser'>
     25            <div class='spacer'></div>
     26            {% if user.first_name and user.last_name %}
     27            <p>Welcome, {{user.first_name}} {{user.last_name}} &lt;<span class='username'>{{user.username}}</span>&gt;.</p>
     28            {% else %}
     29            <p>Welcome, <span class='username'>{{user.username}}</span>.</p>
     30            {% endif %}
     31            <p><a href='{% url logout %}'>Logout</a></p>
     32        </div>
     33        {% endif %}
    2334{% block content %}{% endblock %}
    2435    </div>
  • remit/remit_templates/index.html

    rea76b01 r0f53aae  
    1111
    1212<ul>
     13    {% if user.is_anonymous %}
     14    <li><a href='{% url login %}'>Login</a></li>
     15    {% endif %}
    1316    <li><a href="{% url request_reimbursement %}">Request reimbursement</a></li>
    1417    {% if perms.vouchers.can_list %}
     
    1821    <li><a href="{% url reporting %}">Reporting</a></li>
    1922    {% endif %}
     23    {% if user.is_authenticated %}
     24    <li><a href='{% url logout %}'>Logout</a></li>
     25    {% endif %}
    2026</ul>
    2127
  • remit/settings.py

    r3111c8a r0f53aae  
    6161ADMIN_MEDIA_PREFIX = SITE_WEB_PATH + '/media/admin/'
    6262
    63 LOGIN_REDIRECT_URL  = SITE_WEB_PATH + '/accounts/profile'
     63LOGIN_REDIRECT_URL  = SITE_WEB_PATH + '/'
    6464LOGIN_URL  = SITE_WEB_PATH + '/accounts/login'
    6565LOGOUT_URL = SITE_WEB_PATH + '/accounts/logout'
  • remit/urls.py

    r3a0c51b r0f53aae  
    11from django.conf.urls.defaults import *
    2 from django.contrib.auth.views import login
     2from django.contrib.auth.views import login, logout
    33
    44import settings
     
    2323    # Uncomment the next line to enable the admin:
    2424    (r'^admin/(.*)', admin.site.root),
    25     (r'^accounts/login/', login, ),
     25    url(r'^accounts/login/',  login,  name='login', ),
     26    url(r'^accounts/logout/', logout, name='logout', ),
    2627)
    2728
Note: See TracChangeset for help on using the changeset viewer.