admin_log.html 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. {% extends "admin/base_site.html" %}
  2. {% load i18n admin_static %}
  3. {% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/dashboard.css" %}" />{% endblock %}
  4. {% block breadcrumbs %}<div class="breadcrumbs"><a href="/admin/">{% trans 'Home' %}</a>{% if title %} &rsaquo; {{ title }}{% endif %}</div>{% endblock %}
  5. {% block content %}
  6. <div id="content-main">
  7. <div class="module">
  8. {% load log %}
  9. {% if log_user %}
  10. {% get_admin_log 100 as admin_log for_user log_user %}
  11. {% else %}
  12. {% get_admin_log 100 as admin_log %}
  13. {% endif %}
  14. {% if not admin_log %}
  15. <p>{% trans 'None available' %}</p>
  16. {% else %}
  17. <table id="change-history">
  18. <thead>
  19. <tr>
  20. <th scope="col">{% trans 'Date/time' %}</th>
  21. <th scope="col">{% trans 'User' %}</th>
  22. <th>Type</th>
  23. <th>Object</th>
  24. <th scope="col">{% trans 'Action' %}</th>
  25. </tr>
  26. </thead>
  27. <tbody>
  28. {% for entry in admin_log %}
  29. <tr>
  30. <th scope="row">{{ entry.action_time|date:"DATETIME_FORMAT" }}</th>
  31. {% if log_user %}
  32. <td>{{ entry.user.username }}{% if entry.user.get_full_name %} ({{ entry.user.get_full_name }}){% endif %}</td>
  33. {% else %}
  34. <td><a href="{{ entry.user.username }}/">{{ entry.user.username }}</a>{% if entry.user.get_full_name %} ({{ entry.user.get_full_name }}){% endif %}</td>
  35. {% endif %}
  36. <td>
  37. {% if entry.content_type %}
  38. <span>{% filter capfirst %}{% trans entry.content_type.name %}{% endfilter %}</span>
  39. {% else %}
  40. <span>{% trans 'Unknown content' %}</span>
  41. {% endif %}
  42. </td>
  43. <td>
  44. <span class="{% if entry.is_addition %}addlink{% endif %}{% if entry.is_change %}changelink{% endif %}{% if entry.is_deletion %}deletelink{% endif %}"></span>
  45. {% if entry.is_deletion %}
  46. {{ entry.object_repr }}
  47. {% else %}
  48. <a href="{{ entry.get_admin_url }}">{{ entry.object_repr }}</a>
  49. {% endif %}
  50. </td>
  51. <td>{{ entry.change_message }}</td>
  52. </tr>
  53. {% endfor %}
  54. </tbody>
  55. </table>
  56. {% endif %}
  57. </div>
  58. </div>
  59. {% endblock %}