kopia lustrzana https://github.com/wagtail/wagtail
human_readable_date - update template tag to support tooltip position
rodzic
3a86efaf12
commit
0a977cc54d
|
@ -45,6 +45,7 @@ Changelog
|
|||
* Maintenance: Migrate form submission listing checkbox toggling to the shared `w-bulk` Stimulus implementation (LB (Ben) Johnston)
|
||||
* Maintenance: Allow viewsets to define a common set of view kwargs (Matt Westcott)
|
||||
* Maintenance: Migrate the editor unsaved messages popup to be driven by Stimulus using the shared `w-message` controller (LB (Ben) Johnston, Hussain Saherwala)
|
||||
* Maintenance: Add support for tooltip position in `human_readable_date` tooltip (Rohit Sharma)
|
||||
|
||||
|
||||
5.1.2 (xx.xx.20xx) - IN DEVELOPMENT
|
||||
|
|
|
@ -730,6 +730,7 @@
|
|||
* Hatim Makki Hoho
|
||||
* Hussain Saherwala
|
||||
* Faishal Manzar
|
||||
* Rohit Sharma
|
||||
|
||||
## Translators
|
||||
|
||||
|
|
|
@ -64,6 +64,7 @@ depth: 1
|
|||
* Migrate form submission listing checkbox toggling to the shared `w-bulk` Stimulus implementation (LB (Ben) Johnston)
|
||||
* Allow viewsets to define a common set of view kwargs (Matt Westcott)
|
||||
* Migrate the editor unsaved messages popup to be driven by Stimulus using the shared `w-message` controller (LB (Ben) Johnston, Hussain Saherwala)
|
||||
* Add support for tooltip position in `human_readable_date` tooltip (Rohit Sharma)
|
||||
|
||||
|
||||
## Upgrade considerations - changes affecting all projects
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{% load wagtailadmin_tags i18n %}
|
||||
|
||||
<button type="button" class="w-human-readable-date" data-tippy-content="{{ date|date:"DATETIME_FORMAT" }}">
|
||||
<button type="button" class="w-human-readable-date" data-tippy-content="{{ date|date:"DATETIME_FORMAT" }}" data-tippy-placement="{{ position }}">
|
||||
<time class="w-human-readable-date__date" datetime="{{ date|date:"c" }}">
|
||||
{{ date|timesince_simple|capfirst }}
|
||||
</time>
|
||||
|
|
|
@ -1196,8 +1196,9 @@ def workflow_status_with_date(workflow_state):
|
|||
|
||||
|
||||
@register.inclusion_tag("wagtailadmin/shared/human_readable_date.html")
|
||||
def human_readable_date(date, description=None):
|
||||
def human_readable_date(date, description=None, position="top"):
|
||||
return {
|
||||
"date": date,
|
||||
"description": description,
|
||||
"position": position,
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue