0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00

Human readable dates and i18n

This commit is contained in:
Karl Hobley 2020-02-19 11:28:32 +00:00 committed by Matt Westcott
parent 3b085b9f89
commit dad2d7edf5
2 changed files with 9 additions and 4 deletions

View File

@ -70,8 +70,9 @@
{% for task_state in task_states %}
<td>
{% if task_state.status == 'approved' or task_state.status == 'rejected' %}
{# FIXME: i18n #}
<div class="status-tag primary">{{ task_state.get_status_display }}</div> at <b>{{ task_state.finished_at }}</b>
{% blocktrans with action='<div class="status-tag primary">'|add:task_state.get_status_display|add:'</div>'|safe at=task_state.finished_at %}
{{ action }} at <b>{{ at }}</b>
{% endblocktrans %}
{% else %}
<div class="status-tag primary">{{ task_state.get_status_display }}</div>
{% endif %}

View File

@ -42,8 +42,12 @@
</span>
{% endfor %}
</td>
<td>{{ workflow_state.requested_by }}</td>
<td>{{ workflow_state.created_at }}</td>
<td>{{ workflow_state.requested_by.get_full_name|default:workflow_state.requested_by.get_username }}</td>
<td>
<div class="human-readable-date" title="{{ workflow_state.created_at|date:"d M Y H:i" }}">
{% blocktrans with time_period=workflow_state.created_at|timesince %}{{ time_period }} ago{% endblocktrans %}
</div>
</td>
</tr>
{% endfor %}
{% else %}