Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix widget view mode #66

Merged
merged 3 commits into from
Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Changelog
1.4.0 (unreleased)
------------------

- #66 Fix widget view mode
- #65 Fix cannot create partitions from samples with Patient assigned
- #64 Fix samples without patient middle name
- #63 Fix Traceback in patient's samples view when name has special characters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,37 @@
<body>

<metal:view_macro define-macro="view">
<tal:values define="age python:field.get_formatted_age(here);
birth_date python:field.get_formatted_birth_date(here);">
<span metal:define-slot="inside"
tal:define="value accessor;
dob_estimated python:widget.get_dob_estimated(context);
current_age python:widget.get_current_age(value);
years python:current_age.get('years') or '';
months python:current_age.get('months') or '';
days python:current_age.get('days') or '';
value python: widget.ulocalized_time(value, context=context, request=request) if value else ''">

<!-- Date of birth -->
<span tal:condition="python:not dob_estimated">
<span tal:replace="value"></span>
</span>

<!-- Age (estimated) -->
<span class="" tal:condition="python:dob_estimated">
<span tal:condition="python:years">
<span tal:replace="years"></span>
<span class="text-secondary" i18n:translate="patient_dob_years">Years</span>
</span>
<span tal:condition="python:months">
<span tal:replace="months"></span>
<span class="text-secondary" i18n:translate="patient_dob_months">Months</span>
</span>
<span tal:condition="python:days">
<span tal:replace="days"></span>
<span class="text-secondary" i18n:translate="patient_dob_days">Days</span>
</span>
</span>
</span>

<span tal:content="age"/>
<tal:dob condition="birth_date">
(<span tal:content="birth_date"/>)
</tal:dob>

</tal:values>
</metal:view_macro>

<metal:edit_macro define-macro="edit">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<body>

<metal:view_macro define-macro="view">
<tal:values define="value python:field.getAccessor(here)();
<tal:values define="value python:field.getAccessor(here)() or {};
firstname python:value.get('firstname', '');
middlename python:value.get('middlename', '');
lastname python:value.get('lastname', '');
Expand Down