Mercurial > public > sg101
changeset 141:861f7d5f1b23
Rework r149 for #30. Got rid of the custom index. Put my dashboard in the nav-global block instead.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 06 Dec 2009 07:55:48 +0000 |
parents | 91a01b8b5885 |
children | f6904149a233 |
files | gpp/templates/admin/base_site.html gpp/templates/admin/custom_index.html gpp/templates/core/admin_dashboard.html gpp/urls.py |
diffstat | 4 files changed, 27 insertions(+), 77 deletions(-) [+] |
line wrap: on
line diff
--- a/gpp/templates/admin/base_site.html Mon Nov 30 03:20:24 2009 +0000 +++ b/gpp/templates/admin/base_site.html Sun Dec 06 07:55:48 2009 +0000 @@ -1,5 +1,21 @@ {% extends "admin/base.html" %} {% load i18n %} +{% load custom_admin_tags %} + +{% block extrastyle %} +<style type="text/css"> + #dashboard-list { + margin-left: 10px; + padding: 0; + } + #dashboard-list li { + float: left; + list-style: square inside none; + margin-right: 10px; + margin-bottom: 4px; + } +</style> +{% endblock %} {% block title %}{{ title }} | {% trans 'SG101 Site Admin' %}{% endblock %} @@ -7,4 +23,4 @@ <h1 id="site-name">{% trans 'SurfGuitar101.com Site Administration' %}</h1> {% endblock %} -{% block nav-global %}{% endblock %} +{% block nav-global %}{% admin_dashboard %}{% endblock %}
--- a/gpp/templates/admin/custom_index.html Mon Nov 30 03:20:24 2009 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -{% extends "admin/index.html" %} -{% load i18n %} -{% load custom_admin_tags %} -{% block content %} -<div id="content-main"> -{% admin_dashboard %} -{% if app_list %} - {% for app in app_list %} - <div class="module"> - <table summary="{% blocktrans with app.name as name %}Models available in the {{ name }} application.{% endblocktrans %}"> - <caption><a href="{{ app.app_url }}" class="section">{% blocktrans with app.name as name %}{{ name }}{% endblocktrans %}</a></caption> - {% for model in app.models %} - <tr> - {% if model.perms.change %} - <th scope="row"><a href="{{ model.admin_url }}">{{ model.name }}</a></th> - {% else %} - <th scope="row">{{ model.name }}</th> - {% endif %} - - {% if model.perms.add %} - <td><a href="{{ model.admin_url }}add/" class="addlink">{% trans 'Add' %}</a></td> - {% else %} - <td> </td> - {% endif %} - - {% if model.perms.change %} - <td><a href="{{ model.admin_url }}" class="changelink">{% trans 'Change' %}</a></td> - {% else %} - <td> </td> - {% endif %} - </tr> - {% endfor %} - </table> - </div> - {% endfor %} -{% else %} - <p>{% trans "You don't have permission to edit anything." %}</p> -{% endif %} -</div> -{% endblock %}
--- a/gpp/templates/core/admin_dashboard.html Mon Nov 30 03:20:24 2009 +0000 +++ b/gpp/templates/core/admin_dashboard.html Sun Dec 06 07:55:48 2009 +0000 @@ -1,33 +1,9 @@ -<div class="module"> -<table summary="Admin Dashboard"> - <caption>Admin Dashboard</caption> - <tr> - <th><a href="/admin/forums/flaggedpost/">Flagged Posts</a></th> - <td>{{ flagged_posts }}</td> - </tr> - <tr> - <th><a href="/admin/comments/commentflag/">Flagged Comments</a></th> - <td>{{ flagged_comments }}</td> - </tr> - <tr> - <th><a href="/admin/bio/userprofileflag/">Flagged Profiles</a></th> - <td>{{ flagged_profiles }}</td> - </tr> - <tr> - <th><a href="/admin/gcalendar/event/">Calendar Requests</a></th> - <td>{{ event_requests }}</td> - </tr> - <tr> - <th><a href="/admin/news/pendingstory/">New Stories</a></th> - <td>{{ new_stories }}</td> - </tr> - <tr> - <th><a href="/admin/downloads/download/">New Downloads</a></th> - <td>{{ new_downloads }}</td> - </tr> - <tr> - <th><a href="/admin/weblinks/link/">New Links</a></th> - <td>{{ new_links }}</td> - </tr> -</table> -</div> +<ul id="dashboard-list"> + <li><a href="/admin/forums/flaggedpost/">Flagged Posts</a>: {{ flagged_posts }}</li> + <li><a href="/admin/comments/commentflag/">Flagged Comments</a>: {{ flagged_comments }}</li> + <li><a href="/admin/bio/userprofileflag/">Flagged Profiles</a>: {{ flagged_profiles }}</li> + <li><a href="/admin/gcalendar/event/">Calendar Requests</a>: {{ event_requests }}</li> + <li><a href="/admin/news/pendingstory/">New Stories</a>: {{ new_stories }}</li> + <li><a href="/admin/downloads/download/">New Downloads</a>: {{ new_downloads }}</li> + <li><a href="/admin/weblinks/link/">New Links</a>: {{ new_links }}</li> +</ul>
--- a/gpp/urls.py Mon Nov 30 03:20:24 2009 +0000 +++ b/gpp/urls.py Sun Dec 06 07:55:48 2009 +0000 @@ -3,9 +3,7 @@ from django.contrib import admin from news.feeds import LatestNewsFeed -# Use the default admin site, but tell it to use a custom -# index template: -admin.site.index_template = 'admin/custom_index.html' + admin.autodiscover() feeds = {