diff --git a/dataedit/helper.py b/dataedit/helper.py index 1e883ff18..beb913f53 100644 --- a/dataedit/helper.py +++ b/dataedit/helper.py @@ -4,6 +4,7 @@ """ from dataedit.models import Table +from dataedit.metadata import TEMPLATE_V1_5 ############################################## # Table view related # @@ -54,6 +55,15 @@ def get_readable_table_name(table_obj: Table) -> str: return label +############################################## +# Metadata related # +############################################## + +def order_metadata(metadata: dict) -> dict: + """Brings metadata into consistent order based on TEMPLATE_V1_5""" + ordered_metadata = {key: metadata.get(key) for key in TEMPLATE_V1_5} + return ordered_metadata + ############################################## # Open Peer Review related # ############################################## diff --git a/dataedit/templates/dataedit/dataview.html b/dataedit/templates/dataedit/dataview.html index 00c4f77e1..2c0edadfe 100644 --- a/dataedit/templates/dataedit/dataview.html +++ b/dataedit/templates/dataedit/dataview.html @@ -191,7 +191,7 @@