started on history

This commit is contained in:
Kenneth Love 2013-07-18 13:00:14 -07:00
parent 9e4d2ec039
commit 5ed5123836
3 changed files with 19 additions and 1 deletions

View file

@ -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}

View file

@ -0,0 +1,10 @@
{% if actions %}
<ol>
{% for action in actions %}
<li>{{ action.change_message }}</li>
{% endfor %}
</ol>
{% else %}
<p>None available</p>
{% endif %}

View file

@ -12,7 +12,7 @@
<div class="span5">
<h4>{% trans "Recent Actions" %}</h4>
<h5>{% trans "My Actions" %}</h5>
TODO
{% action_history %}
</div>
</div>
{% endblock content %}