I've changed my 'admin/base.html' template to show a quick menu of
apps/models.

It's easier to switch between pages without having to go back to the
admin home.

It works on Firefox and maybe on other non-IE browsers, it uses only
CSS but shouldn't be hard to use some Javascript to make it work on IE
6.

It just requires some style inside the <head></head>, and some
template code after the '<!-- END Header -->' comment.

Here it goes if someone is interested...

- - - - - STYLE - - - - -

<style type="text/css">
#quick_menu {
    float: left;
    width: 100%;
    background: #EDF3FE;
    margin-bottom: 5px;
    border-bottom: 1px solid #ccc;
}
    #quick_menu ul {
        float: left;
        margin: 0;
        padding: 0;
        background: #EDF3FE;
    }
        #quick_menu li {
            float: left;
            list-style: none;
            margin: 0;
            padding: 2px 5px;
            position: relative;
            font-weight: bold;
            color: #417690;
            border-right: 1px solid #ccc;
        }
        #quick_menu li ul {
            position: absolute;
            left: 0;
            top: 18px;
            display: none;
            z-index: 1;
            border: 1px solid #ccc;
            border-top: none;
        }
            #quick_menu li ul li {
                border: none;
                position: relative;
            }
                #quick_menu li ul li a {
                    display: block;
                    padding: 2px 5px;
                    margin: -2px -5px;
                    font-weight: normal;
                    width: 120px;
                    border-top: 1px solid #ccc;
                }
                #quick_menu li ul li a:hover {
                    display: block;
                    background: #fff;
                }
                #quick_menu li ul li a.add {
                    position: absolute;
                    float: right;
                    top: 0;
                    left: 130px;
                    width: auto;
                    border: 1px solid #ccc;
                    margin: 0;
                    background: #EDF3FE;
                }
        #quick_menu li:hover {
            background: #fff;
            cursor: pointer;
        }
            #quick_menu li:hover ul {
                display: block;
            }
</style>

- - - - - MENU - - - - -

    {% load adminapplist %}
    {% get_admin_app_list as app_list %}
    {% if app_list %}
        <div id="quick_menu">
            <ul>
                {% for app in app_list %}
                    <li>
                        {% if app.models.0.perms.change %}<a href="/
admin/{{ app.models.0.admin_url }}">{{ app.name }}</a>{% else %}
{{ app.name }}{% endif %}
                        <ul>
                        {% for model in app.models %}
                            {% if model.perms.change %}<li><a href="/
admin/{{ model.admin_url }}">{{ model.name|escape }}</a>{% if
model.perms.add %}<a href="/admin/{{ model.admin_url }}add/"
class="add">+</a>{% endif %}</li>{% endif %}
                        {% endfor %}
                        </ul>
                    </li>
                {% endfor %}
            </ul>
        </div>
    {% endif %}


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to