Hide work data fields when they have no value

Fixes

Fixes microtask T406994

Description

Replace how empty field values in the Work data section are displayed inside work.html template.

If no value is found, it will hide the field altogether instead of having a value of “Unknown”.

Additionally, if none of the fields have value, it will display a text stating “No data available.”

Checklist

  • add an if statement to check if there are any values available for work_publication_date , work_country and work_language
  • add an if statement to each detail-item to only display if a value is available (instead of showing ‘Unknown’).
  • if there is at least 1 value available, it will show this field
  • if none of the value is known, show ‘No data available.’
  • have the if statements wrapping around div.detail-item to avoid rendering an empty div (and avoid unnecessary spacing)

Screenshots

Before After
235d84c2-cc93-4fc7-a53b-a40ebef78481.jpeg af91b3d4-99ef-4e89-b28d-9712a6ad40e0.jpeg
588fd88b-12df-4eff-9c71-4de88f23c53b.jpeg 5137bb01-e7fb-49ef-b5ed-3ee71411e183.jpeg
Edited by Miiswom

Merge request reports

Loading