Skip to content

Commit 8495a17

Browse files
committed
add object_history.html
1 parent ff67600 commit 8495a17

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{% extends "admin/base_site.html" %}
2+
{% load i18n admin_urls admin_static %}
3+
4+
{% block extrastyle %}
5+
{{ block.super }}
6+
<link rel="stylesheet" href="{% static "admin/plugins/datatables/dataTables.bootstrap.css" %}">
7+
{% endblock %}
8+
9+
{% block breadcrumbs %}
10+
<ol class="breadcrumb">
11+
<li><a href="{% url 'admin:index' %}"><i class="fa fa-dashboard"></i> {% trans 'Home' %}</a></li>
12+
<li><a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a></li>
13+
<li><a href="{% url opts|admin_urlname:'changelist' %}">{{ module_name }}</a></li>
14+
<li><a href="{% url opts|admin_urlname:'change' object.pk|admin_urlquote %}">{{ object|truncatewords:"18" }}</a></li>
15+
<li class="active">{% trans 'History' %}</li>
16+
</ol>
17+
{% endblock %}
18+
19+
{% block content_title %} {% trans 'History' %} {% endblock %}
20+
21+
{% block content %}
22+
23+
<div class="row">
24+
<div class="col-md-12">
25+
<div class="box box-primary">
26+
<div class="box-header with-border">
27+
<h4 class="box-title">
28+
{% trans 'History' %}
29+
</h4>
30+
</div>
31+
32+
<div class="box-body">
33+
<div id="content-main">
34+
<div class="module">
35+
{% if action_list %}
36+
<table id="change-history" class="table table-bordered table-hover dataTable">
37+
<thead>
38+
<tr>
39+
<th scope="col">{% trans 'Date/time' %}</th>
40+
<th scope="col">{% trans 'User' %}</th>
41+
<th scope="col">{% trans 'Action' %}</th>
42+
</tr>
43+
</thead>
44+
<tbody>
45+
{% for action in action_list %}
46+
<tr>
47+
<th scope="row">{{ action.action_time|date:"DATETIME_FORMAT" }}</th>
48+
<td>{{ action.user.get_username }}{% if action.user.get_full_name %} ({{ action.user.get_full_name }}){% endif %}</td>
49+
<td>{{ action.get_change_message }}</td>
50+
</tr>
51+
{% endfor %}
52+
</tbody>
53+
</table>
54+
{% else %}
55+
<p>{% trans "This object doesn't have a change history. It probably wasn't added via this admin site." %}</p>
56+
{% endif %}
57+
</div>
58+
</div>
59+
</div>
60+
</div>
61+
</div>
62+
</div>
63+
64+
{% endblock %}

0 commit comments

Comments
 (0)