Template structure#

The DRT uses Django templating. Generic templates are defined in lib-cove-web and include various blocks which can be overridden here if necessary.

In lib-cove-web you will find:

  • The base template for the landing page.

  • Include templates for data input and tables for the results.

  • Various error pages.

  • Terms and conditions, usage statistics, analytics.

In cove-ocds (this repo) you will find specializations of these, either some blocks or entire templates.

  • The base, input, and some of the result table templates customize text and appearance for the OCDS DRT.

  • explore_base, explore_record and explore_release modify the base explore template depending on the data input.

  • Additional template partials which are included in other templates.

Translating template strings#

For more about translation in general, see Translations.

Some of the templates include variables for the translation of generic terms so that they can easily be reused. For example, in explore.html (lib-cove-web) you will find:

{% trans 'Converted from Original' as converted %}
{% trans 'Original' as original %}
{% trans 'Excel Spreadsheet (.xlsx)' as xlsx %}
{% trans 'CSV Spreadsheet (.csv)' as csv %}
{% trans 'Excel Spreadsheet (.xlsx) with titles' as xlsx_titles %}
{# Translators: JSON probably does not need a translation: http://www.json.org/ #}
{% trans 'JSON' as JSON %}
{% trans 'XML' as XML %}

Which means that in templates that override or are included in explore.html you can simply use, for example:

<p>{{ xlsx_titles }}</p>