mirror of
https://github.com/jazzband/django-admin2.git
synced 2026-04-29 02:54:47 +00:00
started on history
This commit is contained in:
parent
9e4d2ec039
commit
5ed5123836
3 changed files with 19 additions and 1 deletions
|
|
@ -136,3 +136,11 @@ def render(context, model_instance, attribute_name):
|
|||
# It must be a method instead.
|
||||
field = None
|
||||
return renderer(value, field)
|
||||
|
||||
|
||||
@register.inclusion_tag('djadmin2theme_default/includes/history.html',
|
||||
takes_context=True)
|
||||
def action_history(context):
|
||||
from django.contrib.admin.models import LogEntry
|
||||
actions = LogEntry.objects.filter(user__pk=context['user'].pk)
|
||||
return {'actions': actions}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
{% if actions %}
|
||||
<ol>
|
||||
{% for action in actions %}
|
||||
<li>{{ action.change_message }}</li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
{% else %}
|
||||
<p>None available</p>
|
||||
{% endif %}
|
||||
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
<div class="span5">
|
||||
<h4>{% trans "Recent Actions" %}</h4>
|
||||
<h5>{% trans "My Actions" %}</h5>
|
||||
TODO
|
||||
{% action_history %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
|
|
|||
Loading…
Reference in a new issue