From a407ecd92a53b48f5be1fb2e1472230efc2dc3e9 Mon Sep 17 00:00:00 2001 From: Renaud Michotte Date: Fri, 6 Nov 2020 10:18:00 +0100 Subject: [PATCH] document: Hide time for due date In the public interface, when an item is "on loan" the due date displayed contains the time. The time information isn't necessary to be displayed. The birth date should not be displayed in the patron profile view in the public interface. Closes rero/rero-ils#1395 Closes rero/rero-ils#1386 Co-Authored-by: Renaud Michotte --- rero_ils/modules/items/api/circulation.py | 3 ++- rero_ils/modules/items/views.py | 2 +- .../templates/rero_ils/_patron_profile_head.html | 11 +---------- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/rero_ils/modules/items/api/circulation.py b/rero_ils/modules/items/api/circulation.py index ec12f05e9f..180d65e474 100644 --- a/rero_ils/modules/items/api/circulation.py +++ b/rero_ils/modules/items/api/circulation.py @@ -1230,7 +1230,7 @@ def available(self): """Get availability for item.""" return self.item_has_active_loan_or_request() == 0 - def get_item_end_date(self, format='short'): + def get_item_end_date(self, format='short', time_format='medium'): """Get item due date for a given item.""" loan = get_loan_for_item(item_pid_to_object(self.pid)) if loan: @@ -1238,6 +1238,7 @@ def get_item_end_date(self, format='short'): due_date = format_date_filter( end_date, date_format=format, + time_format=time_format, locale=current_i18n.locale.language, ) return due_date diff --git a/rero_ils/modules/items/views.py b/rero_ils/modules/items/views.py index 7156ace061..904c94fd00 100644 --- a/rero_ils/modules/items/views.py +++ b/rero_ils/modules/items/views.py @@ -132,7 +132,7 @@ def item_availability_text(item): else: text = '' if item.status == ItemStatus.ON_LOAN: - due_date = item.get_item_end_date(format='short') + due_date = item.get_item_end_date(format='short', time_format=None) text = '{msg} {date}'.format( msg=_('due until'), date=due_date) diff --git a/rero_ils/modules/patrons/templates/rero_ils/_patron_profile_head.html b/rero_ils/modules/patrons/templates/rero_ils/_patron_profile_head.html index d79d518d4d..3669f0336f 100644 --- a/rero_ils/modules/patrons/templates/rero_ils/_patron_profile_head.html +++ b/rero_ils/modules/patrons/templates/rero_ils/_patron_profile_head.html @@ -20,16 +20,7 @@
-
+

{{ record.first_name }} {{ record.last_name }}

- {% if record.birth_date %} -

- {{ _('Date of birth') }}: {{ record.birth_date | format_date( - date_format='medium', - time_format=None, - locale=current_i18n.locale.language - )}} -

- {% endif %}