|
31 | 31 | <th class="align-middle font-medium px-3 py-2 text-left text-gray-400 text-sm"> |
32 | 32 | {% trans 'Change reason' %} |
33 | 33 | </th> |
| 34 | + |
| 35 | + <th class="align-middle font-medium px-3 py-2 text-left text-gray-400 text-sm"> |
| 36 | + {% trans 'Changes' %} |
| 37 | + </th> |
34 | 38 | </tr> |
35 | 39 | </thead> |
36 | 40 |
|
37 | 41 | <tbody> |
38 | | - {% for action in action_list %} |
| 42 | + {% for record in historical_records %} |
39 | 43 | <tr class="block border mb-3 rounded-md shadow-sm lg:table-row lg:border-none lg:mb-0 lg:shadow-none dark:border-gray-800"> |
40 | 44 | <td class="align-middle flex border-t border-gray-200 font-normal px-3 py-2 text-left text-sm before:flex before:capitalize before:content-[attr(data-label)] before:items-center before:mr-auto before:text-gray-500 first:border-t-0 dark:before:text-gray-400 lg:before:hidden lg:first:border-t lg:py-3 lg:table-cell dark:border-gray-800" data-label="{% trans 'Object' %}"> |
41 | | - <a href="{% url opts|admin_urlname:'simple_history' object.pk action.pk %}"> |
42 | | - {{ action.history_object }} |
| 45 | + <a href="{% url opts|admin_urlname:'simple_history' object.pk record.pk %}"> |
| 46 | + {{ record.history_object }} |
43 | 47 | </a> |
44 | 48 | </td> |
45 | 49 |
|
46 | 50 | {% for column in history_list_display %} |
47 | 51 | <td class="align-middle flex border-t border-gray-200 font-normal px-3 py-2 text-left text-sm before:flex before:capitalize before:content-[attr(data-label)] before:items-center before:mr-auto before:text-gray-500 first:border-t-0 dark:before:text-gray-400 lg:before:hidden lg:first:border-t lg:py-3 lg:table-cell dark:border-gray-800" data-label="{% trans column %}"> |
48 | | - {{ action|getattribute:column }} |
| 52 | + {{ record|getattribute:column }} |
49 | 53 | </th> |
50 | 54 | {% endfor %} |
51 | 55 |
|
52 | 56 | <td class="align-middle flex border-t border-gray-200 font-normal px-3 py-2 text-left text-sm before:flex before:capitalize before:content-[attr(data-label)] before:items-center before:mr-auto before:text-gray-500 first:border-t-0 dark:before:text-gray-400 lg:before:hidden lg:first:border-t lg:py-3 lg:table-cell dark:border-gray-800" data-label="{% trans 'Date/time' %}"> |
53 | | - {{ action.history_date }} |
| 57 | + {{ record.history_date }} |
54 | 58 | </td> |
55 | 59 |
|
56 | 60 | <td class="align-middle flex border-t border-gray-200 font-normal px-3 py-2 text-left text-sm before:flex before:capitalize before:content-[attr(data-label)] before:items-center before:mr-auto before:text-gray-500 first:border-t-0 dark:before:text-gray-400 lg:before:hidden lg:first:border-t lg:py-3 lg:table-cell dark:border-gray-800" data-label="{% trans 'Comment' %}"> |
57 | | - {{ action.get_history_type_display }} |
| 61 | + {{ record.get_history_type_display }} |
58 | 62 | </td> |
59 | 63 |
|
60 | 64 | <td class="align-middle flex border-t border-gray-200 font-normal px-3 py-2 text-left text-sm before:flex before:capitalize before:content-[attr(data-label)] before:items-center before:mr-auto before:text-gray-500 first:border-t-0 dark:before:text-gray-400 lg:before:hidden lg:first:border-t lg:py-3 lg:table-cell dark:border-gray-800" data-label="{% trans 'Changed by' %}"> |
61 | | - {% if action.history_user %} |
62 | | - {% url admin_user_view action.history_user_id as admin_user_url %} |
| 65 | + {% if record.history_user %} |
| 66 | + {% url admin_user_view record.history_user_id as admin_user_url %} |
63 | 67 |
|
64 | 68 | {% if admin_user_url %} |
65 | | - <a href="{{ admin_user_url }}">{{ action.history_user }}</a> |
| 69 | + <a href="{{ admin_user_url }}">{{ record.history_user }}</a> |
66 | 70 | {% else %} |
67 | | - {{ action.history_user }} |
| 71 | + {{ record.history_user }} |
68 | 72 | {% endif %} |
69 | 73 | {% else %} |
70 | 74 | {% trans "None" %} |
71 | 75 | {% endif %} |
72 | 76 | </td> |
73 | 77 |
|
74 | 78 | <td class="align-middle flex border-t border-gray-200 font-normal px-3 py-2 text-left text-sm before:flex before:capitalize before:content-[attr(data-label)] before:items-center before:mr-auto before:text-gray-500 first:border-t-0 dark:before:text-gray-400 lg:before:hidden lg:first:border-t lg:py-3 lg:table-cell dark:border-gray-800" data-label="{% trans 'Change reason' %}"> |
75 | | - {{ action.history_change_reason }} |
| 79 | + {{ record.history_change_reason }} |
| 80 | + </td> |
| 81 | + |
| 82 | + <td class="align-middle flex border-t border-gray-200 font-normal px-3 py-2 text-left text-sm before:flex before:capitalize before:content-[attr(data-label)] before:items-center before:mr-auto before:text-gray-500 first:border-t-0 dark:before:text-gray-400 lg:before:hidden lg:first:border-t lg:py-3 lg:table-cell dark:border-gray-800" data-label="{% trans 'Changes' %}"> |
| 83 | + {% block history_delta_changes %} |
| 84 | + {% if record.history_delta_changes %} |
| 85 | + <ul> |
| 86 | + {% for change in record.history_delta_changes %} |
| 87 | + <li class="flex flex-row gap-2"> |
| 88 | + <strong class="font-medium text-gray-700 dark:text-gray-200"> |
| 89 | + {{ change.field }}: |
| 90 | + </strong> |
| 91 | + |
| 92 | + <div class="flex flex-row items-center gap-2"> |
| 93 | + {% if change.old %} |
| 94 | + <span> |
| 95 | + {{ change.old }} |
| 96 | + </span> |
| 97 | + {% endif %} |
| 98 | + |
| 99 | + {% if change.old and change.new %} |
| 100 | + <span class="align-text-top material-symbols-outlined md-18 text-gray-300 group-hover:text-gray-400 dark:text-gray-600">arrow_right_alt</span> |
| 101 | + {% endif %} |
| 102 | + |
| 103 | + {% if change.new %} |
| 104 | + <span> |
| 105 | + {{ change.new }} |
| 106 | + </span> |
| 107 | + {% endif %} |
| 108 | + </div> |
| 109 | + </li> |
| 110 | + {% endfor %} |
| 111 | + </ul> |
| 112 | + {% endif %} |
| 113 | + {% endblock %} |
76 | 114 | </td> |
77 | 115 | </tr> |
78 | 116 | {% endfor %} |
|
0 commit comments