index.html 3.43 KB
Newer Older
1
{% extends "admin/base_site.html" %}
2
{% load i18n admin_static %}
3

4
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/dashboard.css" %}" />{% endblock %}
5
6
7
8
9
10
11
12
13
14
15
16

{% block coltype %}colMS{% endblock %}

{% block bodyclass %}dashboard{% endblock %}

{% block breadcrumbs %}{% endblock %}

{% block content %}
<div id="content-main">
    <div class="module">
        <table>
            <caption>Custom Admin Pages</caption>
Dan McGee's avatar
Dan McGee committed
17
            {% if perms.auth.add_user %}
18
19
20
21
            <tr>
                <th scope="row"><a href="/devel/newuser/">Create New User</a></th>
                <td></td><td></td>
            </tr>
Dan McGee's avatar
Dan McGee committed
22
23
24
25
26
27
28
            {% endif %}
            {% if user.is_superuser %}
            <tr>
                <th scope="row"><a href="/devel/admin_log/">Admin Actions Log</a></th>
                <td></td><td></td>
            </tr>
            {% endif %}
29
30
31
32
33
34
        </table>
    </div>

{% if app_list %}
    {% for app in app_list %}
        <div class="module">
Dan McGee's avatar
Dan McGee committed
35
36
        <table summary="{% blocktrans with name=app.name %}Models available in the {{ name }} application.{% endblocktrans %}">
        <caption><a href="{{ app.app_url }}" class="section">{% blocktrans with name=app.name %}{{ name }}{% endblocktrans %}</a></caption>
37
38
        {% for model in app.models %}
            <tr>
39
            {% if model.admin_url %}
40
41
42
43
44
                <th scope="row"><a href="{{ model.admin_url }}">{{ model.name }}</a></th>
            {% else %}
                <th scope="row">{{ model.name }}</th>
            {% endif %}

45
            {% if model.add_url %}
Dan McGee's avatar
Dan McGee committed
46
                <td><a href="{{ model.add_url }}" class="addlink">{% trans 'Add' %}</a></td>
47
48
49
50
            {% else %}
                <td>&nbsp;</td>
            {% endif %}

51
            {% if model.admin_url %}
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
                <td><a href="{{ model.admin_url }}" class="changelink">{% trans 'Change' %}</a></td>
            {% else %}
                <td>&nbsp;</td>
            {% endif %}
            </tr>
        {% endfor %}
        </table>
        </div>
    {% endfor %}
{% else %}
    <p>{% trans "You don't have permission to edit anything." %}</p>
{% endif %}
</div>
{% endblock %}

{% block sidebar %}
<div id="content-related">
    <div class="module" id="recent-actions-module">
        <h2>{% trans 'Recent Actions' %}</h2>
        <h3>{% trans 'My Actions' %}</h3>
            {% load log %}
            {% get_admin_log 10 as admin_log for_user user %}
            {% if not admin_log %}
            <p>{% trans 'None available' %}</p>
            {% else %}
            <ul class="actionlist">
            {% for entry in admin_log %}
            <li class="{% if entry.is_addition %}addlink{% endif %}{% if entry.is_change %}changelink{% endif %}{% if entry.is_deletion %}deletelink{% endif %}">
Dan McGee's avatar
Dan McGee committed
80
                {% if entry.is_deletion or not entry.get_admin_url %}
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
                    {{ entry.object_repr }}
                {% else %}
                    <a href="{{ entry.get_admin_url }}">{{ entry.object_repr }}</a>
                {% endif %}
                <br/>
                {% if entry.content_type %}
                    <span class="mini quiet">{% filter capfirst %}{% trans entry.content_type.name %}{% endfilter %}</span>
                {% else %}
                    <span class="mini quiet">{% trans 'Unknown content' %}</span>
                {% endif %}
            </li>
            {% endfor %}
            </ul>
            {% endif %}
    </div>
</div>
{% endblock %}