From 3e20297457db836187a3993e77337e35c48b756a Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Sat, 19 Oct 2024 00:53:26 -0400 Subject: [PATCH 01/37] chore(refactor): Eliminate cove_ocds.lib package. first_render is not used (piwik). --- cove_ocds/lib/__init__.py | 0 cove_ocds/lib/exceptions.py | 94 ------ cove_ocds/lib/ocds_show_extra.py | 41 --- cove_ocds/lib/views.py | 25 -- cove_ocds/locale/en/LC_MESSAGES/django.po | 155 +++++----- cove_ocds/locale/es/LC_MESSAGES/django.po | 213 +++++++------ cove_ocds/util.py | 203 ++++++++++++ cove_ocds/views.py | 356 ++++++++-------------- docs/architecture.rst | 2 - tests/test_functional.py | 4 +- tests/test_general.py | 1 + 11 files changed, 534 insertions(+), 560 deletions(-) delete mode 100644 cove_ocds/lib/__init__.py delete mode 100644 cove_ocds/lib/exceptions.py delete mode 100644 cove_ocds/lib/ocds_show_extra.py delete mode 100644 cove_ocds/lib/views.py create mode 100644 cove_ocds/util.py diff --git a/cove_ocds/lib/__init__.py b/cove_ocds/lib/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/cove_ocds/lib/exceptions.py b/cove_ocds/lib/exceptions.py deleted file mode 100644 index c174861f..00000000 --- a/cove_ocds/lib/exceptions.py +++ /dev/null @@ -1,94 +0,0 @@ -from django.utils.functional import lazy -from django.utils.html import format_html, mark_safe -from django.utils.translation import gettext as _ -from libcove.lib.exceptions import CoveInputDataError - -mark_safe_lazy = lazy(mark_safe, str) - - -def raise_invalid_version_argument(version): - raise CoveInputDataError( - context={ - "sub_title": _("Unrecognised version of the schema"), - "link": "index", - "link_text": _("Try Again"), - "msg": _( - format_html( - "We think you tried to run your data against an unrecognised version of " - 'the schema.\n\n Error message: {} is ' - "not a recognised choice for the schema version", - version, - ) - ), - "error": _("%(version)s is not a known schema version") % {"version": version}, - } - ) - - -def raise_invalid_version_data_with_patch(version): - raise CoveInputDataError( - context={ - "sub_title": _("Version format does not comply with the schema"), - "link": "index", - "link_text": _("Try Again"), - "msg": _( - format_html( - 'The value for the "version" field in your data follows the ' - "major.minor.patch pattern but according to the schema the patch digit " - 'shouldn\'t be included (e.g. "1.1.0" should appear as "1.1" in ' - "your data as this tool always uses the latest patch release for a major.minor " - 'version).\n\nPlease get rid of the patch digit and try again.\n\n Error message: ' - " {} format does not comply with the schema", - version, - ) - ), - "error": _("%(version)s is not a known schema version") % {"version": version}, - } - ) - - -def raise_json_deref_error(error): - raise CoveInputDataError( - context={ - "sub_title": _("JSON reference error"), - "link": "index", - "link_text": _("Try Again"), - "msg": _( - format_html( - "We have detected a JSON reference error in the schema. This may be " - " due to some extension trying to resolve non-existing references. " - '\n\n Error message: {}", - error, - ) - ), - "error": _("%(error)s") % {"error": error}, - } - ) - - -def raise_missing_package_error(): - raise CoveInputDataError( - context={ - "sub_title": _("Missing OCDS package"), - "link": "index", - "link_text": _("Try Again"), - "msg": mark_safe_lazy( - _( - "We could not detect a package structure at the top-level of your data. " - 'OCDS releases and records should be published within a release ' - 'package or record package to provide important meta-' - 'data. For more information, please refer to the ' - "Releases and Records section in the OCDS documentation.\n\n ' - "Error message: Missing OCDS package" - ) - ), - "error": _("Missing OCDS package"), - } - ) diff --git a/cove_ocds/lib/ocds_show_extra.py b/cove_ocds/lib/ocds_show_extra.py deleted file mode 100644 index 9f6ac30b..00000000 --- a/cove_ocds/lib/ocds_show_extra.py +++ /dev/null @@ -1,41 +0,0 @@ -from libcove.lib.common import schema_dict_fields_generator - - -def add_extra_fields(data, deref_release_schema): - all_schema_fields = set(schema_dict_fields_generator(deref_release_schema)) - - if "releases" in data: - for release in data.get("releases", []): - if not isinstance(release, dict): - return - add_extra_fields_to_obj(release, all_schema_fields, "") - elif "records" in data: - for record in data.get("records", []): - if not isinstance(record, dict): - return - for release in record.get("releases", []): - add_extra_fields_to_obj(release, all_schema_fields, "") - - -def add_extra_fields_to_obj(obj, all_schema_fields, current_path): - if not isinstance(obj, dict): - return - obj["__extra"] = {} - - for key, value in list(obj.items()): - if key == "__extra": - continue - - new_path = f"{current_path}/{key}" - if new_path not in all_schema_fields: - obj["__extra"][key] = value - continue - - if isinstance(value, list): - for item in value: - add_extra_fields_to_obj(item, all_schema_fields, new_path) - elif isinstance(value, dict): - add_extra_fields_to_obj(value, all_schema_fields, new_path) - - if not obj["__extra"]: - obj.pop("__extra") diff --git a/cove_ocds/lib/views.py b/cove_ocds/lib/views.py deleted file mode 100644 index 7e90b51b..00000000 --- a/cove_ocds/lib/views.py +++ /dev/null @@ -1,25 +0,0 @@ -import json -from collections import defaultdict - - -def group_validation_errors(validation_errors): - validation_errors_grouped = defaultdict(list) - for error_json, values in validation_errors: - error = json.loads(error_json) - if error["message_type"] == "required": - validation_errors_grouped["required"].append((error_json, values)) - elif error["message_type"] in { - "format", - "pattern", - "number", - "string", - "date-time", - "uri", - "object", - "integer", - "array", - }: - validation_errors_grouped["format"].append((error_json, values)) - else: - validation_errors_grouped["other"].append((error_json, values)) - return validation_errors_grouped diff --git a/cove_ocds/locale/en/LC_MESSAGES/django.po b/cove_ocds/locale/en/LC_MESSAGES/django.po index a358d352..5aa80f75 100644 --- a/cove_ocds/locale/en/LC_MESSAGES/django.po +++ b/cove_ocds/locale/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-10 00:56+0000\n" +"POT-Creation-Date: 2024-10-19 04:51+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,54 +17,6 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: cove_ocds/lib/exceptions.py:12 -msgid "Unrecognised version of the schema" -msgstr "" - -#: cove_ocds/lib/exceptions.py:14 cove_ocds/lib/exceptions.py:34 -#: cove_ocds/lib/exceptions.py:57 cove_ocds/lib/exceptions.py:77 -#: cove_ocds/views.py:90 cove_ocds/views.py:108 cove_ocds/views.py:126 -#: cove_ocds/views.py:237 -msgid "Try Again" -msgstr "" - -#: cove_ocds/lib/exceptions.py:24 cove_ocds/lib/exceptions.py:47 -#, python-format -msgid "%(version)s is not a known schema version" -msgstr "" - -#: cove_ocds/lib/exceptions.py:32 -msgid "Version format does not comply with the schema" -msgstr "" - -#: cove_ocds/lib/exceptions.py:55 -msgid "JSON reference error" -msgstr "" - -#: cove_ocds/lib/exceptions.py:67 -#, python-format -msgid "%(error)s" -msgstr "" - -#: cove_ocds/lib/exceptions.py:75 cove_ocds/lib/exceptions.py:92 -msgid "Missing OCDS package" -msgstr "" - -#: cove_ocds/lib/exceptions.py:80 -msgid "" -"We could not detect a package structure at the top-level of your data. OCDS " -"releases and records should be published within a release package or record package to provide important meta-data. For " -"more information, please refer to the Releases and " -"Records section in the OCDS documentation.\n" -"\n" -" Error message: Missing OCDS package" -msgstr "" - #: cove_ocds/templates/cove_ocds/additional_checks_table.html:7 msgid "Check Description" msgstr "" @@ -1403,30 +1355,18 @@ msgid "" "reference/#date\">dates in OCDS." msgstr "" -#: cove_ocds/views.py:50 -msgid "Sorry, the page you are looking for is not available" -msgstr "" - -#: cove_ocds/views.py:52 -msgid "Go to Home page" -msgstr "" - -#: cove_ocds/views.py:55 -#, python-format -msgid "" -"The data you were hoping to explore no longer exists.\n" -"\n" -"This is because all data supplied to this website is automatically deleted " -"after %s days, and therefore the analysis of that data is no longer " -"available." +#: cove_ocds/util.py:20 cove_ocds/util.py:39 cove_ocds/util.py:57 +#: cove_ocds/views.py:112 +msgid "Sorry, we can't process that data" msgstr "" -#: cove_ocds/views.py:88 cove_ocds/views.py:106 cove_ocds/views.py:124 -#: cove_ocds/views.py:235 -msgid "Sorry, we can't process that data" +#: cove_ocds/util.py:23 cove_ocds/util.py:42 cove_ocds/util.py:59 +#: cove_ocds/util.py:85 cove_ocds/util.py:108 cove_ocds/util.py:127 +#: cove_ocds/views.py:114 cove_ocds/views.py:149 +msgid "Try Again" msgstr "" -#: cove_ocds/views.py:93 +#: cove_ocds/util.py:26 msgid "" "The file that you uploaded doesn't appear to be well formed JSON. OCDS JSON " "follows the I-JSON format, which requires UTF-8 encoding. Ensure that your " @@ -1436,7 +1376,7 @@ msgid "" "span> Error message: {}" msgstr "" -#: cove_ocds/views.py:111 +#: cove_ocds/util.py:45 msgid "" "We think you tried to upload a JSON file, but it is not well formed JSON.\n" "\n" @@ -1444,13 +1384,75 @@ msgid "" "span> Error message: {}" msgstr "" -#: cove_ocds/views.py:127 +#: cove_ocds/util.py:60 msgid "" "OCDS JSON should have an object as the top level, the JSON you supplied does " "not." msgstr "" -#: cove_ocds/views.py:240 +#: cove_ocds/util.py:82 cove_ocds/util.py:83 +msgid "Missing OCDS package" +msgstr "" + +#: cove_ocds/util.py:88 +msgid "" +"We could not detect a package structure at the top-level of your data. OCDS " +"releases and records should be published within a release package or record package to provide important meta-data. For " +"more information, please refer to the Releases and " +"Records section in the OCDS documentation.\n" +"\n" +" Error message: Missing OCDS package" +msgstr "" + +#: cove_ocds/util.py:105 +msgid "Unrecognised version of the schema" +msgstr "" + +#: cove_ocds/util.py:106 cove_ocds/util.py:125 +#, python-format +msgid "%(version)s is not a known schema version" +msgstr "" + +#: cove_ocds/util.py:111 +msgid "" +"We think you tried to run your data against an unrecognised version of the " +"schema.\n" +"\n" +" Error message: {} is not a recognised choice " +"for the schema version" +msgstr "" + +#: cove_ocds/util.py:124 +msgid "Version format does not comply with the schema" +msgstr "" + +#: cove_ocds/util.py:130 +msgid "" +"The value for the \"version\" field in your data follows the " +"major.minor.patch pattern but according to the schema the patch " +"digit shouldn't be included (e.g. \"1.1.0\" should appear as " +"\"1.1\" in your data as this tool always uses the latest patch " +"release for a major.minor version).\n" +"\n" +"Please get rid of the patch digit and try again.\n" +"\n" +" Error message: {} format does not comply " +"with the schema" +msgstr "" + +#: cove_ocds/util.py:144 +#, python-format +msgid "%(version)s (not a string)" +msgstr "" + +#: cove_ocds/views.py:118 msgid "" "The table isn't structured correctly. For example, a JSON Pointer " "(tender) can't be both a value (tender), a path to " @@ -1460,3 +1462,12 @@ msgid "" " Error message: {}" msgstr "" + +#: cove_ocds/views.py:147 +msgid "JSON reference error" +msgstr "" + +#: cove_ocds/views.py:159 +#, python-format +msgid "%(error)s" +msgstr "" diff --git a/cove_ocds/locale/es/LC_MESSAGES/django.po b/cove_ocds/locale/es/LC_MESSAGES/django.po index 0e60dad3..3643c53b 100644 --- a/cove_ocds/locale/es/LC_MESSAGES/django.po +++ b/cove_ocds/locale/es/LC_MESSAGES/django.po @@ -15,7 +15,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-10 00:56+0000\n" +"POT-Creation-Date: 2024-10-19 04:51+0000\n" "PO-Revision-Date: 2020-09-08 08:53+0000\n" "Last-Translator: James McKinney, 2024\n" "Language-Team: Spanish (https://app.transifex.com/open-contracting-" @@ -27,66 +27,6 @@ msgstr "" "Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? " "1 : 2;\n" -#: cove_ocds/lib/exceptions.py:12 -msgid "Unrecognised version of the schema" -msgstr "Versión del esquema no reconocida" - -#: cove_ocds/lib/exceptions.py:14 cove_ocds/lib/exceptions.py:34 -#: cove_ocds/lib/exceptions.py:57 cove_ocds/lib/exceptions.py:77 -#: cove_ocds/views.py:90 cove_ocds/views.py:108 cove_ocds/views.py:126 -#: cove_ocds/views.py:237 -msgid "Try Again" -msgstr "Inténtelo de nuevo" - -#: cove_ocds/lib/exceptions.py:24 cove_ocds/lib/exceptions.py:47 -#, python-format -msgid "%(version)s is not a known schema version" -msgstr "%(version)s no es una versión conocida del esquema" - -#: cove_ocds/lib/exceptions.py:32 -msgid "Version format does not comply with the schema" -msgstr "El formato de la versión no se ajusta al esquema" - -#: cove_ocds/lib/exceptions.py:55 -msgid "JSON reference error" -msgstr "Error de referencia en JSON" - -#: cove_ocds/lib/exceptions.py:67 -#, python-format -msgid "%(error)s" -msgstr "%(error)s" - -#: cove_ocds/lib/exceptions.py:75 cove_ocds/lib/exceptions.py:92 -msgid "Missing OCDS package" -msgstr "Paquete OCDS no encontrado" - -#: cove_ocds/lib/exceptions.py:80 -msgid "" -"We could not detect a package structure at the top-level of your data. OCDS " -"releases and records should be published within a release package or record package to provide important meta-data. For " -"more information, please refer to the Releases and " -"Records section in the OCDS documentation.\n" -"\n" -" Error message: Missing OCDS package" -msgstr "" -"No pudimos detectar una estructura de paquete en el nivel superior de sus " -"datos. Las versiones y registros de OCDS deben publicarse dentro de un paquete de entrega o paquete de registros " -"para proporcionar metadatos importantes. Para obtener más información, " -"consulte la sección Entregas y registros en la documentación " -"de OCDS.\n" -"\n" -" Mensaje de error: Falta el paquete OCDS" - #: cove_ocds/templates/cove_ocds/additional_checks_table.html:7 msgid "Check Description" msgstr "Compruebe la Descripción" @@ -268,9 +208,8 @@ msgid "" "example/1.1/ocds-213czf-000-00001-02-tender.json" msgstr "" "Para ver cómo funciona la herramienta de revisión de datos, intente subir " -"https://raw.githubusercontent.com/open-" -"contracting/sample-data/main/fictional-example/1.1/ocds-213czf-000-00001-02-" -"tender.json" +"https://raw.githubusercontent.com/open-contracting/sample-data/main/" +"fictional-example/1.1/ocds-213czf-000-00001-02-tender.json" #: cove_ocds/templates/cove_ocds/base.html:153 msgid "Built by" @@ -1660,36 +1599,18 @@ msgstr "" "DDT00:00:00Z. Lea más sobre fechas en OCDS" -#: cove_ocds/views.py:50 -msgid "Sorry, the page you are looking for is not available" -msgstr "Lo sentimos, la página que está buscando no está disponible" - -#: cove_ocds/views.py:52 -msgid "Go to Home page" -msgstr "Ir a la Página de Inicio" - -#: cove_ocds/views.py:55 -#, python-format -msgid "" -"The data you were hoping to explore no longer exists.\n" -"\n" -"This is because all data supplied to this website is automatically deleted " -"after %s days, and therefore the analysis of that data is no longer " -"available." -msgstr "" -"Los datos que usted quería explorar ya no existen.\n" -"\n" -"Esto se debe a que todos los datos suministrados a este sitio web se borran " -"automáticamente después de 7 días, y por lo tanto el análisis de esos datos " -"automáticamente después de %s días, y por lo tanto el análisis de esos datos " -"ya no está disponible." - -#: cove_ocds/views.py:88 cove_ocds/views.py:106 cove_ocds/views.py:124 -#: cove_ocds/views.py:235 +#: cove_ocds/util.py:20 cove_ocds/util.py:39 cove_ocds/util.py:57 +#: cove_ocds/views.py:112 msgid "Sorry, we can't process that data" msgstr "Lo sentimos, no podemos procesar esos datos" -#: cove_ocds/views.py:93 +#: cove_ocds/util.py:23 cove_ocds/util.py:42 cove_ocds/util.py:59 +#: cove_ocds/util.py:85 cove_ocds/util.py:108 cove_ocds/util.py:127 +#: cove_ocds/views.py:114 cove_ocds/views.py:149 +msgid "Try Again" +msgstr "Inténtelo de nuevo" + +#: cove_ocds/util.py:26 msgid "" "The file that you uploaded doesn't appear to be well formed JSON. OCDS JSON " "follows the I-JSON format, which requires UTF-8 encoding. Ensure that your " @@ -1706,7 +1627,7 @@ msgstr "" " Mensaje del error: {}" -#: cove_ocds/views.py:111 +#: cove_ocds/util.py:45 msgid "" "We think you tried to upload a JSON file, but it is not well formed JSON.\n" "\n" @@ -1719,7 +1640,7 @@ msgstr "" " Mensaje del error: {}" -#: cove_ocds/views.py:127 +#: cove_ocds/util.py:60 msgid "" "OCDS JSON should have an object as the top level, the JSON you supplied does " "not." @@ -1727,7 +1648,81 @@ msgstr "" "OCDS JSON debe ser un objeto al nivel más alto pero el JSON que usted ha " "aportado no lo es." -#: cove_ocds/views.py:240 +#: cove_ocds/util.py:82 cove_ocds/util.py:83 +msgid "Missing OCDS package" +msgstr "Paquete OCDS no encontrado" + +#: cove_ocds/util.py:88 +msgid "" +"We could not detect a package structure at the top-level of your data. OCDS " +"releases and records should be published within a release package or record package to provide important meta-data. For " +"more information, please refer to the Releases and " +"Records section in the OCDS documentation.\n" +"\n" +" Error message: Missing OCDS package" +msgstr "" +"No pudimos detectar una estructura de paquete en el nivel superior de sus " +"datos. Las versiones y registros de OCDS deben publicarse dentro de un paquete de entrega o paquete de registros " +"para proporcionar metadatos importantes. Para obtener más información, " +"consulte la sección Entregas y registros en la documentación " +"de OCDS.\n" +"\n" +" Mensaje de error: Falta el paquete OCDS" + +#: cove_ocds/util.py:105 +msgid "Unrecognised version of the schema" +msgstr "Versión del esquema no reconocida" + +#: cove_ocds/util.py:106 cove_ocds/util.py:125 +#, python-format +msgid "%(version)s is not a known schema version" +msgstr "%(version)s no es una versión conocida del esquema" + +#: cove_ocds/util.py:111 +msgid "" +"We think you tried to run your data against an unrecognised version of the " +"schema.\n" +"\n" +" Error message: {} is not a recognised choice " +"for the schema version" +msgstr "" + +#: cove_ocds/util.py:124 +msgid "Version format does not comply with the schema" +msgstr "El formato de la versión no se ajusta al esquema" + +#: cove_ocds/util.py:130 +msgid "" +"The value for the \"version\" field in your data follows the " +"major.minor.patch pattern but according to the schema the patch " +"digit shouldn't be included (e.g. \"1.1.0\" should appear as " +"\"1.1\" in your data as this tool always uses the latest patch " +"release for a major.minor version).\n" +"\n" +"Please get rid of the patch digit and try again.\n" +"\n" +" Error message: {} format does not comply " +"with the schema" +msgstr "" + +#: cove_ocds/util.py:144 +#, python-format +msgid "%(version)s (not a string)" +msgstr "" + +#: cove_ocds/views.py:118 msgid "" "The table isn't structured correctly. For example, a JSON Pointer " "(tender) can't be both a value (tender), a path to " @@ -1744,3 +1739,33 @@ msgstr "" "\n" " Error message: {}" + +#: cove_ocds/views.py:147 +msgid "JSON reference error" +msgstr "Error de referencia en JSON" + +#: cove_ocds/views.py:159 +#, python-format +msgid "%(error)s" +msgstr "%(error)s" + +#~ msgid "Sorry, the page you are looking for is not available" +#~ msgstr "Lo sentimos, la página que está buscando no está disponible" + +#~ msgid "Go to Home page" +#~ msgstr "Ir a la Página de Inicio" + +#, python-format +#~ msgid "" +#~ "The data you were hoping to explore no longer exists.\n" +#~ "\n" +#~ "This is because all data supplied to this website is automatically " +#~ "deleted after %s days, and therefore the analysis of that data is no " +#~ "longer available." +#~ msgstr "" +#~ "Los datos que usted quería explorar ya no existen.\n" +#~ "\n" +#~ "Esto se debe a que todos los datos suministrados a este sitio web se " +#~ "borran automáticamente después de 7 días, y por lo tanto el análisis de " +#~ "esos datos automáticamente después de %s días, y por lo tanto el análisis " +#~ "de esos datos ya no está disponible." diff --git a/cove_ocds/util.py b/cove_ocds/util.py new file mode 100644 index 00000000..0a51be61 --- /dev/null +++ b/cove_ocds/util.py @@ -0,0 +1,203 @@ +import json +import re +from decimal import Decimal + +from django.utils.html import format_html, mark_safe +from django.utils.translation import gettext as _ +from libcove.lib.common import schema_dict_fields_generator +from libcove.lib.exceptions import CoveInputDataError +from libcoveocds.schema import SchemaOCDS + + +def read_json(path): + # Read as text, because the json module can read binary UTF-16 and UTF-32. + with open(path, encoding="utf-8") as f: + try: + data = json.load(f) + except UnicodeError as err: + raise CoveInputDataError( + context={ + "sub_title": _("Sorry, we can't process that data"), + "error": format(err), + "link": "index", + "link_text": _("Try Again"), + "msg": format_html( + _( + "The file that you uploaded doesn't appear to be well formed JSON. OCDS JSON follows the " + "I-JSON format, which requires UTF-8 encoding. Ensure that your file uses UTF-8 encoding, " + "then try uploading again.\n\n" + ' ' + "Error message: {}" + ), + err, + ), + } + ) from None + except ValueError as err: + raise CoveInputDataError( + context={ + "sub_title": _("Sorry, we can't process that data"), + "error": format(err), + "link": "index", + "link_text": _("Try Again"), + "msg": format_html( + _( + "We think you tried to upload a JSON file, but it is not well formed JSON.\n\n" + ' ' + "Error message: {}" + ), + err, + ), + } + ) from None + + if not isinstance(data, dict): + raise CoveInputDataError( + context={ + "sub_title": _("Sorry, we can't process that data"), + "link": "index", + "link_text": _("Try Again"), + "msg": _("OCDS JSON should have an object as the top level, the JSON you supplied does not."), + } + ) + + return data + + +def get_schema(request, context, supplied_data, lib_cove_ocds_config, package_data): + request_version = request.POST.get("version") + data_version = package_data.get("version") + + schema_ocds = SchemaOCDS( + # This will be the user-requested version, the previously-determined version, or None. + select_version=request_version or supplied_data.schema_version, + package_data=package_data, + lib_cove_ocds_config=lib_cove_ocds_config, + record_pkg="records" in package_data, + ) + + if schema_ocds.missing_package: + raise CoveInputDataError( + context={ + "sub_title": _("Missing OCDS package"), + "error": _("Missing OCDS package"), + "link": "index", + "link_text": _("Try Again"), + "msg": mark_safe( + _( + "We could not detect a package structure at the top-level of your data. OCDS releases and " + 'records should be published within a release package or record package to provide important meta-data. ' + 'For more information, please refer to the Releases and Records section in the OCDS ' + "documentation.\n\n" + ' ' + "Error message: Missing OCDS package" + ) + ), + } + ) + + if schema_ocds.invalid_version_argument: + raise CoveInputDataError( + context={ + "sub_title": _("Unrecognised version of the schema"), + "error": _("%(version)s is not a known schema version") % {"version": request_version}, + "link": "index", + "link_text": _("Try Again"), + "msg": format_html( + _( + "We think you tried to run your data against an unrecognised version of the schema.\n\n" + ' ' + "Error message: {} is not a recognised choice for the schema version", + ), + request_version, + ), + } + ) + + if schema_ocds.invalid_version_data: + if isinstance(data_version, str) and re.compile(r"^\d+\.\d+\.\d+$").match(data_version): + raise CoveInputDataError( + context={ + "sub_title": _("Version format does not comply with the schema"), + "error": _("%(version)s is not a known schema version") % {"version": data_version}, + "link": "index", + "link_text": _("Try Again"), + "msg": format_html( + _( + 'The value for the "version" field in your data follows the major.minor.' + "patch pattern but according to the schema the patch digit shouldn't be included " + '(e.g. "1.1.0" should appear as "1.1" in your data as this tool ' + "always uses the latest patch release for a major.minor version).\n\n" + "Please get rid of the patch digit and try again.\n\n" + ' ' + "Error message: {} format does not comply with the schema", + ), + json.dumps(data_version), + ), + } + ) + + if not isinstance(data_version, str): + data_version = _("%(version)s (not a string)") % {"version": json.dumps(data_version)} + context["unrecognized_version_data"] = data_version + + # Cache the extended schema. + if schema_ocds.extensions: + schema_ocds.create_extended_schema_file(supplied_data.upload_dir(), supplied_data.upload_url()) + + # If the schema is not extended, extended_schema_file is None. + schema_url = schema_ocds.extended_schema_file or schema_ocds.schema_url + + # Regenerate alternative formats if the user requests a different version. + replace = bool(supplied_data.schema_version) and schema_ocds.version != supplied_data.schema_version + + return schema_ocds, schema_url, replace + + +def default(obj): + if isinstance(obj, Decimal): + return float(obj) + return json.JSONEncoder().default(obj) + + +def add_extra_fields(data, deref_release_schema): + all_schema_fields = set(schema_dict_fields_generator(deref_release_schema)) + + if "releases" in data: + for release in data.get("releases", []): + if not isinstance(release, dict): + return + _add_extra_fields_to_obj(release, all_schema_fields, "") + elif "records" in data: + for record in data.get("records", []): + if not isinstance(record, dict): + return + for release in record.get("releases", []): + _add_extra_fields_to_obj(release, all_schema_fields, "") + + +def _add_extra_fields_to_obj(obj, all_schema_fields, current_path): + if not isinstance(obj, dict): + return + obj["__extra"] = {} + + for key, value in list(obj.items()): + if key == "__extra": + continue + + new_path = f"{current_path}/{key}" + if new_path not in all_schema_fields: + obj["__extra"][key] = value + continue + + if isinstance(value, list): + for item in value: + _add_extra_fields_to_obj(item, all_schema_fields, new_path) + elif isinstance(value, dict): + _add_extra_fields_to_obj(value, all_schema_fields, new_path) + + if not obj["__extra"]: + obj.pop("__extra") diff --git a/cove_ocds/views.py b/cove_ocds/views.py index a05c86dc..73498429 100644 --- a/cove_ocds/views.py +++ b/cove_ocds/views.py @@ -4,7 +4,7 @@ import os import re import warnings -from decimal import Decimal +from collections import defaultdict from cove.views import cove_web_input_error, explore_data_context from django.conf import settings @@ -20,212 +20,89 @@ from libcoveocds.config import LibCoveOCDSConfig from libcoveocds.schema import SchemaOCDS -from cove_ocds.lib.views import group_validation_errors - -from .lib import exceptions -from .lib.ocds_show_extra import add_extra_fields +from cove_ocds import util logger = logging.getLogger(__name__) MAXIMUM_RELEASES_OR_RECORDS = 100 -def format_lang(choices, lang): - """Format the urls with `{lang}` contained in a schema_version_choices.""" - formatted_choices = {} - for version, (display, url, tag) in choices.items(): - formatted_choices[version] = (display, url.format(lang=lang), tag) - return formatted_choices - - @cove_web_input_error def explore_ocds(request, pk): - try: - context, db_data, error = explore_data_context(request, pk) - # https://github.com/OpenDataServices/lib-cove-web/pull/145 - except FileNotFoundError: - return render( - request, - "error.html", - { - "sub_title": _("Sorry, the page you are looking for is not available"), - "link": "index", - "link_text": _("Go to Home page"), - "support_email": settings.COVE_CONFIG.get("support_email"), - "msg": _( - "The data you were hoping to explore no longer exists.\n\nThis is because all " - "data supplied to this website is automatically deleted after %s days, and therefore " - "the analysis of that data is no longer available." - ) - % getattr(settings, "DELETE_FILES_AFTER_DAYS", 7), - }, - status=404, - ) + context, supplied_data, error = explore_data_context(request, pk) if error: return error + # Initialize the CoVE configuration. + lib_cove_ocds_config = LibCoveOCDSConfig(settings.COVE_CONFIG) lib_cove_ocds_config.config["current_language"] = translation.get_language() - lib_cove_ocds_config.config["schema_version_choices"] = format_lang( - lib_cove_ocds_config.config["schema_version_choices"], request.LANGUAGE_CODE - ) + # Format the urls with `{lang}` contained in a schema_version_choices. + lib_cove_ocds_config.config["schema_version_choices"] = { + version: (display, url.format(lang=request.LANGUAGE_CODE), tag) + for version, (display, url, tag) in lib_cove_ocds_config.config["schema_version_choices"].items() + } - upload_dir = db_data.upload_dir() - upload_url = db_data.upload_url() - file_name = db_data.original_file.path - file_type = context["file_type"] + # Read the supplied data, and convert to alternative formats (if not done on a previous request). - post_version_choice = request.POST.get("version") - replace = False - validation_errors_path = os.path.join(upload_dir, "validation_errors-3.json") + if context["file_type"] == "json": + package_data = util.read_json(supplied_data.original_file.path) - if file_type == "json": - with open(file_name, encoding="utf-8") as fp: - try: - json_data = json.load(fp) - except UnicodeError as err: - raise CoveInputDataError( - context={ - "sub_title": _("Sorry, we can't process that data"), - "link": "index", - "link_text": _("Try Again"), - "msg": format_html( - _( - "The file that you uploaded doesn't appear to be well formed JSON. OCDS JSON follows " - "the I-JSON format, which requires UTF-8 encoding. Ensure that your file uses UTF-8 " - 'encoding, then try uploading again.\n\n Error message: {}' - ), - err, - ), - "error": format(err), - } - ) from None - except ValueError as err: - raise CoveInputDataError( - context={ - "sub_title": _("Sorry, we can't process that data"), - "link": "index", - "link_text": _("Try Again"), - "msg": format_html( - _( - "We think you tried to upload a JSON file, but it is not well formed JSON." - '\n\n Error message: {}", - ), - err, - ), - "error": format(err), - } - ) from None - - if not isinstance(json_data, dict): - raise CoveInputDataError( - context={ - "sub_title": _("Sorry, we can't process that data"), - "link": "index", - "link_text": _("Try Again"), - "msg": _("OCDS JSON should have an object as the top level, the JSON you supplied does not."), - } - ) - - version_in_data = json_data.get("version") or "" - db_data.data_schema_version = version_in_data - select_version = post_version_choice or db_data.schema_version - schema_ocds = SchemaOCDS( - select_version=select_version, - package_data=json_data, - lib_cove_ocds_config=lib_cove_ocds_config, - record_pkg="records" in json_data, - ) - - if schema_ocds.missing_package: - exceptions.raise_missing_package_error() - if schema_ocds.invalid_version_argument: - exceptions.raise_invalid_version_argument(post_version_choice) - if schema_ocds.invalid_version_data: - if isinstance(version_in_data, str) and re.compile(r"^\d+\.\d+\.\d+$").match(version_in_data): - exceptions.raise_invalid_version_data_with_patch(version_in_data) - else: - if not isinstance(version_in_data, str): - version_in_data = f"{version_in_data} (it must be a string)" - context["unrecognized_version_data"] = version_in_data - - if schema_ocds.version != db_data.schema_version: - replace = True - if schema_ocds.extensions: - schema_ocds.create_extended_schema_file(upload_dir, upload_url) - url = schema_ocds.extended_schema_file or schema_ocds.schema_url + schema_ocds, schema_url, replace = util.get_schema( + request, context, supplied_data, lib_cove_ocds_config, package_data + ) - if "records" in json_data: - context["conversion"] = None - else: - with warnings.catch_warnings(): - warnings.filterwarnings("ignore", category=FlattenToolWarning) + if "records" in package_data: + context["conversion"] = None + else: + with warnings.catch_warnings(): + warnings.filterwarnings("ignore", category=FlattenToolWarning) - convert_json_context = convert_json( - upload_dir, - upload_url, - file_name, - lib_cove_ocds_config, - schema_url=url, + context.update( + convert_json( + upload_dir=supplied_data.upload_dir(), + upload_url=supplied_data.upload_url(), + file_name=supplied_data.original_file.path, + lib_cove_config=lib_cove_ocds_config, + schema_url=schema_url, # Unsure why exists() was added in https://github.com/open-contracting/cove-ocds/commit/d793c49 - replace=replace and os.path.exists(os.path.join(upload_dir, "flattened.xlsx")), + replace=replace and os.path.exists(os.path.join(supplied_data.upload_dir(), "flattened.xlsx")), request=request, flatten=request.POST.get("flatten"), ) - - context.update(convert_json_context) - + ) else: - metatab_schema_url = SchemaOCDS(select_version="1.1", lib_cove_ocds_config=lib_cove_ocds_config).pkg_schema_url - with warnings.catch_warnings(): warnings.filterwarnings("ignore", category=FlattenToolWarning) - metatab_data = get_spreadsheet_meta_data(upload_dir, file_name, metatab_schema_url, file_type) + meta_data = get_spreadsheet_meta_data( + supplied_data.upload_dir(), + supplied_data.original_file.path, + SchemaOCDS(select_version="1.1", lib_cove_ocds_config=lib_cove_ocds_config).pkg_schema_url, + context["file_type"], + ) - if "version" not in metatab_data: - metatab_data["version"] = "1.0" - else: - db_data.data_schema_version = metatab_data["version"] + meta_data.setdefault("version", "1.0") + # Make "missing_package" pass. + meta_data["releases"] = {} - select_version = post_version_choice or db_data.schema_version - schema_ocds = SchemaOCDS( - select_version=select_version, - package_data=metatab_data, - lib_cove_ocds_config=lib_cove_ocds_config, + schema_ocds, schema_url, replace = util.get_schema( + request, context, supplied_data, lib_cove_ocds_config, meta_data ) - if schema_ocds.invalid_version_argument: - exceptions.raise_invalid_version_argument(post_version_choice) - if schema_ocds.invalid_version_data: - version_in_data = metatab_data.get("version") - if re.compile(r"^\d+\.\d+\.\d+$").match(version_in_data): - exceptions.raise_invalid_version_data_with_patch(version_in_data) - else: - context["unrecognized_version_data"] = version_in_data - - if db_data.schema_version and schema_ocds.version != db_data.schema_version: # if user changes schema version - replace = True - - if schema_ocds.extensions: - schema_ocds.create_extended_schema_file(upload_dir, upload_url) - url = schema_ocds.extended_schema_file or schema_ocds.schema_url - pkg_url = schema_ocds.pkg_schema_url - with warnings.catch_warnings(): warnings.filterwarnings("ignore", category=FlattenToolWarning) try: context.update( + # __wrapped__ is missing when the function is patched by tests. getattr(convert_spreadsheet, "__wrapped__", convert_spreadsheet)( - upload_dir, - upload_url, - file_name, - file_type, - lib_cove_ocds_config, - schema_url=url, - pkg_schema_url=pkg_url, + supplied_data.upload_dir(), + upload_url=supplied_data.upload_url(), + file_name=supplied_data.original_file.path, + file_type=context["file_type"], + lib_cove_config=lib_cove_ocds_config, + schema_url=schema_url, + pkg_schema_url=schema_ocds.pkg_schema_url, replace=replace, ) ) @@ -235,92 +112,111 @@ def explore_ocds(request, pk): "sub_title": _("Sorry, we can't process that data"), "link": "index", "link_text": _("Try Again"), + "error": format(err), "msg": format_html( _( "The table isn't structured correctly. For example, a JSON Pointer (tender" ") can't be both a value (tender), a path to an object (" - "tender/id) and a path to an array (tender/0/title)." - '\n\n Error message: {}", + "tender/id) and a path to an array (tender/0/title).\n\n" + ' ' + "Error message: {}", ), err, ), - "error": format(err), } ) from None except Exception as err: - logger.exception(extra={"request": request}) + logger.exception("", extra={"request": request}) raise CoveInputDataError(wrapped_err=err) from None - with open(context["converted_path"], encoding="utf-8") as fp: - json_data = json.load(fp) + with open(context["converted_path"], "rb") as f: + package_data = json.load(f) + # Perform the validation. + + # common_checks_ocds() calls libcove.lib.common.common_checks_context(), which writes `validation_errors-3.json`. + validation_errors_path = os.path.join(supplied_data.upload_dir(), "validation_errors-3.json") if replace and os.path.exists(validation_errors_path): os.remove(validation_errors_path) + context = common_checks_ocds(context, supplied_data.upload_dir(), package_data, schema_ocds) - context = common_checks_ocds(context, upload_dir, json_data, schema_ocds) - + # Set by SchemaOCDS.get_schema_obj(deref=True), which, at the latest, is called indirectly by common_checks_ocds(). if schema_ocds.json_deref_error: - exceptions.raise_json_deref_error(schema_ocds.json_deref_error) + raise CoveInputDataError( + context={ + "sub_title": _("JSON reference error"), + "link": "index", + "link_text": _("Try Again"), + "msg": _( + format_html( + "We have detected a JSON reference error in the schema. This may be " + " due to some extension trying to resolve non-existing references. " + '\n\n Error message: {}", + schema_ocds.json_deref_error, + ) + ), + "error": _("%(error)s") % {"error": schema_ocds.json_deref_error}, + } + ) + + # Update the row in the database. + + # The data_schema_version column is NOT NULL. + supplied_data.data_schema_version = package_data.get("version") or "" + supplied_data.schema_version = schema_ocds.version + supplied_data.rendered = True # not relevant to CoVE OCDS + supplied_data.save() + + # Finalize the context and select the template. + + validation_errors_grouped = defaultdict(list) + for error_json, values in context["validation_errors"]: + match json.loads(error_json)["message_type"]: + case "required": + key = "required" + case "format" | "pattern" | "number" | "string" | "date-time" | "uri" | "object" | "integer" | "array": + key = "format" + case _: + key = "other" + validation_errors_grouped[key].append((error_json, values)) context.update( { - "data_schema_version": db_data.data_schema_version, - "first_render": not db_data.rendered, - "validation_errors_grouped": group_validation_errors(context["validation_errors"]), + "data_schema_version": supplied_data.data_schema_version, + "validation_errors_grouped": validation_errors_grouped, } ) for key in ("additional_closed_codelist_values", "additional_open_codelist_values"): - for codelist_info in context[key].values(): - if codelist_info["codelist_url"].startswith(schema_ocds.codelists): - codelist_info["codelist_url"] = ( - f"https://standard.open-contracting.org/{db_data.data_schema_version}/en/schema/codelists/#" - + re.sub(r"([A-Z])", r"-\1", codelist_info["codelist"].split(".")[0]).lower() + for additional_codelist_values in context[key].values(): + if additional_codelist_values["codelist_url"].startswith(schema_ocds.codelists): + additional_codelist_values["codelist_url"] = ( + f"https://standard.open-contracting.org/{supplied_data.data_schema_version}/en/schema/codelists/#" + + re.sub(r"([A-Z])", r"-\1", additional_codelist_values["codelist"].split(".")[0]).lower() ) - schema_version = getattr(schema_ocds, "version", None) - if schema_version: - db_data.schema_version = schema_version - if not db_data.rendered: - db_data.rendered = True - - db_data.save() - - if "records" in json_data: - context["release_or_record"] = "record" - ocds_show_schema = SchemaOCDS(record_pkg=True) - ocds_show_deref_schema = ocds_show_schema.get_schema_obj(deref=True) + has_records = "records" in package_data + if has_records: template = "cove_ocds/explore_record.html" - if hasattr(json_data, "get") and hasattr(json_data.get("records"), "__iter__"): - context["records"] = json_data["records"] - if isinstance(json_data["records"], list) and len(json_data["records"]) < MAXIMUM_RELEASES_OR_RECORDS: - context["ocds_show_data"] = ocds_show_data(json_data, ocds_show_deref_schema) - else: - context["records"] = [] + context["release_or_record"] = "record" + key = "records" else: - context["release_or_record"] = "release" - ocds_show_schema = SchemaOCDS(record_pkg=False) - ocds_show_deref_schema = ocds_show_schema.get_schema_obj(deref=True) template = "cove_ocds/explore_release.html" - if hasattr(json_data, "get") and hasattr(json_data.get("releases"), "__iter__"): - context["releases"] = json_data["releases"] - if isinstance(json_data["releases"], list) and len(json_data["releases"]) < MAXIMUM_RELEASES_OR_RECORDS: - context["ocds_show_data"] = ocds_show_data(json_data, ocds_show_deref_schema) - else: - context["releases"] = [] + context["release_or_record"] = "release" + key = "releases" + + if isinstance(package_data, dict) and isinstance(package_data.get(key), list): + # This is for the "Releases Table" and "Records Table" features. + context[key] = package_data[key] + + # This is for the OCDS Show feature. + # https://github.com/open-contracting/cove-ocds/commit/d8dbf55 + if len(package_data[key]) < MAXIMUM_RELEASES_OR_RECORDS: + new_package_data = copy.deepcopy(package_data) + util.add_extra_fields(new_package_data, SchemaOCDS(record_pkg=has_records).get_schema_obj(deref=True)) + context["ocds_show_data"] = json.dumps(new_package_data, default=util.default) + else: + context[key] = [] return render(request, template, context) - - -# This should only be run when data is small. -def ocds_show_data(json_data, ocds_show_deref_schema): - new_json_data = copy.deepcopy(json_data) - add_extra_fields(new_json_data, ocds_show_deref_schema) - return json.dumps(new_json_data, default=default) - - -def default(self, obj): - if isinstance(obj, Decimal): - return float(obj) - return json.JSONEncoder().default(obj) diff --git a/docs/architecture.rst b/docs/architecture.rst index 6ec97977..cc1ee3a9 100644 --- a/docs/architecture.rst +++ b/docs/architecture.rst @@ -9,8 +9,6 @@ The OCDS Data Review tool comprises two main parts, which are documented here. cove-ocds --------- -``cove_ocds/lib`` contains OCDS data specific exceptions (errors generated by invalid data or input), as well as additional functions for OCDS Show (the JavaScript data explorer). - ``tests/`` also contains fixtures for testing, and the tests themselves; templates and related static files; code for the CLI version of the DRT; and locale files for translations. ``cove_ocds/views.py`` does most of the heavy lifting of taking an input file from the web interface and carrying out the various validation checks and conversions, then piping the output back to the right templates. diff --git a/tests/test_functional.py b/tests/test_functional.py index 74490431..d928a3f6 100644 --- a/tests/test_functional.py +++ b/tests/test_functional.py @@ -377,7 +377,7 @@ def test_500_error(server_url, browser): ( "tenders_releases_1_release_with_wrong_version_type.json", [ - "Your data specifies a version 1000 (it must be a string) which is not recognised", + "Your data specifies a version 1000 (not a string) which is not recognised", f"checked against OCDS release package schema version {OCDS_DEFAULT_SCHEMA_VERSION}. You can", "Convert to Spreadsheet", ], @@ -388,7 +388,7 @@ def test_500_error(server_url, browser): "tenders_releases_1_release_with_patch_in_version.json", [ '"version" field in your data follows the major.minor.patch pattern', - "100.100.0 format does not comply with the schema", + '"100.100.0" format does not comply with the schema', "Error message", ], ["Convert to Spreadsheet"], diff --git a/tests/test_general.py b/tests/test_general.py index 6238ca82..303d1e7e 100644 --- a/tests/test_general.py +++ b/tests/test_general.py @@ -260,6 +260,7 @@ def test_explore_page_null_version(client): data.current_app = "cove_ocds" resp = client.get(data.get_absolute_url()) assert resp.status_code == 200 + assert b"null (not a string)" in resp.content @pytest.mark.django_db From 93b344040885719ea470a2c66761fdcac1f97756 Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Sat, 19 Oct 2024 01:32:01 -0400 Subject: [PATCH 02/37] build: Upgrade libcoveocds --- requirements.txt | 2 +- requirements_dev.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index ccfd4413..4223a136 100644 --- a/requirements.txt +++ b/requirements.txt @@ -72,7 +72,7 @@ libcove==0.32.1 # -r requirements.in # libcoveocds # libcoveweb -libcoveocds==0.16.0 +libcoveocds==0.16.2 # via -r requirements.in libcoveweb==0.31.0 # via -r requirements.in diff --git a/requirements_dev.txt b/requirements_dev.txt index b7c674ab..0c6d81b5 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -121,7 +121,7 @@ libcove==0.32.1 # -r requirements.txt # libcoveocds # libcoveweb -libcoveocds==0.16.0 +libcoveocds==0.16.2 # via -r requirements.txt libcoveweb==0.31.0 # via -r requirements.txt From 59e1d609efb20bb7426b50e79ca5a6f8349f0d3e Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Sat, 19 Oct 2024 01:35:00 -0400 Subject: [PATCH 03/37] feat: Remove OCDS Show --- cove_ocds/locale/en/LC_MESSAGES/django.po | 408 ++++++++-------- cove_ocds/locale/es/LC_MESSAGES/django.po | 449 +++++++++--------- cove_ocds/sass/_custom-ocds.sass | 5 - .../templates/cove_ocds/explore_base.html | 312 ------------ .../templates/cove_ocds/explore_record.html | 33 -- .../templates/cove_ocds/explore_release.html | 35 -- cove_ocds/util.py | 41 -- cove_ocds/views.py | 8 - docs/architecture.rst | 5 - .../fixtures/tenders_releases_extra_data.json | 115 ----- tests/test_functional.py | 17 - 11 files changed, 411 insertions(+), 1017 deletions(-) delete mode 100644 tests/fixtures/tenders_releases_extra_data.json diff --git a/cove_ocds/locale/en/LC_MESSAGES/django.po b/cove_ocds/locale/en/LC_MESSAGES/django.po index 5aa80f75..97ed4196 100644 --- a/cove_ocds/locale/en/LC_MESSAGES/django.po +++ b/cove_ocds/locale/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-19 04:51+0000\n" +"POT-Creation-Date: 2024-10-19 05:34+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -39,7 +39,7 @@ msgstr "" #. Translators: Label of a button that triggers search #: cove_ocds/templates/cove_ocds/base.html:54 -#: cove_ocds/templates/cove_ocds/explore_base.html:52 +#: cove_ocds/templates/cove_ocds/explore_base.html:46 msgid "Go" msgstr "" @@ -227,11 +227,11 @@ msgstr "" msgid "Load New File" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:24 +#: cove_ocds/templates/cove_ocds/explore_base.html:18 msgid "Schema" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:29 +#: cove_ocds/templates/cove_ocds/explore_base.html:23 #, python-format msgid "" "Your data specifies a version %(unrecognized_version_data)s " @@ -239,179 +239,179 @@ msgid "" "current default version." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:32 +#: cove_ocds/templates/cove_ocds/explore_base.html:26 #, python-format msgid "" "This data has been checked against OCDS " "%(release_or_record)s package schema version %(version_used_display)s." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:32 +#: cove_ocds/templates/cove_ocds/explore_base.html:26 msgid "" "You can choose a different version of the schema to check and explore your " "data." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:34 +#: cove_ocds/templates/cove_ocds/explore_base.html:28 msgid "Check and explore same data against a different version of the schema" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:37 +#: cove_ocds/templates/cove_ocds/explore_base.html:31 msgid "" "Switching the schema version will result in changes to CoVE output and " "conversions. If you revisit or share this URL, the latest version selected " "will be used to check your data" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:64 +#: cove_ocds/templates/cove_ocds/explore_base.html:58 msgid "Convert" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:71 +#: cove_ocds/templates/cove_ocds/explore_base.html:65 msgid "" "There were conversion warnings when " "processing your file. The converted data may not represent your data as you " "want it to be." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:74 +#: cove_ocds/templates/cove_ocds/explore_base.html:68 msgid "We have tried to convert your JSON into a spreadsheet format." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:74 -#: cove_ocds/templates/cove_ocds/explore_base.html:98 +#: cove_ocds/templates/cove_ocds/explore_base.html:68 +#: cove_ocds/templates/cove_ocds/explore_base.html:92 msgid "The results can be seen below." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:81 -#: cove_ocds/templates/cove_ocds/explore_base.html:86 -#: cove_ocds/templates/cove_ocds/explore_base.html:112 +#: cove_ocds/templates/cove_ocds/explore_base.html:75 +#: cove_ocds/templates/cove_ocds/explore_base.html:80 +#: cove_ocds/templates/cove_ocds/explore_base.html:106 msgid "using schema version" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:92 +#: cove_ocds/templates/cove_ocds/explore_base.html:86 msgid "The JSON could not be converted to Spreadsheet due to the error:" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:98 +#: cove_ocds/templates/cove_ocds/explore_base.html:92 msgid "We have tried to convert your data into JSON format." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:124 +#: cove_ocds/templates/cove_ocds/explore_base.html:118 msgid "Convert to Spreadsheet" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:145 +#: cove_ocds/templates/cove_ocds/explore_base.html:139 msgid "Schema Extensions" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:151 +#: cove_ocds/templates/cove_ocds/explore_base.html:145 msgid "" "Your data has been checked against schema version 1.0 and " "includes extensions but extensions were not introduced in the schema until " "version 1.1." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:154 +#: cove_ocds/templates/cove_ocds/explore_base.html:148 msgid "Your data contains the following schema extensions" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:154 +#: cove_ocds/templates/cove_ocds/explore_base.html:148 msgid ", but it wasn't possible to fetch them" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:160 +#: cove_ocds/templates/cove_ocds/explore_base.html:154 msgid "release schema" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:177 +#: cove_ocds/templates/cove_ocds/explore_base.html:171 msgid "The following extensions failed:" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:187 +#: cove_ocds/templates/cove_ocds/explore_base.html:181 msgid "" "Only those extensions successfully fetched were applied to extend the schema." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:189 +#: cove_ocds/templates/cove_ocds/explore_base.html:183 msgid "All the extensions above were applied to extend the schema." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:191 +#: cove_ocds/templates/cove_ocds/explore_base.html:185 msgid "Get a copy of the schema with extension patches applied" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:193 +#: cove_ocds/templates/cove_ocds/explore_base.html:187 msgid "" "None of the extensions above could be applied. Your data has been checked " "against a schema with no extensions." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:206 +#: cove_ocds/templates/cove_ocds/explore_base.html:200 msgid "Conversion Errors" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:211 -#: cove_ocds/templates/cove_ocds/explore_base.html:233 +#: cove_ocds/templates/cove_ocds/explore_base.html:205 +#: cove_ocds/templates/cove_ocds/explore_base.html:227 msgid "" "In order to check your data we need to convert it. During that conversion we " "found the following issues:" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:228 +#: cove_ocds/templates/cove_ocds/explore_base.html:222 msgid "Conversion Errors (titles)" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:256 +#: cove_ocds/templates/cove_ocds/explore_base.html:250 msgid "Structural Errors - Required Fields" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:260 +#: cove_ocds/templates/cove_ocds/explore_base.html:254 msgid "" "Some or all of your data is missing fields which are required by the OCDS " "schema." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:280 +#: cove_ocds/templates/cove_ocds/explore_base.html:274 msgid "Structural Errors - Format" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:284 +#: cove_ocds/templates/cove_ocds/explore_base.html:278 msgid "" "Some or all of your data includes fields which are incorrectly formatted." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:304 +#: cove_ocds/templates/cove_ocds/explore_base.html:298 msgid "Structural Errors - Other" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:308 +#: cove_ocds/templates/cove_ocds/explore_base.html:302 msgid "Some or all of your data has validation errors." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:321 -#: cove_ocds/templates/cove_ocds/explore_base.html:493 -#: cove_ocds/templates/cove_ocds/explore_base.html:496 +#: cove_ocds/templates/cove_ocds/explore_base.html:315 +#: cove_ocds/templates/cove_ocds/explore_base.html:487 +#: cove_ocds/templates/cove_ocds/explore_base.html:490 msgid "Structure Warnings" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:326 -#: cove_ocds/templates/cove_ocds/explore_base.html:348 +#: cove_ocds/templates/cove_ocds/explore_base.html:320 +#: cove_ocds/templates/cove_ocds/explore_base.html:342 msgid "" "Fixing the following issues will improve the interoperability of your data." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:343 -#: cove_ocds/templates/cove_ocds/explore_base.html:481 -#: cove_ocds/templates/cove_ocds/explore_base.html:484 +#: cove_ocds/templates/cove_ocds/explore_base.html:337 +#: cove_ocds/templates/cove_ocds/explore_base.html:475 +#: cove_ocds/templates/cove_ocds/explore_base.html:478 msgid "Conformance (Rules)" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:365 +#: cove_ocds/templates/cove_ocds/explore_base.html:359 msgid "Codelist Errors" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:370 +#: cove_ocds/templates/cove_ocds/explore_base.html:364 msgid "" "The fields below use closed codelists. When using these fields, you " "must use one of the pre-defined codelist values. If you use a " @@ -421,7 +421,7 @@ msgid "" "extensions." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:374 +#: cove_ocds/templates/cove_ocds/explore_base.html:368 msgid "" "You may need to create a mapping between your local codes and the OCDS " "closed codelists to address these errors. In most cases, there will be a " @@ -430,11 +430,11 @@ msgid "" "used in these closed codelist fields." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:385 +#: cove_ocds/templates/cove_ocds/explore_base.html:379 msgid "Additional Fields" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:389 +#: cove_ocds/templates/cove_ocds/explore_base.html:383 msgid "" "This data includes the following fields which are not part of the OCDS " "schema. You should check whether the data in these fields could be provided " @@ -443,11 +443,11 @@ msgid "" "\">extension to the schema." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:403 +#: cove_ocds/templates/cove_ocds/explore_base.html:397 msgid "Additional Codelist Values" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:407 +#: cove_ocds/templates/cove_ocds/explore_base.html:401 msgid "" "Your data contains a number of fields that use an open codelist. You should " "use values from the codelist whenever possible, but if the codelist does not " @@ -458,7 +458,7 @@ msgid "" "(-) by one or more extensions." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:413 +#: cove_ocds/templates/cove_ocds/explore_base.html:407 msgid "" "Make sure you list the definition of any additional codelist values you " "include within your OCDS issue tracker." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:423 +#: cove_ocds/templates/cove_ocds/explore_base.html:417 msgid "Additional Checks" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:437 -#: cove_ocds/templates/cove_ocds/explore_base.html:517 -#: cove_ocds/templates/cove_ocds/explore_base.html:520 +#: cove_ocds/templates/cove_ocds/explore_base.html:431 +#: cove_ocds/templates/cove_ocds/explore_base.html:511 +#: cove_ocds/templates/cove_ocds/explore_base.html:514 msgid "Deprecated Fields" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:437 +#: cove_ocds/templates/cove_ocds/explore_base.html:431 msgid "" "Fields flagged as 'deprecated' will be either replaced or removed in future " "versions of the schema." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:453 +#: cove_ocds/templates/cove_ocds/explore_base.html:447 msgid "Save or Share these results" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:454 +#: cove_ocds/templates/cove_ocds/explore_base.html:448 msgid "Use the following url to share these results:" msgstr "" #. Translators: Paragraph that describes the application -#: cove_ocds/templates/cove_ocds/explore_base.html:459 +#: cove_ocds/templates/cove_ocds/explore_base.html:453 #, python-format msgid "" "These results will be available for %(delete_files_after_days)s days from " @@ -501,7 +501,7 @@ msgid "" "then." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:460 +#: cove_ocds/templates/cove_ocds/explore_base.html:454 #, python-format msgid "" "After %(delete_files_after_days)s days all uploaded data is deleted from our " @@ -510,60 +510,60 @@ msgid "" "been removed." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:475 -#: cove_ocds/templates/cove_ocds/explore_base.html:478 +#: cove_ocds/templates/cove_ocds/explore_base.html:469 +#: cove_ocds/templates/cove_ocds/explore_base.html:472 msgid "Structural Errors" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:487 +#: cove_ocds/templates/cove_ocds/explore_base.html:481 msgid "view all errors ▼" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:490 +#: cove_ocds/templates/cove_ocds/explore_base.html:484 +#: cove_ocds/templates/cove_ocds/explore_base.html:496 #: cove_ocds/templates/cove_ocds/explore_base.html:502 -#: cove_ocds/templates/cove_ocds/explore_base.html:508 msgid "View all errors ▲" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:499 +#: cove_ocds/templates/cove_ocds/explore_base.html:493 #: cove_ocds/templates/cove_ocds/ocds_missing_ids_table.html:6 #: cove_ocds/templates/cove_ocds/ocid_prefixes_table.html:5 msgid "View all errors ▼" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:505 +#: cove_ocds/templates/cove_ocds/explore_base.html:499 msgid "Quality Warnings" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:511 -#: cove_ocds/templates/cove_ocds/explore_base.html:514 +#: cove_ocds/templates/cove_ocds/explore_base.html:505 +#: cove_ocds/templates/cove_ocds/explore_base.html:508 msgid "Additional Fields (fields in data not in schema)" msgstr "" #: cove_ocds/templates/cove_ocds/explore_record.html:12 -#: cove_ocds/templates/cove_ocds/explore_release.html:11 +#: cove_ocds/templates/cove_ocds/explore_release.html:10 msgid "Headlines" msgstr "" #: cove_ocds/templates/cove_ocds/explore_record.html:17 -#: cove_ocds/templates/cove_ocds/explore_release.html:15 +#: cove_ocds/templates/cove_ocds/explore_release.html:14 msgid "" "Please read the conversion warnings " "below." msgstr "" #: cove_ocds/templates/cove_ocds/explore_record.html:21 -#: cove_ocds/templates/cove_ocds/explore_release.html:19 +#: cove_ocds/templates/cove_ocds/explore_release.html:18 msgid "Failed " msgstr "" #: cove_ocds/templates/cove_ocds/explore_record.html:23 -#: cove_ocds/templates/cove_ocds/explore_release.html:21 +#: cove_ocds/templates/cove_ocds/explore_release.html:20 msgid "Passed " msgstr "" #: cove_ocds/templates/cove_ocds/explore_record.html:25 -#: cove_ocds/templates/cove_ocds/explore_release.html:23 +#: cove_ocds/templates/cove_ocds/explore_release.html:22 msgid "structural checks against " msgstr "" @@ -572,12 +572,12 @@ msgid "OCDS record package schema version" msgstr "" #: cove_ocds/templates/cove_ocds/explore_record.html:26 -#: cove_ocds/templates/cove_ocds/explore_release.html:24 +#: cove_ocds/templates/cove_ocds/explore_release.html:23 msgid "See Structural Errors below." msgstr "" #: cove_ocds/templates/cove_ocds/explore_record.html:30 -#: cove_ocds/templates/cove_ocds/explore_release.html:33 +#: cove_ocds/templates/cove_ocds/explore_release.html:32 msgid "At a glance" msgstr "" @@ -589,7 +589,7 @@ msgstr[0] "" msgstr[1] "" #: cove_ocds/templates/cove_ocds/explore_record.html:39 -#: cove_ocds/templates/cove_ocds/explore_release.html:43 +#: cove_ocds/templates/cove_ocds/explore_release.html:42 msgid "The schema version specified in the file is" msgstr "" @@ -601,22 +601,22 @@ msgstr[0] "" msgstr[1] "" #: cove_ocds/templates/cove_ocds/explore_record.html:47 -#: cove_ocds/templates/cove_ocds/explore_release.html:48 +#: cove_ocds/templates/cove_ocds/explore_release.html:47 msgid "The publisher named in the file is" msgstr "" #: cove_ocds/templates/cove_ocds/explore_record.html:52 -#: cove_ocds/templates/cove_ocds/explore_release.html:53 +#: cove_ocds/templates/cove_ocds/explore_release.html:52 msgid "The license is" msgstr "" #: cove_ocds/templates/cove_ocds/explore_record.html:57 -#: cove_ocds/templates/cove_ocds/explore_release.html:58 +#: cove_ocds/templates/cove_ocds/explore_release.html:57 msgid "Publication policy is" msgstr "" #: cove_ocds/templates/cove_ocds/explore_record.html:63 -#: cove_ocds/templates/cove_ocds/explore_release.html:70 +#: cove_ocds/templates/cove_ocds/explore_release.html:69 #, python-format msgid "" "There is %(count)s duplicate release ID in " @@ -628,7 +628,7 @@ msgstr[0] "" msgstr[1] "" #: cove_ocds/templates/cove_ocds/explore_record.html:69 -#: cove_ocds/templates/cove_ocds/explore_release.html:75 +#: cove_ocds/templates/cove_ocds/explore_release.html:74 #, python-format msgid "" "This file uses %(count)s additional field " @@ -640,32 +640,32 @@ msgstr[0] "" msgstr[1] "" #: cove_ocds/templates/cove_ocds/explore_record.html:74 -#: cove_ocds/templates/cove_ocds/explore_release.html:80 +#: cove_ocds/templates/cove_ocds/explore_release.html:79 msgid "This file is not 'utf-8' encoded (it is" msgstr "" #: cove_ocds/templates/cove_ocds/explore_record.html:74 -#: cove_ocds/templates/cove_ocds/explore_release.html:80 +#: cove_ocds/templates/cove_ocds/explore_release.html:79 msgid "encoded)." msgstr "" #: cove_ocds/templates/cove_ocds/explore_record.html:78 -#: cove_ocds/templates/cove_ocds/explore_release.html:89 +#: cove_ocds/templates/cove_ocds/explore_release.html:88 msgid "Data " msgstr "" #: cove_ocds/templates/cove_ocds/explore_record.html:80 -#: cove_ocds/templates/cove_ocds/explore_release.html:91 +#: cove_ocds/templates/cove_ocds/explore_release.html:90 msgid "downloaded from " msgstr "" #: cove_ocds/templates/cove_ocds/explore_record.html:82 -#: cove_ocds/templates/cove_ocds/explore_release.html:93 +#: cove_ocds/templates/cove_ocds/explore_release.html:92 msgid "uploaded " msgstr "" #: cove_ocds/templates/cove_ocds/explore_record.html:84 -#: cove_ocds/templates/cove_ocds/explore_release.html:95 +#: cove_ocds/templates/cove_ocds/explore_release.html:94 msgid "on " msgstr "" @@ -706,84 +706,56 @@ msgstr "" msgid "release count" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_record.html:185 -#: cove_ocds/templates/cove_ocds/explore_release.html:428 -msgid "Explore your data:" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:190 -#: cove_ocds/templates/cove_ocds/explore_release.html:433 -msgid "" -"This section provides a visual representation of the data, use it to check " -"whether the data makes sense in the type of tool a user might use to explore " -"it." -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:193 -#: cove_ocds/templates/cove_ocds/explore_release.html:436 -msgid "" -"Extensions and additional fields are hidden by default, click the 'Extra " -"fields' buttons or open the 'Extra fields' section to view them." -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:196 -#: cove_ocds/templates/cove_ocds/explore_release.html:439 -msgid "" -"When viewing an OCDS record, use the numbers at the top of the visualization " -"to browse the change history. New and changed fields are highlighted, use " -"this feature to check whether any fields have changed unexpectedly." -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:23 +#: cove_ocds/templates/cove_ocds/explore_release.html:22 msgid "OCDS release package schema version" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:28 +#: cove_ocds/templates/cove_ocds/explore_release.html:27 msgid "Failed to apply " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:28 +#: cove_ocds/templates/cove_ocds/explore_release.html:27 #, python-format msgid " %(count)s extension " msgid_plural "%(count)s extensions " msgstr[0] "" msgstr[1] "" -#: cove_ocds/templates/cove_ocds/explore_release.html:28 +#: cove_ocds/templates/cove_ocds/explore_release.html:27 msgid "" " to the schema.
See Extensions below." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:37 +#: cove_ocds/templates/cove_ocds/explore_release.html:36 #, python-format msgid "This file contains %(count)s release" msgid_plural "This file contains %(count)s releases" msgstr[0] "" msgstr[1] "" -#: cove_ocds/templates/cove_ocds/explore_release.html:38 +#: cove_ocds/templates/cove_ocds/explore_release.html:37 #, python-format msgid " describing %(count)s contracting process" msgid_plural " describing %(count)s contracting processes." msgstr[0] "" msgstr[1] "" -#: cove_ocds/templates/cove_ocds/explore_release.html:64 +#: cove_ocds/templates/cove_ocds/explore_release.html:63 msgid "This file applies" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:64 +#: cove_ocds/templates/cove_ocds/explore_release.html:63 #, python-format msgid "%(count)s valid extension" msgid_plural " %(count)s valid extensions " msgstr[0] "" msgstr[1] "" -#: cove_ocds/templates/cove_ocds/explore_release.html:64 +#: cove_ocds/templates/cove_ocds/explore_release.html:63 msgid "to the schema" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:85 +#: cove_ocds/templates/cove_ocds/explore_release.html:84 #, python-format msgid "" "This file uses %(count)s deprecated field." @@ -793,220 +765,220 @@ msgid_plural "" msgstr[0] "" msgstr[1] "" -#: cove_ocds/templates/cove_ocds/explore_release.html:114 +#: cove_ocds/templates/cove_ocds/explore_release.html:113 msgid "Key Field Information" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:119 +#: cove_ocds/templates/cove_ocds/explore_release.html:118 msgid "Initiation Types: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:120 +#: cove_ocds/templates/cove_ocds/explore_release.html:119 msgid "Tags:" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:126 +#: cove_ocds/templates/cove_ocds/explore_release.html:125 msgid "Planning: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:127 +#: cove_ocds/templates/cove_ocds/explore_release.html:126 msgid "Tenders: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:129 +#: cove_ocds/templates/cove_ocds/explore_release.html:128 msgid "Awards: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:131 -#: cove_ocds/templates/cove_ocds/explore_release.html:137 -#: cove_ocds/templates/cove_ocds/explore_release.html:146 +#: cove_ocds/templates/cove_ocds/explore_release.html:130 +#: cove_ocds/templates/cove_ocds/explore_release.html:136 +#: cove_ocds/templates/cove_ocds/explore_release.html:145 msgid "Total Count: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:132 -#: cove_ocds/templates/cove_ocds/explore_release.html:138 -#: cove_ocds/templates/cove_ocds/explore_release.html:147 +#: cove_ocds/templates/cove_ocds/explore_release.html:131 +#: cove_ocds/templates/cove_ocds/explore_release.html:137 +#: cove_ocds/templates/cove_ocds/explore_release.html:146 msgid "Unique OCIDs: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:135 +#: cove_ocds/templates/cove_ocds/explore_release.html:134 msgid "Contracts: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:140 +#: cove_ocds/templates/cove_ocds/explore_release.html:139 msgid "Contracts with no awards: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:144 +#: cove_ocds/templates/cove_ocds/explore_release.html:143 msgid "Implementation: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:151 +#: cove_ocds/templates/cove_ocds/explore_release.html:150 msgid "Earliest release: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:152 +#: cove_ocds/templates/cove_ocds/explore_release.html:151 msgid "Latest release: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:153 +#: cove_ocds/templates/cove_ocds/explore_release.html:152 msgid "Earliest tender start: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:154 +#: cove_ocds/templates/cove_ocds/explore_release.html:153 msgid "Latest tender start: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:155 +#: cove_ocds/templates/cove_ocds/explore_release.html:154 msgid "Earliest award: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:156 +#: cove_ocds/templates/cove_ocds/explore_release.html:155 msgid "Latest award: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:157 +#: cove_ocds/templates/cove_ocds/explore_release.html:156 msgid "Earliest contract start: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:158 +#: cove_ocds/templates/cove_ocds/explore_release.html:157 msgid "Latest contract start: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:161 +#: cove_ocds/templates/cove_ocds/explore_release.html:160 msgid "Total Unique Organizations: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:163 +#: cove_ocds/templates/cove_ocds/explore_release.html:162 msgid "with address details: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:164 +#: cove_ocds/templates/cove_ocds/explore_release.html:163 msgid "with contact points: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:165 +#: cove_ocds/templates/cove_ocds/explore_release.html:164 msgid "that have identifiers: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:166 +#: cove_ocds/templates/cove_ocds/explore_release.html:165 msgid "using schemes: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:169 +#: cove_ocds/templates/cove_ocds/explore_release.html:168 msgid "Organization Roles: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:173 +#: cove_ocds/templates/cove_ocds/explore_release.html:172 msgid "Buyers: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:178 +#: cove_ocds/templates/cove_ocds/explore_release.html:177 msgid "Suppliers: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:183 +#: cove_ocds/templates/cove_ocds/explore_release.html:182 msgid "Procuring Entities: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:188 +#: cove_ocds/templates/cove_ocds/explore_release.html:187 msgid "Tenderers: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:193 +#: cove_ocds/templates/cove_ocds/explore_release.html:192 #: docs/code_examples/kfi-template-added.html:1 #: docs/code_examples/kfi-template-orig.html:1 msgid "Total Items: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:194 +#: cove_ocds/templates/cove_ocds/explore_release.html:193 #: docs/code_examples/kfi-template-added.html:2 msgid "Unique Item IDs: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:195 +#: cove_ocds/templates/cove_ocds/explore_release.html:194 #: docs/code_examples/kfi-template-added.html:3 #: docs/code_examples/kfi-template-orig.html:2 msgid "Items ID schemes: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:196 +#: cove_ocds/templates/cove_ocds/explore_release.html:195 msgid "Item Types: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:198 +#: cove_ocds/templates/cove_ocds/explore_release.html:197 msgid "Tender: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:199 +#: cove_ocds/templates/cove_ocds/explore_release.html:198 msgid "Award: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:200 +#: cove_ocds/templates/cove_ocds/explore_release.html:199 msgid "Contract: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:203 +#: cove_ocds/templates/cove_ocds/explore_release.html:202 msgid "Languages: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:204 +#: cove_ocds/templates/cove_ocds/explore_release.html:203 msgid "Currencies: " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:222 +#: cove_ocds/templates/cove_ocds/explore_release.html:221 msgid "Documents" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:227 +#: cove_ocds/templates/cove_ocds/explore_release.html:226 msgid "Part of Contracting Process" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:228 +#: cove_ocds/templates/cove_ocds/explore_release.html:227 msgid "Count of Docs" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:229 +#: cove_ocds/templates/cove_ocds/explore_release.html:228 msgid "Document Types" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:235 +#: cove_ocds/templates/cove_ocds/explore_release.html:234 msgid "Planning" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:247 +#: cove_ocds/templates/cove_ocds/explore_release.html:246 msgid "Tender" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:259 +#: cove_ocds/templates/cove_ocds/explore_release.html:258 msgid "Tender Milestones" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:271 +#: cove_ocds/templates/cove_ocds/explore_release.html:270 msgid "Awards" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:283 +#: cove_ocds/templates/cove_ocds/explore_release.html:282 msgid "Contracts" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:295 +#: cove_ocds/templates/cove_ocds/explore_release.html:294 msgid "Implementation" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:307 +#: cove_ocds/templates/cove_ocds/explore_release.html:306 msgid "Implementation Milestones" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:327 +#: cove_ocds/templates/cove_ocds/explore_release.html:326 msgid "Statistics cannot be produced as data is not structurally correct." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:341 +#: cove_ocds/templates/cove_ocds/explore_release.html:340 msgid "Releases Table:" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:347 +#: cove_ocds/templates/cove_ocds/explore_release.html:346 #, python-format msgid "" "Showing the first %(releases_or_records_table_length)s releases. To explore " @@ -1014,55 +986,55 @@ msgid "" "\"Convert\" section, above." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:354 +#: cove_ocds/templates/cove_ocds/explore_release.html:353 msgid "Release Date" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:355 +#: cove_ocds/templates/cove_ocds/explore_release.html:354 msgid "Tags" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:356 +#: cove_ocds/templates/cove_ocds/explore_release.html:355 msgid "Descriptions" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:357 +#: cove_ocds/templates/cove_ocds/explore_release.html:356 msgid "Purchasers" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:369 +#: cove_ocds/templates/cove_ocds/explore_release.html:368 msgid "Tender Title:" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:372 +#: cove_ocds/templates/cove_ocds/explore_release.html:371 msgid "Tender Description:" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:376 +#: cove_ocds/templates/cove_ocds/explore_release.html:375 msgid "Tender Item Description:" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:381 +#: cove_ocds/templates/cove_ocds/explore_release.html:380 msgid "Award Title:" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:384 +#: cove_ocds/templates/cove_ocds/explore_release.html:383 msgid "Award Description:" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:389 +#: cove_ocds/templates/cove_ocds/explore_release.html:388 msgid "Contract Title:" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:392 +#: cove_ocds/templates/cove_ocds/explore_release.html:391 msgid "Contract Description:" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:400 +#: cove_ocds/templates/cove_ocds/explore_release.html:399 msgid "Buyer:" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:406 +#: cove_ocds/templates/cove_ocds/explore_release.html:405 msgid "Procuring Entity:" msgstr "" @@ -1355,18 +1327,18 @@ msgid "" "reference/#date\">dates in OCDS." msgstr "" -#: cove_ocds/util.py:20 cove_ocds/util.py:39 cove_ocds/util.py:57 -#: cove_ocds/views.py:112 +#: cove_ocds/util.py:19 cove_ocds/util.py:38 cove_ocds/util.py:56 +#: cove_ocds/views.py:111 msgid "Sorry, we can't process that data" msgstr "" -#: cove_ocds/util.py:23 cove_ocds/util.py:42 cove_ocds/util.py:59 -#: cove_ocds/util.py:85 cove_ocds/util.py:108 cove_ocds/util.py:127 -#: cove_ocds/views.py:114 cove_ocds/views.py:149 +#: cove_ocds/util.py:22 cove_ocds/util.py:41 cove_ocds/util.py:58 +#: cove_ocds/util.py:84 cove_ocds/util.py:107 cove_ocds/util.py:126 +#: cove_ocds/views.py:113 cove_ocds/views.py:148 msgid "Try Again" msgstr "" -#: cove_ocds/util.py:26 +#: cove_ocds/util.py:25 msgid "" "The file that you uploaded doesn't appear to be well formed JSON. OCDS JSON " "follows the I-JSON format, which requires UTF-8 encoding. Ensure that your " @@ -1376,7 +1348,7 @@ msgid "" "span> Error message: {}" msgstr "" -#: cove_ocds/util.py:45 +#: cove_ocds/util.py:44 msgid "" "We think you tried to upload a JSON file, but it is not well formed JSON.\n" "\n" @@ -1384,17 +1356,17 @@ msgid "" "span> Error message: {}" msgstr "" -#: cove_ocds/util.py:60 +#: cove_ocds/util.py:59 msgid "" "OCDS JSON should have an object as the top level, the JSON you supplied does " "not." msgstr "" -#: cove_ocds/util.py:82 cove_ocds/util.py:83 +#: cove_ocds/util.py:81 cove_ocds/util.py:82 msgid "Missing OCDS package" msgstr "" -#: cove_ocds/util.py:88 +#: cove_ocds/util.py:87 msgid "" "We could not detect a package structure at the top-level of your data. OCDS " "releases and records should be published within a Error message: Missing OCDS package" msgstr "" -#: cove_ocds/util.py:105 +#: cove_ocds/util.py:104 msgid "Unrecognised version of the schema" msgstr "" -#: cove_ocds/util.py:106 cove_ocds/util.py:125 +#: cove_ocds/util.py:105 cove_ocds/util.py:124 #, python-format msgid "%(version)s is not a known schema version" msgstr "" -#: cove_ocds/util.py:111 +#: cove_ocds/util.py:110 msgid "" "We think you tried to run your data against an unrecognised version of the " "schema.\n" @@ -1428,11 +1400,11 @@ msgid "" "for the schema version" msgstr "" -#: cove_ocds/util.py:124 +#: cove_ocds/util.py:123 msgid "Version format does not comply with the schema" msgstr "" -#: cove_ocds/util.py:130 +#: cove_ocds/util.py:129 msgid "" "The value for the \"version\" field in your data follows the " "major.minor.patch pattern but according to the schema the patch " @@ -1447,12 +1419,12 @@ msgid "" "with the schema" msgstr "" -#: cove_ocds/util.py:144 +#: cove_ocds/util.py:143 #, python-format msgid "%(version)s (not a string)" msgstr "" -#: cove_ocds/views.py:118 +#: cove_ocds/views.py:117 msgid "" "The table isn't structured correctly. For example, a JSON Pointer " "(tender) can't be both a value (tender), a path to " @@ -1463,11 +1435,11 @@ msgid "" "span> Error message: {}" msgstr "" -#: cove_ocds/views.py:147 +#: cove_ocds/views.py:146 msgid "JSON reference error" msgstr "" -#: cove_ocds/views.py:159 +#: cove_ocds/views.py:158 #, python-format msgid "%(error)s" msgstr "" diff --git a/cove_ocds/locale/es/LC_MESSAGES/django.po b/cove_ocds/locale/es/LC_MESSAGES/django.po index 3643c53b..67c89bc4 100644 --- a/cove_ocds/locale/es/LC_MESSAGES/django.po +++ b/cove_ocds/locale/es/LC_MESSAGES/django.po @@ -15,7 +15,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-19 04:51+0000\n" +"POT-Creation-Date: 2024-10-19 05:34+0000\n" "PO-Revision-Date: 2020-09-08 08:53+0000\n" "Last-Translator: James McKinney, 2024\n" "Language-Team: Spanish (https://app.transifex.com/open-contracting-" @@ -52,7 +52,7 @@ msgstr "ver todos" #. Translators: Label of a button that triggers search #: cove_ocds/templates/cove_ocds/base.html:54 -#: cove_ocds/templates/cove_ocds/explore_base.html:52 +#: cove_ocds/templates/cove_ocds/explore_base.html:46 msgid "Go" msgstr "Ir" @@ -277,11 +277,11 @@ msgstr "" msgid "Load New File" msgstr "Cargar archivo nuevo" -#: cove_ocds/templates/cove_ocds/explore_base.html:24 +#: cove_ocds/templates/cove_ocds/explore_base.html:18 msgid "Schema" msgstr "Esquema" -#: cove_ocds/templates/cove_ocds/explore_base.html:29 +#: cove_ocds/templates/cove_ocds/explore_base.html:23 #, python-format msgid "" "Your data specifies a version %(unrecognized_version_data)s " @@ -292,7 +292,7 @@ msgstr "" "strong>que no es reconocida. Por esta razón, se ha verificado en relación a " "la versión actual por defecto." -#: cove_ocds/templates/cove_ocds/explore_base.html:32 +#: cove_ocds/templates/cove_ocds/explore_base.html:26 #, python-format msgid "" "This data has been checked against OCDS " @@ -301,7 +301,7 @@ msgstr "" "Este dato ha sido verificado con la versión " "%(version_used_display)sdel paquete del esquema %(release_or_record)s" -#: cove_ocds/templates/cove_ocds/explore_base.html:32 +#: cove_ocds/templates/cove_ocds/explore_base.html:26 msgid "" "You can choose a different version of the schema to check and explore your " "data." @@ -309,13 +309,13 @@ msgstr "" "Puede elegir una versión diferente del esquema para verificar y explorar sus " "datos." -#: cove_ocds/templates/cove_ocds/explore_base.html:34 +#: cove_ocds/templates/cove_ocds/explore_base.html:28 msgid "Check and explore same data against a different version of the schema" msgstr "" "Verifique y explore los mismos datos en relación a una versión diferente del " "esquema" -#: cove_ocds/templates/cove_ocds/explore_base.html:37 +#: cove_ocds/templates/cove_ocds/explore_base.html:31 msgid "" "Switching the schema version will result in changes to CoVE output and " "conversions. If you revisit or share this URL, the latest version selected " @@ -325,11 +325,11 @@ msgstr "" "conversiones del CoVE. Si vuelve a visitar o compartir esta URL, la última " "versión seleccionada se utilizará para verificar sus datos." -#: cove_ocds/templates/cove_ocds/explore_base.html:64 +#: cove_ocds/templates/cove_ocds/explore_base.html:58 msgid "Convert" msgstr "Convertir" -#: cove_ocds/templates/cove_ocds/explore_base.html:71 +#: cove_ocds/templates/cove_ocds/explore_base.html:65 msgid "" "There were conversion warnings when " "processing your file. The converted data may not represent your data as you " @@ -339,38 +339,38 @@ msgstr "" "procesar su archivo. Los datos convertidos puede que no representen sus " "datos como lo desea. " -#: cove_ocds/templates/cove_ocds/explore_base.html:74 +#: cove_ocds/templates/cove_ocds/explore_base.html:68 msgid "We have tried to convert your JSON into a spreadsheet format." msgstr "Hemos intentado convertir su JSON a un formato de hoja de cálculo." -#: cove_ocds/templates/cove_ocds/explore_base.html:74 -#: cove_ocds/templates/cove_ocds/explore_base.html:98 +#: cove_ocds/templates/cove_ocds/explore_base.html:68 +#: cove_ocds/templates/cove_ocds/explore_base.html:92 msgid "The results can be seen below." msgstr "Los resultados se pueden ver a continuación." -#: cove_ocds/templates/cove_ocds/explore_base.html:81 -#: cove_ocds/templates/cove_ocds/explore_base.html:86 -#: cove_ocds/templates/cove_ocds/explore_base.html:112 +#: cove_ocds/templates/cove_ocds/explore_base.html:75 +#: cove_ocds/templates/cove_ocds/explore_base.html:80 +#: cove_ocds/templates/cove_ocds/explore_base.html:106 msgid "using schema version" msgstr "usando versión del esquema" -#: cove_ocds/templates/cove_ocds/explore_base.html:92 +#: cove_ocds/templates/cove_ocds/explore_base.html:86 msgid "The JSON could not be converted to Spreadsheet due to the error:" msgstr "El JSON no se pudo convertir a hoja de cálculo debido al error:" -#: cove_ocds/templates/cove_ocds/explore_base.html:98 +#: cove_ocds/templates/cove_ocds/explore_base.html:92 msgid "We have tried to convert your data into JSON format." msgstr "Hemos intentado convertir sus datos a formato JSON." -#: cove_ocds/templates/cove_ocds/explore_base.html:124 +#: cove_ocds/templates/cove_ocds/explore_base.html:118 msgid "Convert to Spreadsheet" msgstr "Convertir a hoja de cálculo" -#: cove_ocds/templates/cove_ocds/explore_base.html:145 +#: cove_ocds/templates/cove_ocds/explore_base.html:139 msgid "Schema Extensions" msgstr "Extensiones del Esquema" -#: cove_ocds/templates/cove_ocds/explore_base.html:151 +#: cove_ocds/templates/cove_ocds/explore_base.html:145 msgid "" "Your data has been checked against schema version 1.0 and " "includes extensions but extensions were not introduced in the schema until " @@ -380,38 +380,38 @@ msgstr "" "incluyen extensiones, pero no se introdujeron extensiones en el esquema " "hasta la versión 1.1 ." -#: cove_ocds/templates/cove_ocds/explore_base.html:154 +#: cove_ocds/templates/cove_ocds/explore_base.html:148 msgid "Your data contains the following schema extensions" msgstr "Los datos contienen las siguientes extensiones de esquema" -#: cove_ocds/templates/cove_ocds/explore_base.html:154 +#: cove_ocds/templates/cove_ocds/explore_base.html:148 msgid ", but it wasn't possible to fetch them" msgstr ", pero no fue posible recuperarlos " -#: cove_ocds/templates/cove_ocds/explore_base.html:160 +#: cove_ocds/templates/cove_ocds/explore_base.html:154 msgid "release schema" msgstr "esquema de entrega" -#: cove_ocds/templates/cove_ocds/explore_base.html:177 +#: cove_ocds/templates/cove_ocds/explore_base.html:171 msgid "The following extensions failed:" msgstr "Las siguientes extensiones fallaron:" -#: cove_ocds/templates/cove_ocds/explore_base.html:187 +#: cove_ocds/templates/cove_ocds/explore_base.html:181 msgid "" "Only those extensions successfully fetched were applied to extend the schema." msgstr "" "Solo las extensiones obtenidas con éxito se aplicaron para ampliar el " "esquema." -#: cove_ocds/templates/cove_ocds/explore_base.html:189 +#: cove_ocds/templates/cove_ocds/explore_base.html:183 msgid "All the extensions above were applied to extend the schema." msgstr "Todas las extensiones anteriores se aplicaron para ampliar el esquema." -#: cove_ocds/templates/cove_ocds/explore_base.html:191 +#: cove_ocds/templates/cove_ocds/explore_base.html:185 msgid "Get a copy of the schema with extension patches applied" msgstr "Obtenga una copia del esquema con los parches de extensión aplicados" -#: cove_ocds/templates/cove_ocds/explore_base.html:193 +#: cove_ocds/templates/cove_ocds/explore_base.html:187 msgid "" "None of the extensions above could be applied. Your data has been checked " "against a schema with no extensions." @@ -419,12 +419,12 @@ msgstr "" "No se pudo aplicar ninguna de las extensiones anteriores. Sus datos han sido " "comparados con un esquema sin extensiones." -#: cove_ocds/templates/cove_ocds/explore_base.html:206 +#: cove_ocds/templates/cove_ocds/explore_base.html:200 msgid "Conversion Errors" msgstr "Errores de Conversión" -#: cove_ocds/templates/cove_ocds/explore_base.html:211 -#: cove_ocds/templates/cove_ocds/explore_base.html:233 +#: cove_ocds/templates/cove_ocds/explore_base.html:205 +#: cove_ocds/templates/cove_ocds/explore_base.html:227 msgid "" "In order to check your data we need to convert it. During that conversion we " "found the following issues:" @@ -432,65 +432,65 @@ msgstr "" "Para verificar sus datos, necesitamos convertirlos. Durante esta conversión, " "encontramos los siguientes problemas:" -#: cove_ocds/templates/cove_ocds/explore_base.html:228 +#: cove_ocds/templates/cove_ocds/explore_base.html:222 msgid "Conversion Errors (titles)" msgstr "Errores de Conversión (títulos)" -#: cove_ocds/templates/cove_ocds/explore_base.html:256 +#: cove_ocds/templates/cove_ocds/explore_base.html:250 msgid "Structural Errors - Required Fields" msgstr "Errores Estructurales - Campos Requeridos" -#: cove_ocds/templates/cove_ocds/explore_base.html:260 +#: cove_ocds/templates/cove_ocds/explore_base.html:254 msgid "" "Some or all of your data is missing fields which are required by the OCDS " "schema." msgstr "" "En alguno o todos tus datos faltan campos requeridos por el esquema OCDS." -#: cove_ocds/templates/cove_ocds/explore_base.html:280 +#: cove_ocds/templates/cove_ocds/explore_base.html:274 msgid "Structural Errors - Format" msgstr "Errores Estructurales - Formato" -#: cove_ocds/templates/cove_ocds/explore_base.html:284 +#: cove_ocds/templates/cove_ocds/explore_base.html:278 msgid "" "Some or all of your data includes fields which are incorrectly formatted." msgstr "" "Alguno o todos tus datos incluyen campos que están formateados " "incorrectamente." -#: cove_ocds/templates/cove_ocds/explore_base.html:304 +#: cove_ocds/templates/cove_ocds/explore_base.html:298 msgid "Structural Errors - Other" msgstr "Errores Estructurales - Otro" -#: cove_ocds/templates/cove_ocds/explore_base.html:308 +#: cove_ocds/templates/cove_ocds/explore_base.html:302 msgid "Some or all of your data has validation errors." msgstr "Alguno o todos tus datos tienen errores de validación." -#: cove_ocds/templates/cove_ocds/explore_base.html:321 -#: cove_ocds/templates/cove_ocds/explore_base.html:493 -#: cove_ocds/templates/cove_ocds/explore_base.html:496 +#: cove_ocds/templates/cove_ocds/explore_base.html:315 +#: cove_ocds/templates/cove_ocds/explore_base.html:487 +#: cove_ocds/templates/cove_ocds/explore_base.html:490 msgid "Structure Warnings" msgstr "Advertencias de Estructura" -#: cove_ocds/templates/cove_ocds/explore_base.html:326 -#: cove_ocds/templates/cove_ocds/explore_base.html:348 +#: cove_ocds/templates/cove_ocds/explore_base.html:320 +#: cove_ocds/templates/cove_ocds/explore_base.html:342 msgid "" "Fixing the following issues will improve the interoperability of your data." msgstr "" "La resolución de los siguientes problemas mejorará la interoperabilidad de " "sus datos." -#: cove_ocds/templates/cove_ocds/explore_base.html:343 -#: cove_ocds/templates/cove_ocds/explore_base.html:481 -#: cove_ocds/templates/cove_ocds/explore_base.html:484 +#: cove_ocds/templates/cove_ocds/explore_base.html:337 +#: cove_ocds/templates/cove_ocds/explore_base.html:475 +#: cove_ocds/templates/cove_ocds/explore_base.html:478 msgid "Conformance (Rules)" msgstr "Conformidad (Reglas)" -#: cove_ocds/templates/cove_ocds/explore_base.html:365 +#: cove_ocds/templates/cove_ocds/explore_base.html:359 msgid "Codelist Errors" msgstr "Errores de la Lista de Códigos" -#: cove_ocds/templates/cove_ocds/explore_base.html:370 +#: cove_ocds/templates/cove_ocds/explore_base.html:364 msgid "" "The fields below use closed codelists. When using these fields, you " "must use one of the pre-defined codelist values. If you use a " @@ -506,7 +506,7 @@ msgstr "" "+ o - esto indica que la lista de códigos ha sido modificada con estas " "adiciones (+) o sustracciones (-) por una o más extensiones." -#: cove_ocds/templates/cove_ocds/explore_base.html:374 +#: cove_ocds/templates/cove_ocds/explore_base.html:368 msgid "" "You may need to create a mapping between your local codes and the OCDS " "closed codelists to address these errors. In most cases, there will be a " @@ -520,11 +520,11 @@ msgstr "" "códigos locales. Si ya ha completado un mapeo, favor revise la ortografía y " "las mayúsculas utilizadas en estos campos cerrados de la lista de códigos." -#: cove_ocds/templates/cove_ocds/explore_base.html:385 +#: cove_ocds/templates/cove_ocds/explore_base.html:379 msgid "Additional Fields" msgstr "Campos adicionales" -#: cove_ocds/templates/cove_ocds/explore_base.html:389 +#: cove_ocds/templates/cove_ocds/explore_base.html:383 msgid "" "This data includes the following fields which are not part of the OCDS " "schema. You should check whether the data in these fields could be provided " @@ -538,11 +538,11 @@ msgstr "" "standard.open-contracting.org/latest/en/extensions/\">extensión " "existente del esquema." -#: cove_ocds/templates/cove_ocds/explore_base.html:403 +#: cove_ocds/templates/cove_ocds/explore_base.html:397 msgid "Additional Codelist Values" msgstr "Valores Adicionales de Listas de Códigos" -#: cove_ocds/templates/cove_ocds/explore_base.html:407 +#: cove_ocds/templates/cove_ocds/explore_base.html:401 msgid "" "Your data contains a number of fields that use an open codelist. You should " "use values from the codelist whenever possible, but if the codelist does not " @@ -561,7 +561,7 @@ msgstr "" "de códigos ha sido modificada con estas adiciones (+) o sustracciones (-) " "por una o más extensiones." -#: cove_ocds/templates/cove_ocds/explore_base.html:413 +#: cove_ocds/templates/cove_ocds/explore_base.html:407 msgid "" "Make sure you list the definition of any additional codelist values you " "include within your gestor de " "incidencias de OCDS ." -#: cove_ocds/templates/cove_ocds/explore_base.html:423 +#: cove_ocds/templates/cove_ocds/explore_base.html:417 msgid "Additional Checks" msgstr "Comprobaciones adicionales" -#: cove_ocds/templates/cove_ocds/explore_base.html:437 -#: cove_ocds/templates/cove_ocds/explore_base.html:517 -#: cove_ocds/templates/cove_ocds/explore_base.html:520 +#: cove_ocds/templates/cove_ocds/explore_base.html:431 +#: cove_ocds/templates/cove_ocds/explore_base.html:511 +#: cove_ocds/templates/cove_ocds/explore_base.html:514 msgid "Deprecated Fields" msgstr "Campos Obsoletos" -#: cove_ocds/templates/cove_ocds/explore_base.html:437 +#: cove_ocds/templates/cove_ocds/explore_base.html:431 msgid "" "Fields flagged as 'deprecated' will be either replaced or removed in future " "versions of the schema." @@ -596,16 +596,16 @@ msgstr "" "Campos marcados como 'obsoletos' serán reemplazados o eliminados en futuras " "versiones del esquema." -#: cove_ocds/templates/cove_ocds/explore_base.html:453 +#: cove_ocds/templates/cove_ocds/explore_base.html:447 msgid "Save or Share these results" msgstr "Guardar o Compartir estos resultados" -#: cove_ocds/templates/cove_ocds/explore_base.html:454 +#: cove_ocds/templates/cove_ocds/explore_base.html:448 msgid "Use the following url to share these results:" msgstr "Use la siguiente url para compartir estos resultados: " #. Translators: Paragraph that describes the application -#: cove_ocds/templates/cove_ocds/explore_base.html:459 +#: cove_ocds/templates/cove_ocds/explore_base.html:453 #, python-format msgid "" "These results will be available for %(delete_files_after_days)s days from " @@ -616,7 +616,7 @@ msgstr "" "días desde el día en que los datos fueron subidos. Puede revisar estos " "resultados hasta entonces." -#: cove_ocds/templates/cove_ocds/explore_base.html:460 +#: cove_ocds/templates/cove_ocds/explore_base.html:454 #, python-format msgid "" "After %(delete_files_after_days)s days all uploaded data is deleted from our " @@ -629,43 +629,43 @@ msgstr "" "Cualquiera que use el enlace a esta página después de ese periodo verá un " "mensaje informando de que el archivo ha sido borrado." -#: cove_ocds/templates/cove_ocds/explore_base.html:475 -#: cove_ocds/templates/cove_ocds/explore_base.html:478 +#: cove_ocds/templates/cove_ocds/explore_base.html:469 +#: cove_ocds/templates/cove_ocds/explore_base.html:472 msgid "Structural Errors" msgstr "Errores Estructurales" -#: cove_ocds/templates/cove_ocds/explore_base.html:487 +#: cove_ocds/templates/cove_ocds/explore_base.html:481 msgid "view all errors ▼" msgstr "ver todos los errores ▼" -#: cove_ocds/templates/cove_ocds/explore_base.html:490 +#: cove_ocds/templates/cove_ocds/explore_base.html:484 +#: cove_ocds/templates/cove_ocds/explore_base.html:496 #: cove_ocds/templates/cove_ocds/explore_base.html:502 -#: cove_ocds/templates/cove_ocds/explore_base.html:508 msgid "View all errors ▲" msgstr "Vea todos los errores ▲" -#: cove_ocds/templates/cove_ocds/explore_base.html:499 +#: cove_ocds/templates/cove_ocds/explore_base.html:493 #: cove_ocds/templates/cove_ocds/ocds_missing_ids_table.html:6 #: cove_ocds/templates/cove_ocds/ocid_prefixes_table.html:5 msgid "View all errors ▼" msgstr "Vea todos los errores ▼" -#: cove_ocds/templates/cove_ocds/explore_base.html:505 +#: cove_ocds/templates/cove_ocds/explore_base.html:499 msgid "Quality Warnings" msgstr "Advertencias de Calidad" -#: cove_ocds/templates/cove_ocds/explore_base.html:511 -#: cove_ocds/templates/cove_ocds/explore_base.html:514 +#: cove_ocds/templates/cove_ocds/explore_base.html:505 +#: cove_ocds/templates/cove_ocds/explore_base.html:508 msgid "Additional Fields (fields in data not in schema)" msgstr "Campos adicionales (campos en los datos que no están en el esquema)" #: cove_ocds/templates/cove_ocds/explore_record.html:12 -#: cove_ocds/templates/cove_ocds/explore_release.html:11 +#: cove_ocds/templates/cove_ocds/explore_release.html:10 msgid "Headlines" msgstr "Titulares" #: cove_ocds/templates/cove_ocds/explore_record.html:17 -#: cove_ocds/templates/cove_ocds/explore_release.html:15 +#: cove_ocds/templates/cove_ocds/explore_release.html:14 msgid "" "Please read the conversion warnings " "below." @@ -674,17 +674,17 @@ msgstr "" "conversión más abajo." #: cove_ocds/templates/cove_ocds/explore_record.html:21 -#: cove_ocds/templates/cove_ocds/explore_release.html:19 +#: cove_ocds/templates/cove_ocds/explore_release.html:18 msgid "Failed " msgstr "Ha fallado " #: cove_ocds/templates/cove_ocds/explore_record.html:23 -#: cove_ocds/templates/cove_ocds/explore_release.html:21 +#: cove_ocds/templates/cove_ocds/explore_release.html:20 msgid "Passed " msgstr "Ha pasado " #: cove_ocds/templates/cove_ocds/explore_record.html:25 -#: cove_ocds/templates/cove_ocds/explore_release.html:23 +#: cove_ocds/templates/cove_ocds/explore_release.html:22 msgid "structural checks against " msgstr "comprobaciones estructurales contra" @@ -693,13 +693,13 @@ msgid "OCDS record package schema version" msgstr "Versión del esquema del paquete de registros OCDS" #: cove_ocds/templates/cove_ocds/explore_record.html:26 -#: cove_ocds/templates/cove_ocds/explore_release.html:24 +#: cove_ocds/templates/cove_ocds/explore_release.html:23 msgid "See Structural Errors below." msgstr "" "Ver Errores Estructurales más abajo." #: cove_ocds/templates/cove_ocds/explore_record.html:30 -#: cove_ocds/templates/cove_ocds/explore_release.html:33 +#: cove_ocds/templates/cove_ocds/explore_release.html:32 msgid "At a glance" msgstr "De un vistazo" @@ -712,7 +712,7 @@ msgstr[1] "Este archivo contiene %(count)s registros." msgstr[2] "Este archivo contiene %(count)s registros." #: cove_ocds/templates/cove_ocds/explore_record.html:39 -#: cove_ocds/templates/cove_ocds/explore_release.html:43 +#: cove_ocds/templates/cove_ocds/explore_release.html:42 msgid "The schema version specified in the file is" msgstr "La versión del esquema especificada en el archivo es " @@ -725,22 +725,22 @@ msgstr[1] "Hay %(count)s es OCIDs únicas." msgstr[2] "Hay %(count)s es OCIDs únicas." #: cove_ocds/templates/cove_ocds/explore_record.html:47 -#: cove_ocds/templates/cove_ocds/explore_release.html:48 +#: cove_ocds/templates/cove_ocds/explore_release.html:47 msgid "The publisher named in the file is" msgstr "El publicador nombrado en el archivo es" #: cove_ocds/templates/cove_ocds/explore_record.html:52 -#: cove_ocds/templates/cove_ocds/explore_release.html:53 +#: cove_ocds/templates/cove_ocds/explore_release.html:52 msgid "The license is" msgstr "La licencia es " #: cove_ocds/templates/cove_ocds/explore_record.html:57 -#: cove_ocds/templates/cove_ocds/explore_release.html:58 +#: cove_ocds/templates/cove_ocds/explore_release.html:57 msgid "Publication policy is" msgstr "Una política de publicación es" #: cove_ocds/templates/cove_ocds/explore_record.html:63 -#: cove_ocds/templates/cove_ocds/explore_release.html:70 +#: cove_ocds/templates/cove_ocds/explore_release.html:69 #, python-format msgid "" "There is %(count)s duplicate release ID in " @@ -760,7 +760,7 @@ msgstr[2] "" "este paquete." #: cove_ocds/templates/cove_ocds/explore_record.html:69 -#: cove_ocds/templates/cove_ocds/explore_release.html:75 +#: cove_ocds/templates/cove_ocds/explore_release.html:74 #, python-format msgid "" "This file uses %(count)s additional field " @@ -780,32 +780,32 @@ msgstr[2] "" "adicionalesno incluidos en el estándar." #: cove_ocds/templates/cove_ocds/explore_record.html:74 -#: cove_ocds/templates/cove_ocds/explore_release.html:80 +#: cove_ocds/templates/cove_ocds/explore_release.html:79 msgid "This file is not 'utf-8' encoded (it is" msgstr "Este archivo no ha sido codificado con 'utf-8' (ha sido " #: cove_ocds/templates/cove_ocds/explore_record.html:74 -#: cove_ocds/templates/cove_ocds/explore_release.html:80 +#: cove_ocds/templates/cove_ocds/explore_release.html:79 msgid "encoded)." msgstr "codificado)." #: cove_ocds/templates/cove_ocds/explore_record.html:78 -#: cove_ocds/templates/cove_ocds/explore_release.html:89 +#: cove_ocds/templates/cove_ocds/explore_release.html:88 msgid "Data " msgstr "Datos " #: cove_ocds/templates/cove_ocds/explore_record.html:80 -#: cove_ocds/templates/cove_ocds/explore_release.html:91 +#: cove_ocds/templates/cove_ocds/explore_release.html:90 msgid "downloaded from " msgstr "descargado desde " #: cove_ocds/templates/cove_ocds/explore_record.html:82 -#: cove_ocds/templates/cove_ocds/explore_release.html:93 +#: cove_ocds/templates/cove_ocds/explore_release.html:92 msgid "uploaded " msgstr "subido " #: cove_ocds/templates/cove_ocds/explore_record.html:84 -#: cove_ocds/templates/cove_ocds/explore_release.html:95 +#: cove_ocds/templates/cove_ocds/explore_release.html:94 msgid "on " msgstr "el " @@ -846,53 +846,15 @@ msgstr "Mostrando los primeros %(releases_or_records_table_length)s registros." msgid "release count" msgstr "cantidad de entregas" -#: cove_ocds/templates/cove_ocds/explore_record.html:185 -#: cove_ocds/templates/cove_ocds/explore_release.html:428 -msgid "Explore your data:" -msgstr "Explora tus datos:" - -#: cove_ocds/templates/cove_ocds/explore_record.html:190 -#: cove_ocds/templates/cove_ocds/explore_release.html:433 -msgid "" -"This section provides a visual representation of the data, use it to check " -"whether the data makes sense in the type of tool a user might use to explore " -"it." -msgstr "" -"Esta sección proporciona una representación visual de los datos, utilícela " -"para verificar si tienen sentido en el tipo de herramienta que un usuario " -"podría usar para explorarlos." - -#: cove_ocds/templates/cove_ocds/explore_record.html:193 -#: cove_ocds/templates/cove_ocds/explore_release.html:436 -msgid "" -"Extensions and additional fields are hidden by default, click the 'Extra " -"fields' buttons or open the 'Extra fields' section to view them." -msgstr "" -"Las extensiones y los campos adicionales están ocultos por defecto, haga " -"clic en los botones \"Campos adicionales\" o abra la sección \"Campos " -"adicionales\" para verlos." - -#: cove_ocds/templates/cove_ocds/explore_record.html:196 -#: cove_ocds/templates/cove_ocds/explore_release.html:439 -msgid "" -"When viewing an OCDS record, use the numbers at the top of the visualization " -"to browse the change history. New and changed fields are highlighted, use " -"this feature to check whether any fields have changed unexpectedly." -msgstr "" -"Al ver un registro de OCDS, use los números en la parte superior de la " -"visualización para navegar en el historial de cambios. Los campos nuevos y " -"modificados están resaltados, use esta función para verificar si alguno de " -"los campos ha cambiado inesperadamente." - -#: cove_ocds/templates/cove_ocds/explore_release.html:23 +#: cove_ocds/templates/cove_ocds/explore_release.html:22 msgid "OCDS release package schema version" msgstr "Versión del esquema del paquete de entrega de OCDS" -#: cove_ocds/templates/cove_ocds/explore_release.html:28 +#: cove_ocds/templates/cove_ocds/explore_release.html:27 msgid "Failed to apply " msgstr " Ha fallado al aplicar" -#: cove_ocds/templates/cove_ocds/explore_release.html:28 +#: cove_ocds/templates/cove_ocds/explore_release.html:27 #, python-format msgid " %(count)s extension " msgid_plural "%(count)s extensions " @@ -900,14 +862,14 @@ msgstr[0] "%(count)s extensión" msgstr[1] "%(count)s extensiones" msgstr[2] "%(count)s extensiones" -#: cove_ocds/templates/cove_ocds/explore_release.html:28 +#: cove_ocds/templates/cove_ocds/explore_release.html:27 msgid "" " to the schema.
See Extensions below." msgstr "" "al esquema.
Vea Extensiones más " "abajo." -#: cove_ocds/templates/cove_ocds/explore_release.html:37 +#: cove_ocds/templates/cove_ocds/explore_release.html:36 #, python-format msgid "This file contains %(count)s release" msgid_plural "This file contains %(count)s releases" @@ -915,7 +877,7 @@ msgstr[0] "Este archivo contiene una entrega" msgstr[1] "Este archivo contiene %(count)s entregas" msgstr[2] "Este archivo contiene %(count)s entregas" -#: cove_ocds/templates/cove_ocds/explore_release.html:38 +#: cove_ocds/templates/cove_ocds/explore_release.html:37 #, python-format msgid " describing %(count)s contracting process" msgid_plural " describing %(count)s contracting processes." @@ -923,11 +885,11 @@ msgstr[0] "describiendo un proceso de contratación" msgstr[1] "describiendo %(count)s procesos de contratación." msgstr[2] "describiendo %(count)s procesos de contratación." -#: cove_ocds/templates/cove_ocds/explore_release.html:64 +#: cove_ocds/templates/cove_ocds/explore_release.html:63 msgid "This file applies" msgstr "Este archivo incorpora " -#: cove_ocds/templates/cove_ocds/explore_release.html:64 +#: cove_ocds/templates/cove_ocds/explore_release.html:63 #, python-format msgid "%(count)s valid extension" msgid_plural " %(count)s valid extensions " @@ -937,11 +899,11 @@ msgstr[1] "" msgstr[2] "" "%(count)s extensiones válidas " -#: cove_ocds/templates/cove_ocds/explore_release.html:64 +#: cove_ocds/templates/cove_ocds/explore_release.html:63 msgid "to the schema" msgstr "al esquema" -#: cove_ocds/templates/cove_ocds/explore_release.html:85 +#: cove_ocds/templates/cove_ocds/explore_release.html:84 #, python-format msgid "" "This file uses %(count)s deprecated field." @@ -957,222 +919,222 @@ msgstr[2] "" "Este archivo usa %(count)s campos " "obsoletos." -#: cove_ocds/templates/cove_ocds/explore_release.html:114 +#: cove_ocds/templates/cove_ocds/explore_release.html:113 msgid "Key Field Information" msgstr "Información de Campos Clave" -#: cove_ocds/templates/cove_ocds/explore_release.html:119 +#: cove_ocds/templates/cove_ocds/explore_release.html:118 msgid "Initiation Types: " msgstr "Tipos de iniciación:" -#: cove_ocds/templates/cove_ocds/explore_release.html:120 +#: cove_ocds/templates/cove_ocds/explore_release.html:119 msgid "Tags:" msgstr "Etiquetas:" -#: cove_ocds/templates/cove_ocds/explore_release.html:126 +#: cove_ocds/templates/cove_ocds/explore_release.html:125 msgid "Planning: " msgstr "Planificación:" -#: cove_ocds/templates/cove_ocds/explore_release.html:127 +#: cove_ocds/templates/cove_ocds/explore_release.html:126 msgid "Tenders: " msgstr "Licitaciones:" -#: cove_ocds/templates/cove_ocds/explore_release.html:129 +#: cove_ocds/templates/cove_ocds/explore_release.html:128 msgid "Awards: " msgstr "Adjudicaciones:" -#: cove_ocds/templates/cove_ocds/explore_release.html:131 -#: cove_ocds/templates/cove_ocds/explore_release.html:137 -#: cove_ocds/templates/cove_ocds/explore_release.html:146 +#: cove_ocds/templates/cove_ocds/explore_release.html:130 +#: cove_ocds/templates/cove_ocds/explore_release.html:136 +#: cove_ocds/templates/cove_ocds/explore_release.html:145 msgid "Total Count: " msgstr "Total:" -#: cove_ocds/templates/cove_ocds/explore_release.html:132 -#: cove_ocds/templates/cove_ocds/explore_release.html:138 -#: cove_ocds/templates/cove_ocds/explore_release.html:147 +#: cove_ocds/templates/cove_ocds/explore_release.html:131 +#: cove_ocds/templates/cove_ocds/explore_release.html:137 +#: cove_ocds/templates/cove_ocds/explore_release.html:146 msgid "Unique OCIDs: " msgstr "OCIDs únicas:" -#: cove_ocds/templates/cove_ocds/explore_release.html:135 +#: cove_ocds/templates/cove_ocds/explore_release.html:134 msgid "Contracts: " msgstr "Contratos:" -#: cove_ocds/templates/cove_ocds/explore_release.html:140 +#: cove_ocds/templates/cove_ocds/explore_release.html:139 msgid "Contracts with no awards: " msgstr "Contratos sin adjudicaciones:" -#: cove_ocds/templates/cove_ocds/explore_release.html:144 +#: cove_ocds/templates/cove_ocds/explore_release.html:143 msgid "Implementation: " msgstr "Implementación:" -#: cove_ocds/templates/cove_ocds/explore_release.html:151 +#: cove_ocds/templates/cove_ocds/explore_release.html:150 msgid "Earliest release: " msgstr "Apertura de entrega:" -#: cove_ocds/templates/cove_ocds/explore_release.html:152 +#: cove_ocds/templates/cove_ocds/explore_release.html:151 msgid "Latest release: " msgstr "Última entrega:" -#: cove_ocds/templates/cove_ocds/explore_release.html:153 +#: cove_ocds/templates/cove_ocds/explore_release.html:152 msgid "Earliest tender start: " msgstr "Apertura de inicio de licitación:" -#: cove_ocds/templates/cove_ocds/explore_release.html:154 +#: cove_ocds/templates/cove_ocds/explore_release.html:153 msgid "Latest tender start: " msgstr "Último inicio de licitación:" -#: cove_ocds/templates/cove_ocds/explore_release.html:155 +#: cove_ocds/templates/cove_ocds/explore_release.html:154 msgid "Earliest award: " msgstr "Apertura de adjudicación:" -#: cove_ocds/templates/cove_ocds/explore_release.html:156 +#: cove_ocds/templates/cove_ocds/explore_release.html:155 msgid "Latest award: " msgstr "Última adjudicación:" -#: cove_ocds/templates/cove_ocds/explore_release.html:157 +#: cove_ocds/templates/cove_ocds/explore_release.html:156 msgid "Earliest contract start: " msgstr "Apertura de inicio del contrato:" -#: cove_ocds/templates/cove_ocds/explore_release.html:158 +#: cove_ocds/templates/cove_ocds/explore_release.html:157 msgid "Latest contract start: " msgstr "Último inicio del contrato:" -#: cove_ocds/templates/cove_ocds/explore_release.html:161 +#: cove_ocds/templates/cove_ocds/explore_release.html:160 msgid "Total Unique Organizations: " msgstr "Número Total de Organizaciones Distintas:" -#: cove_ocds/templates/cove_ocds/explore_release.html:163 +#: cove_ocds/templates/cove_ocds/explore_release.html:162 msgid "with address details: " msgstr "con detalles de dirección:" -#: cove_ocds/templates/cove_ocds/explore_release.html:164 +#: cove_ocds/templates/cove_ocds/explore_release.html:163 msgid "with contact points: " msgstr "con puntos de contacto:" -#: cove_ocds/templates/cove_ocds/explore_release.html:165 +#: cove_ocds/templates/cove_ocds/explore_release.html:164 msgid "that have identifiers: " msgstr "que tienen identificadores:" -#: cove_ocds/templates/cove_ocds/explore_release.html:166 +#: cove_ocds/templates/cove_ocds/explore_release.html:165 msgid "using schemes: " msgstr "utilizando esquemas:" -#: cove_ocds/templates/cove_ocds/explore_release.html:169 +#: cove_ocds/templates/cove_ocds/explore_release.html:168 msgid "Organization Roles: " msgstr "Roles de la Organización:" -#: cove_ocds/templates/cove_ocds/explore_release.html:173 +#: cove_ocds/templates/cove_ocds/explore_release.html:172 msgid "Buyers: " msgstr "Compradores:" -#: cove_ocds/templates/cove_ocds/explore_release.html:178 +#: cove_ocds/templates/cove_ocds/explore_release.html:177 msgid "Suppliers: " msgstr "Proveedores:" -#: cove_ocds/templates/cove_ocds/explore_release.html:183 +#: cove_ocds/templates/cove_ocds/explore_release.html:182 msgid "Procuring Entities: " msgstr "Entidades Contratantes:" -#: cove_ocds/templates/cove_ocds/explore_release.html:188 +#: cove_ocds/templates/cove_ocds/explore_release.html:187 msgid "Tenderers: " msgstr "Llicitadores:" -#: cove_ocds/templates/cove_ocds/explore_release.html:193 +#: cove_ocds/templates/cove_ocds/explore_release.html:192 #: docs/code_examples/kfi-template-added.html:1 #: docs/code_examples/kfi-template-orig.html:1 msgid "Total Items: " msgstr "Número Total de Artículos:" -#: cove_ocds/templates/cove_ocds/explore_release.html:194 +#: cove_ocds/templates/cove_ocds/explore_release.html:193 #: docs/code_examples/kfi-template-added.html:2 msgid "Unique Item IDs: " msgstr "IDs de artículos únicos" -#: cove_ocds/templates/cove_ocds/explore_release.html:195 +#: cove_ocds/templates/cove_ocds/explore_release.html:194 #: docs/code_examples/kfi-template-added.html:3 #: docs/code_examples/kfi-template-orig.html:2 msgid "Items ID schemes: " msgstr "Esquemas de ID de artículos:" -#: cove_ocds/templates/cove_ocds/explore_release.html:196 +#: cove_ocds/templates/cove_ocds/explore_release.html:195 msgid "Item Types: " msgstr "Tipos de Artículos:" -#: cove_ocds/templates/cove_ocds/explore_release.html:198 +#: cove_ocds/templates/cove_ocds/explore_release.html:197 msgid "Tender: " msgstr "Licitación:" -#: cove_ocds/templates/cove_ocds/explore_release.html:199 +#: cove_ocds/templates/cove_ocds/explore_release.html:198 msgid "Award: " msgstr "Adjudicación:" -#: cove_ocds/templates/cove_ocds/explore_release.html:200 +#: cove_ocds/templates/cove_ocds/explore_release.html:199 msgid "Contract: " msgstr "Contrato:" -#: cove_ocds/templates/cove_ocds/explore_release.html:203 +#: cove_ocds/templates/cove_ocds/explore_release.html:202 msgid "Languages: " msgstr "Idiomas:" -#: cove_ocds/templates/cove_ocds/explore_release.html:204 +#: cove_ocds/templates/cove_ocds/explore_release.html:203 msgid "Currencies: " msgstr "Divisas:" -#: cove_ocds/templates/cove_ocds/explore_release.html:222 +#: cove_ocds/templates/cove_ocds/explore_release.html:221 msgid "Documents" msgstr "Documentos" -#: cove_ocds/templates/cove_ocds/explore_release.html:227 +#: cove_ocds/templates/cove_ocds/explore_release.html:226 msgid "Part of Contracting Process" msgstr "Parte del Proceso de Contratación" -#: cove_ocds/templates/cove_ocds/explore_release.html:228 +#: cove_ocds/templates/cove_ocds/explore_release.html:227 msgid "Count of Docs" msgstr "Total de Documentos" -#: cove_ocds/templates/cove_ocds/explore_release.html:229 +#: cove_ocds/templates/cove_ocds/explore_release.html:228 msgid "Document Types" msgstr "Tipos de Documentos" -#: cove_ocds/templates/cove_ocds/explore_release.html:235 +#: cove_ocds/templates/cove_ocds/explore_release.html:234 msgid "Planning" msgstr "Planificación" -#: cove_ocds/templates/cove_ocds/explore_release.html:247 +#: cove_ocds/templates/cove_ocds/explore_release.html:246 msgid "Tender" msgstr "Licitación" -#: cove_ocds/templates/cove_ocds/explore_release.html:259 +#: cove_ocds/templates/cove_ocds/explore_release.html:258 msgid "Tender Milestones" msgstr "Hitos de la Licitación" -#: cove_ocds/templates/cove_ocds/explore_release.html:271 +#: cove_ocds/templates/cove_ocds/explore_release.html:270 msgid "Awards" msgstr "Adjudicaciones" -#: cove_ocds/templates/cove_ocds/explore_release.html:283 +#: cove_ocds/templates/cove_ocds/explore_release.html:282 msgid "Contracts" msgstr "Contratos" -#: cove_ocds/templates/cove_ocds/explore_release.html:295 +#: cove_ocds/templates/cove_ocds/explore_release.html:294 msgid "Implementation" msgstr "Implementación" -#: cove_ocds/templates/cove_ocds/explore_release.html:307 +#: cove_ocds/templates/cove_ocds/explore_release.html:306 msgid "Implementation Milestones" msgstr "Hitos de ejecución" -#: cove_ocds/templates/cove_ocds/explore_release.html:327 +#: cove_ocds/templates/cove_ocds/explore_release.html:326 msgid "Statistics cannot be produced as data is not structurally correct." msgstr "" "No se pueden producir estadísticas porque los datos no son estructuralmente " "correctos." -#: cove_ocds/templates/cove_ocds/explore_release.html:341 +#: cove_ocds/templates/cove_ocds/explore_release.html:340 msgid "Releases Table:" msgstr "Tabla de Entregas:" -#: cove_ocds/templates/cove_ocds/explore_release.html:347 +#: cove_ocds/templates/cove_ocds/explore_release.html:346 #, python-format msgid "" "Showing the first %(releases_or_records_table_length)s releases. To explore " @@ -1183,55 +1145,55 @@ msgstr "" "Para explorar todos tus datos en formato tabular, conviértalos a una hoja de " "cálculo usando la sección \"Convertir\", arriba." -#: cove_ocds/templates/cove_ocds/explore_release.html:354 +#: cove_ocds/templates/cove_ocds/explore_release.html:353 msgid "Release Date" msgstr "Fecha de Entrega" -#: cove_ocds/templates/cove_ocds/explore_release.html:355 +#: cove_ocds/templates/cove_ocds/explore_release.html:354 msgid "Tags" msgstr "Etiquetas" -#: cove_ocds/templates/cove_ocds/explore_release.html:356 +#: cove_ocds/templates/cove_ocds/explore_release.html:355 msgid "Descriptions" msgstr "Descripciones" -#: cove_ocds/templates/cove_ocds/explore_release.html:357 +#: cove_ocds/templates/cove_ocds/explore_release.html:356 msgid "Purchasers" msgstr "Compradores" -#: cove_ocds/templates/cove_ocds/explore_release.html:369 +#: cove_ocds/templates/cove_ocds/explore_release.html:368 msgid "Tender Title:" msgstr "Título de la Licitación:" -#: cove_ocds/templates/cove_ocds/explore_release.html:372 +#: cove_ocds/templates/cove_ocds/explore_release.html:371 msgid "Tender Description:" msgstr "Descripción de la Licitación:" -#: cove_ocds/templates/cove_ocds/explore_release.html:376 +#: cove_ocds/templates/cove_ocds/explore_release.html:375 msgid "Tender Item Description:" msgstr "Descripción del Artículo de la Licitación:" -#: cove_ocds/templates/cove_ocds/explore_release.html:381 +#: cove_ocds/templates/cove_ocds/explore_release.html:380 msgid "Award Title:" msgstr "Título de la Adjudicación:" -#: cove_ocds/templates/cove_ocds/explore_release.html:384 +#: cove_ocds/templates/cove_ocds/explore_release.html:383 msgid "Award Description:" msgstr "Descripción de la Adjudicación:" -#: cove_ocds/templates/cove_ocds/explore_release.html:389 +#: cove_ocds/templates/cove_ocds/explore_release.html:388 msgid "Contract Title:" msgstr "Título del Contrato:" -#: cove_ocds/templates/cove_ocds/explore_release.html:392 +#: cove_ocds/templates/cove_ocds/explore_release.html:391 msgid "Contract Description:" msgstr "Descripción del Contrato:" -#: cove_ocds/templates/cove_ocds/explore_release.html:400 +#: cove_ocds/templates/cove_ocds/explore_release.html:399 msgid "Buyer:" msgstr "Comprador:" -#: cove_ocds/templates/cove_ocds/explore_release.html:406 +#: cove_ocds/templates/cove_ocds/explore_release.html:405 msgid "Procuring Entity:" msgstr "Entidad Contratante:" @@ -1599,18 +1561,18 @@ msgstr "" "DDT00:00:00Z. Lea más sobre fechas en OCDS" -#: cove_ocds/util.py:20 cove_ocds/util.py:39 cove_ocds/util.py:57 -#: cove_ocds/views.py:112 +#: cove_ocds/util.py:19 cove_ocds/util.py:38 cove_ocds/util.py:56 +#: cove_ocds/views.py:111 msgid "Sorry, we can't process that data" msgstr "Lo sentimos, no podemos procesar esos datos" -#: cove_ocds/util.py:23 cove_ocds/util.py:42 cove_ocds/util.py:59 -#: cove_ocds/util.py:85 cove_ocds/util.py:108 cove_ocds/util.py:127 -#: cove_ocds/views.py:114 cove_ocds/views.py:149 +#: cove_ocds/util.py:22 cove_ocds/util.py:41 cove_ocds/util.py:58 +#: cove_ocds/util.py:84 cove_ocds/util.py:107 cove_ocds/util.py:126 +#: cove_ocds/views.py:113 cove_ocds/views.py:148 msgid "Try Again" msgstr "Inténtelo de nuevo" -#: cove_ocds/util.py:26 +#: cove_ocds/util.py:25 msgid "" "The file that you uploaded doesn't appear to be well formed JSON. OCDS JSON " "follows the I-JSON format, which requires UTF-8 encoding. Ensure that your " @@ -1627,7 +1589,7 @@ msgstr "" " Mensaje del error: {}" -#: cove_ocds/util.py:45 +#: cove_ocds/util.py:44 msgid "" "We think you tried to upload a JSON file, but it is not well formed JSON.\n" "\n" @@ -1640,7 +1602,7 @@ msgstr "" " Mensaje del error: {}" -#: cove_ocds/util.py:60 +#: cove_ocds/util.py:59 msgid "" "OCDS JSON should have an object as the top level, the JSON you supplied does " "not." @@ -1648,11 +1610,11 @@ msgstr "" "OCDS JSON debe ser un objeto al nivel más alto pero el JSON que usted ha " "aportado no lo es." -#: cove_ocds/util.py:82 cove_ocds/util.py:83 +#: cove_ocds/util.py:81 cove_ocds/util.py:82 msgid "Missing OCDS package" msgstr "Paquete OCDS no encontrado" -#: cove_ocds/util.py:88 +#: cove_ocds/util.py:87 msgid "" "We could not detect a package structure at the top-level of your data. OCDS " "releases and records should be published within a Mensaje de error: Falta el paquete OCDS" -#: cove_ocds/util.py:105 +#: cove_ocds/util.py:104 msgid "Unrecognised version of the schema" msgstr "Versión del esquema no reconocida" -#: cove_ocds/util.py:106 cove_ocds/util.py:125 +#: cove_ocds/util.py:105 cove_ocds/util.py:124 #, python-format msgid "%(version)s is not a known schema version" msgstr "%(version)s no es una versión conocida del esquema" -#: cove_ocds/util.py:111 +#: cove_ocds/util.py:110 msgid "" "We think you tried to run your data against an unrecognised version of the " "schema.\n" @@ -1698,11 +1660,11 @@ msgid "" "for the schema version" msgstr "" -#: cove_ocds/util.py:124 +#: cove_ocds/util.py:123 msgid "Version format does not comply with the schema" msgstr "El formato de la versión no se ajusta al esquema" -#: cove_ocds/util.py:130 +#: cove_ocds/util.py:129 msgid "" "The value for the \"version\" field in your data follows the " "major.minor.patch pattern but according to the schema the patch " @@ -1717,12 +1679,12 @@ msgid "" "with the schema" msgstr "" -#: cove_ocds/util.py:144 +#: cove_ocds/util.py:143 #, python-format msgid "%(version)s (not a string)" msgstr "" -#: cove_ocds/views.py:118 +#: cove_ocds/views.py:117 msgid "" "The table isn't structured correctly. For example, a JSON Pointer " "(tender) can't be both a value (tender), a path to " @@ -1740,15 +1702,46 @@ msgstr "" " Error message: {}" -#: cove_ocds/views.py:147 +#: cove_ocds/views.py:146 msgid "JSON reference error" msgstr "Error de referencia en JSON" -#: cove_ocds/views.py:159 +#: cove_ocds/views.py:158 #, python-format msgid "%(error)s" msgstr "%(error)s" +#~ msgid "Explore your data:" +#~ msgstr "Explora tus datos:" + +#~ msgid "" +#~ "This section provides a visual representation of the data, use it to " +#~ "check whether the data makes sense in the type of tool a user might use " +#~ "to explore it." +#~ msgstr "" +#~ "Esta sección proporciona una representación visual de los datos, " +#~ "utilícela para verificar si tienen sentido en el tipo de herramienta que " +#~ "un usuario podría usar para explorarlos." + +#~ msgid "" +#~ "Extensions and additional fields are hidden by default, click the 'Extra " +#~ "fields' buttons or open the 'Extra fields' section to view them." +#~ msgstr "" +#~ "Las extensiones y los campos adicionales están ocultos por defecto, haga " +#~ "clic en los botones \"Campos adicionales\" o abra la sección \"Campos " +#~ "adicionales\" para verlos." + +#~ msgid "" +#~ "When viewing an OCDS record, use the numbers at the top of the " +#~ "visualization to browse the change history. New and changed fields are " +#~ "highlighted, use this feature to check whether any fields have changed " +#~ "unexpectedly." +#~ msgstr "" +#~ "Al ver un registro de OCDS, use los números en la parte superior de la " +#~ "visualización para navegar en el historial de cambios. Los campos nuevos " +#~ "y modificados están resaltados, use esta función para verificar si alguno " +#~ "de los campos ha cambiado inesperadamente." + #~ msgid "Sorry, the page you are looking for is not available" #~ msgstr "Lo sentimos, la página que está buscando no está disponible" diff --git a/cove_ocds/sass/_custom-ocds.sass b/cove_ocds/sass/_custom-ocds.sass index 849674fe..25ab82c5 100644 --- a/cove_ocds/sass/_custom-ocds.sass +++ b/cove_ocds/sass/_custom-ocds.sass @@ -137,11 +137,6 @@ a.view-all text-decoration: none; -.release-badge.success - background-color: #676C3F !important -.release-badge.primary - background-color: #9baf00 !important - #container .panel &-body dt color: $gray; diff --git a/cove_ocds/templates/cove_ocds/explore_base.html b/cove_ocds/templates/cove_ocds/explore_base.html index 983b7236..aedce18c 100644 --- a/cove_ocds/templates/cove_ocds/explore_base.html +++ b/cove_ocds/templates/cove_ocds/explore_base.html @@ -5,12 +5,6 @@ {% trans 'Load New File' %} {% endblock %} -{% block after_head %} - {{block.super}} - - -{% endblock %} - {% block explore_content %}
@@ -526,310 +520,4 @@

{% trans "Save or Share these results" %}

$('#small-loading').css({"display": "inline"}); }); - - - - - - - {% endblock extrafooterscript %} diff --git a/cove_ocds/templates/cove_ocds/explore_record.html b/cove_ocds/templates/cove_ocds/explore_record.html index 5cafdd61..8ff4ddd2 100644 --- a/cove_ocds/templates/cove_ocds/explore_record.html +++ b/cove_ocds/templates/cove_ocds/explore_record.html @@ -175,37 +175,4 @@

- -{% if ocds_show_data %} -
-
-
-
-

- {% trans "Explore your data:" %} -

-
-
-

- {% blocktrans %}This section provides a visual representation of the data, use it to check whether the data makes sense in the type of tool a user might use to explore it.{% endblocktrans %} -

-

- {% blocktrans %}Extensions and additional fields are hidden by default, click the 'Extra fields' buttons or open the 'Extra fields' section to view them.{% endblocktrans %} -

-

- {% blocktrans %}When viewing an OCDS record, use the numbers at the top of the visualization to browse the change history. New and changed fields are highlighted, use this feature to check whether any fields have changed unexpectedly.{% endblocktrans %} -

-
- -
- -
-
-
-
-
-
-
-{% endif %} - {% endblock %} diff --git a/cove_ocds/templates/cove_ocds/explore_release.html b/cove_ocds/templates/cove_ocds/explore_release.html index ef9e7af6..05f2a57e 100644 --- a/cove_ocds/templates/cove_ocds/explore_release.html +++ b/cove_ocds/templates/cove_ocds/explore_release.html @@ -1,7 +1,6 @@ {% extends 'cove_ocds/explore_base.html' %} {% load i18n %} {% load cove_ocds %} -{% load static %} {% block key_facts %} {% with releases_aggregates as ra %} @@ -419,38 +418,4 @@

-{% if ocds_show_data %} -
-
-
-
-

- {% trans "Explore your data:" %} -

-
-
-

- {% blocktrans %}This section provides a visual representation of the data, use it to check whether the data makes sense in the type of tool a user might use to explore it.{% endblocktrans %} -

-

- {% blocktrans %}Extensions and additional fields are hidden by default, click the 'Extra fields' buttons or open the 'Extra fields' section to view them.{% endblocktrans %} -

-

- {% blocktrans %}When viewing an OCDS record, use the numbers at the top of the visualization to browse the change history. New and changed fields are highlighted, use this feature to check whether any fields have changed unexpectedly.{% endblocktrans %} -

-
- -
- -
-
-
-
-
-
-
-{% endif %} - - - {% endblock %} diff --git a/cove_ocds/util.py b/cove_ocds/util.py index 0a51be61..7365553d 100644 --- a/cove_ocds/util.py +++ b/cove_ocds/util.py @@ -4,7 +4,6 @@ from django.utils.html import format_html, mark_safe from django.utils.translation import gettext as _ -from libcove.lib.common import schema_dict_fields_generator from libcove.lib.exceptions import CoveInputDataError from libcoveocds.schema import SchemaOCDS @@ -161,43 +160,3 @@ def default(obj): if isinstance(obj, Decimal): return float(obj) return json.JSONEncoder().default(obj) - - -def add_extra_fields(data, deref_release_schema): - all_schema_fields = set(schema_dict_fields_generator(deref_release_schema)) - - if "releases" in data: - for release in data.get("releases", []): - if not isinstance(release, dict): - return - _add_extra_fields_to_obj(release, all_schema_fields, "") - elif "records" in data: - for record in data.get("records", []): - if not isinstance(record, dict): - return - for release in record.get("releases", []): - _add_extra_fields_to_obj(release, all_schema_fields, "") - - -def _add_extra_fields_to_obj(obj, all_schema_fields, current_path): - if not isinstance(obj, dict): - return - obj["__extra"] = {} - - for key, value in list(obj.items()): - if key == "__extra": - continue - - new_path = f"{current_path}/{key}" - if new_path not in all_schema_fields: - obj["__extra"][key] = value - continue - - if isinstance(value, list): - for item in value: - _add_extra_fields_to_obj(item, all_schema_fields, new_path) - elif isinstance(value, dict): - _add_extra_fields_to_obj(value, all_schema_fields, new_path) - - if not obj["__extra"]: - obj.pop("__extra") diff --git a/cove_ocds/views.py b/cove_ocds/views.py index 73498429..ce978f83 100644 --- a/cove_ocds/views.py +++ b/cove_ocds/views.py @@ -1,4 +1,3 @@ -import copy import json import logging import os @@ -209,13 +208,6 @@ def explore_ocds(request, pk): if isinstance(package_data, dict) and isinstance(package_data.get(key), list): # This is for the "Releases Table" and "Records Table" features. context[key] = package_data[key] - - # This is for the OCDS Show feature. - # https://github.com/open-contracting/cove-ocds/commit/d8dbf55 - if len(package_data[key]) < MAXIMUM_RELEASES_OR_RECORDS: - new_package_data = copy.deepcopy(package_data) - util.add_extra_fields(new_package_data, SchemaOCDS(record_pkg=has_records).get_schema_obj(deref=True)) - context["ocds_show_data"] = json.dumps(new_package_data, default=util.default) else: context[key] = [] diff --git a/docs/architecture.rst b/docs/architecture.rst index cc1ee3a9..d9ec7319 100644 --- a/docs/architecture.rst +++ b/docs/architecture.rst @@ -31,11 +31,6 @@ The OCDS Data Review Tool is just one manifestation of software historically kno * lib-cove-web (`opendataservices/lib-cove-web `_): provides a barebones Django configuration, and baseline CSS, JS and templates that are common for all CoVE instances. It is also a place for common functions relating to presentation or display of data or output. Any templates edited here typically affect all CoVE instances. Sometimes this is useful, but for OCDS-only changes, templates can be overridden in cove-ocds. This and cove-ocds are the only places where frontend output and translatable strings should be. * flatten-tool (`opendataservices/flatten-tool `_): a general purpose library for converting data between JSON and CSV/XLS formats. While not CoVE-specific, it is listed here because it is a specialized tool of which the DRT makes heavy use. -OCDS Show ---------- - -`OCDS Show `_ is a JavaScript application for embedding visualizations of OCDS data. The DRT generates data for OCDS Show in ``views.py`` so that it can be embedded in the ``explore_`` templates. Additional functions to help with the data generation for OCDS show are in ``cove_ocds/lib/ocds_show_extra.py``. - Configuration ------------- diff --git a/tests/fixtures/tenders_releases_extra_data.json b/tests/fixtures/tenders_releases_extra_data.json deleted file mode 100644 index 93a2cb58..00000000 --- a/tests/fixtures/tenders_releases_extra_data.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "publisher": { - "scheme": null, - "name": "Buyandsell.gc.ca", - "uri": "https://buyandsell.gc.ca", - "uid": null - }, - "releases": [ - { - "someExtraData": {"some": "uniquedata"}, - "date": "2014-03-25T00:00:00.00Z", - "language": "English", - "id": "Buyandsell.gc.ca-2014-11-07-89f689cd-e784-4374-bb17-94144679d46f", - "ocid": "PW-14-00627094", - "initiationType": "tender", - "tender": { - "documents": [ - { - "url": "https://buyandsell.gc.ca/cds/public/2014/03/25/3a76d19e61825db7939e14afaa2002e3/14-2015_itt.pdf", - "id": "https://buyandsell.gc.ca/cds/public/2014/03/25/3a76d19e61825db7939e14afaa2002e3/14-2015_itt.pdf" - }, - { - "url": "https://buyandsell.gc.ca/cds/public/2014/03/25/a5d07c1166142b8b2f4183d7a5363fec/14-2015_itt_-_f.pdf", - "id": "https://buyandsell.gc.ca/cds/public/2014/03/25/a5d07c1166142b8b2f4183d7a5363fec/14-2015_itt_-_f.pdf" - }, - { - "url": "https://buyandsell.gc.ca/cds/public/2014/04/04/ea5d0f03cfc6ea201b5b6df8794dbb3c/14-2015_itt_amd1.pdf", - "id": "https://buyandsell.gc.ca/cds/public/2014/04/04/ea5d0f03cfc6ea201b5b6df8794dbb3c/14-2015_itt_amd1.pdf" - }, - { - "url": "https://buyandsell.gc.ca/cds/public/2014/04/04/ac9afb3b664a28d519062f2b2a4cbceb/14-2015_itt_amd1-f.pdf", - "id": "https://buyandsell.gc.ca/cds/public/2014/04/04/ac9afb3b664a28d519062f2b2a4cbceb/14-2015_itt_amd1-f.pdf" - }, - { - "url": "https://buyandsell.gc.ca/cds/public/2014/04/11/f3f3993b4f6f260e057d0cb95f43741d/14-2015_itt_amd2.pdf", - "id": "https://buyandsell.gc.ca/cds/public/2014/04/11/f3f3993b4f6f260e057d0cb95f43741d/14-2015_itt_amd2.pdf" - }, - { - "url": "https://buyandsell.gc.ca/cds/public/2014/04/11/69359ba194d3f01f4f13cb9673b85071/14-2015_itt_amd2-f.pdf", - "id": "https://buyandsell.gc.ca/cds/public/2014/04/11/69359ba194d3f01f4f13cb9673b85071/14-2015_itt_amd2-f.pdf" - } - ], - "tenderPeriod": { - "endDate": "2014-04-15T14:00:00.00Z" - }, - "items": [ - { - "id": "1", - "classification": { - "scheme": "GSIN", - "description": "F029: Other Animal Care and Control Services" - }, - "description": "Canine Control of the Canada Geese (14-2015)" - } - ], - "awardCriteriaDetails": null, - "procuringEntity": { - "name": "Agriculture & Agrifood Canada", - "name_fr": "Agriculture & Agrifood Canada" - }, - "id": "PW-14-00627094", - "methodRationale": "Open" - }, - "tag": ["tender"], - "buyer": { - "name": "Agriculture & Agrifood Canada" - } - }, - { - "date": "2014-04-04T00:00:00.00Z", - "language": "English", - "id": "Buyandsell.gc.ca-2014-11-07-a76b0dd2-3dc8-4c52-bc36-cd0e42530602", - "ocid": "PW-14-00629344", - "initiationType": "tender", - "tender": { - "documents": [ - { - "url": "https://buyandsell.gc.ca/cds/public/2014/04/04/cb21d6397174fbba48c92edb694de76f/tender_document_5p404-13181.pdf", - "id": "https://buyandsell.gc.ca/cds/public/2014/04/04/cb21d6397174fbba48c92edb694de76f/tender_document_5p404-13181.pdf" - }, - { - "url": "https://buyandsell.gc.ca/cds/public/2014/04/04/370b7a9ab2bdd35086e6caed9b5226f9/fr_tender_document_5p404-13181.pdf", - "id": "https://buyandsell.gc.ca/cds/public/2014/04/04/370b7a9ab2bdd35086e6caed9b5226f9/fr_tender_document_5p404-13181.pdf" - } - ], - "tenderPeriod": { - "endDate": "2014-04-22T00:00:00Z" - }, - "items": [ - { - "id": "1", - "classification": { - "scheme": "GSIN", - "description": "5131BI: Asphalt and Joint Sealing Services, 5131C: Highways, Roads, Railways, Airfield Runways" - }, - "description": "Clear Lake Campground Asphalt Paving - Riding Mountain National Park of Canada (5P404-13181)" - } - ], - "awardCriteriaDetails": null, - "procuringEntity": { - "name": "Parks Canada" - }, - "id": "PW-14-00629344", - "methodRationale": "Open" - }, - "tag": ["tender"], - "buyer": { - "name": "Parks Canada" - } - } - ], - "uri": "https://github.com/open-contracting/sample-data/blob/main/buyandsell/ocds_data/tender_releases.json.zip", - "license": "http://data.gc.ca/eng/open-government-licence-canada", - "publishedDate": "2014-11-07T00:00:00.00Z" -} diff --git a/tests/test_functional.py b/tests/test_functional.py index d928a3f6..f3929f38 100644 --- a/tests/test_functional.py +++ b/tests/test_functional.py @@ -941,23 +941,6 @@ def test_url_input_extension_headlines( assert text not in headlines_box_text -@pytest.mark.parametrize( - ("source_filename", "expected", "not_expected"), - [("tenders_releases_extra_data.json", ["uniquedata"], [])], -) -def test_ocds_show(server_url, url_input_browser, httpserver, source_filename, expected, not_expected): - browser = url_input_browser(source_filename) - - browser.find_element(By.CSS_SELECTOR, "a[href='#extra']").click() - - body_text = browser.find_element(By.TAG_NAME, "body").text - - for text in expected: - assert text in body_text - for text in not_expected: - assert text not in body_text - - @pytest.mark.parametrize( ("source_filename", "expected", "not_expected"), [ From eb21e2e434a48f239d270768135d5bb09c256537 Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Sat, 19 Oct 2024 01:41:11 -0400 Subject: [PATCH 04/37] feat: Remove release and record tables --- cove_ocds/locale/en/LC_MESSAGES/django.po | 83 +--------- cove_ocds/locale/es/LC_MESSAGES/django.po | 149 ++++++++---------- .../templates/cove_ocds/explore_record.html | 38 ----- .../templates/cove_ocds/explore_release.html | 87 ---------- cove_ocds/views.py | 8 - tests/test_functional.py | 125 --------------- 6 files changed, 65 insertions(+), 425 deletions(-) diff --git a/cove_ocds/locale/en/LC_MESSAGES/django.po b/cove_ocds/locale/en/LC_MESSAGES/django.po index 97ed4196..be5cb821 100644 --- a/cove_ocds/locale/en/LC_MESSAGES/django.po +++ b/cove_ocds/locale/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-19 05:34+0000\n" +"POT-Creation-Date: 2024-10-19 05:35+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -674,14 +674,10 @@ msgid "Is structurally correct?" msgstr "" #: cove_ocds/templates/cove_ocds/explore_record.html:105 -#: cove_ocds/templates/cove_ocds/explore_record.html:167 -#: cove_ocds/templates/cove_ocds/explore_record.html:168 msgid "No" msgstr "" #: cove_ocds/templates/cove_ocds/explore_record.html:105 -#: cove_ocds/templates/cove_ocds/explore_record.html:167 -#: cove_ocds/templates/cove_ocds/explore_record.html:168 msgid "Yes" msgstr "" @@ -693,19 +689,6 @@ msgstr "" msgid "Unique OCIDs" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_record.html:144 -msgid "Records Table:" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:150 -#, python-format -msgid "Showing the first %(releases_or_records_table_length)s records." -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:157 -msgid "release count" -msgstr "" - #: cove_ocds/templates/cove_ocds/explore_release.html:22 msgid "OCDS release package schema version" msgstr "" @@ -974,70 +957,6 @@ msgstr "" msgid "Statistics cannot be produced as data is not structurally correct." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:340 -msgid "Releases Table:" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:346 -#, python-format -msgid "" -"Showing the first %(releases_or_records_table_length)s releases. To explore " -"all your data in a tabular format, convert it to a spreadsheet using the " -"\"Convert\" section, above." -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:353 -msgid "Release Date" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:354 -msgid "Tags" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:355 -msgid "Descriptions" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:356 -msgid "Purchasers" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:368 -msgid "Tender Title:" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:371 -msgid "Tender Description:" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:375 -msgid "Tender Item Description:" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:380 -msgid "Award Title:" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:383 -msgid "Award Description:" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:388 -msgid "Contract Title:" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:391 -msgid "Contract Description:" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:399 -msgid "Buyer:" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:405 -msgid "Procuring Entity:" -msgstr "" - #: cove_ocds/templates/cove_ocds/input.html:6 msgid "Loading" msgstr "" diff --git a/cove_ocds/locale/es/LC_MESSAGES/django.po b/cove_ocds/locale/es/LC_MESSAGES/django.po index 67c89bc4..e70d6baa 100644 --- a/cove_ocds/locale/es/LC_MESSAGES/django.po +++ b/cove_ocds/locale/es/LC_MESSAGES/django.po @@ -15,7 +15,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-19 05:34+0000\n" +"POT-Creation-Date: 2024-10-19 05:35+0000\n" "PO-Revision-Date: 2020-09-08 08:53+0000\n" "Last-Translator: James McKinney, 2024\n" "Language-Team: Spanish (https://app.transifex.com/open-contracting-" @@ -814,14 +814,10 @@ msgid "Is structurally correct?" msgstr "¿Es estructuralmente correcto?" #: cove_ocds/templates/cove_ocds/explore_record.html:105 -#: cove_ocds/templates/cove_ocds/explore_record.html:167 -#: cove_ocds/templates/cove_ocds/explore_record.html:168 msgid "No" msgstr "No" #: cove_ocds/templates/cove_ocds/explore_record.html:105 -#: cove_ocds/templates/cove_ocds/explore_record.html:167 -#: cove_ocds/templates/cove_ocds/explore_record.html:168 msgid "Yes" msgstr "Si" @@ -833,19 +829,6 @@ msgstr "Número de registros" msgid "Unique OCIDs" msgstr "OCIDs únicas" -#: cove_ocds/templates/cove_ocds/explore_record.html:144 -msgid "Records Table:" -msgstr "Tabla de Registros:" - -#: cove_ocds/templates/cove_ocds/explore_record.html:150 -#, python-format -msgid "Showing the first %(releases_or_records_table_length)s records." -msgstr "Mostrando los primeros %(releases_or_records_table_length)s registros." - -#: cove_ocds/templates/cove_ocds/explore_record.html:157 -msgid "release count" -msgstr "cantidad de entregas" - #: cove_ocds/templates/cove_ocds/explore_release.html:22 msgid "OCDS release package schema version" msgstr "Versión del esquema del paquete de entrega de OCDS" @@ -1130,73 +1113,6 @@ msgstr "" "No se pueden producir estadísticas porque los datos no son estructuralmente " "correctos." -#: cove_ocds/templates/cove_ocds/explore_release.html:340 -msgid "Releases Table:" -msgstr "Tabla de Entregas:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:346 -#, python-format -msgid "" -"Showing the first %(releases_or_records_table_length)s releases. To explore " -"all your data in a tabular format, convert it to a spreadsheet using the " -"\"Convert\" section, above." -msgstr "" -"Mostrando los primeros %(releases_or_records_table_length)s lanzamientos. " -"Para explorar todos tus datos en formato tabular, conviértalos a una hoja de " -"cálculo usando la sección \"Convertir\", arriba." - -#: cove_ocds/templates/cove_ocds/explore_release.html:353 -msgid "Release Date" -msgstr "Fecha de Entrega" - -#: cove_ocds/templates/cove_ocds/explore_release.html:354 -msgid "Tags" -msgstr "Etiquetas" - -#: cove_ocds/templates/cove_ocds/explore_release.html:355 -msgid "Descriptions" -msgstr "Descripciones" - -#: cove_ocds/templates/cove_ocds/explore_release.html:356 -msgid "Purchasers" -msgstr "Compradores" - -#: cove_ocds/templates/cove_ocds/explore_release.html:368 -msgid "Tender Title:" -msgstr "Título de la Licitación:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:371 -msgid "Tender Description:" -msgstr "Descripción de la Licitación:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:375 -msgid "Tender Item Description:" -msgstr "Descripción del Artículo de la Licitación:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:380 -msgid "Award Title:" -msgstr "Título de la Adjudicación:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:383 -msgid "Award Description:" -msgstr "Descripción de la Adjudicación:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:388 -msgid "Contract Title:" -msgstr "Título del Contrato:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:391 -msgid "Contract Description:" -msgstr "Descripción del Contrato:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:399 -msgid "Buyer:" -msgstr "Comprador:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:405 -msgid "Procuring Entity:" -msgstr "Entidad Contratante:" - #: cove_ocds/templates/cove_ocds/input.html:6 msgid "Loading" msgstr "Cargando" @@ -1711,6 +1627,69 @@ msgstr "Error de referencia en JSON" msgid "%(error)s" msgstr "%(error)s" +#~ msgid "Records Table:" +#~ msgstr "Tabla de Registros:" + +#, python-format +#~ msgid "Showing the first %(releases_or_records_table_length)s records." +#~ msgstr "" +#~ "Mostrando los primeros %(releases_or_records_table_length)s registros." + +#~ msgid "release count" +#~ msgstr "cantidad de entregas" + +#~ msgid "Releases Table:" +#~ msgstr "Tabla de Entregas:" + +#, python-format +#~ msgid "" +#~ "Showing the first %(releases_or_records_table_length)s releases. To " +#~ "explore all your data in a tabular format, convert it to a spreadsheet " +#~ "using the \"Convert\" section, above." +#~ msgstr "" +#~ "Mostrando los primeros %(releases_or_records_table_length)s lanzamientos. " +#~ "Para explorar todos tus datos en formato tabular, conviértalos a una hoja " +#~ "de cálculo usando la sección \"Convertir\", arriba." + +#~ msgid "Release Date" +#~ msgstr "Fecha de Entrega" + +#~ msgid "Tags" +#~ msgstr "Etiquetas" + +#~ msgid "Descriptions" +#~ msgstr "Descripciones" + +#~ msgid "Purchasers" +#~ msgstr "Compradores" + +#~ msgid "Tender Title:" +#~ msgstr "Título de la Licitación:" + +#~ msgid "Tender Description:" +#~ msgstr "Descripción de la Licitación:" + +#~ msgid "Tender Item Description:" +#~ msgstr "Descripción del Artículo de la Licitación:" + +#~ msgid "Award Title:" +#~ msgstr "Título de la Adjudicación:" + +#~ msgid "Award Description:" +#~ msgstr "Descripción de la Adjudicación:" + +#~ msgid "Contract Title:" +#~ msgstr "Título del Contrato:" + +#~ msgid "Contract Description:" +#~ msgstr "Descripción del Contrato:" + +#~ msgid "Buyer:" +#~ msgstr "Comprador:" + +#~ msgid "Procuring Entity:" +#~ msgstr "Entidad Contratante:" + #~ msgid "Explore your data:" #~ msgstr "Explora tus datos:" diff --git a/cove_ocds/templates/cove_ocds/explore_record.html b/cove_ocds/templates/cove_ocds/explore_record.html index 8ff4ddd2..c071da68 100644 --- a/cove_ocds/templates/cove_ocds/explore_record.html +++ b/cove_ocds/templates/cove_ocds/explore_record.html @@ -136,43 +136,5 @@

-
-
-
-
-

- {% trans "Records Table:" %} -

-
-
- {% if records|length > releases_or_records_table_length %} -

- {% blocktrans %}Showing the first {{releases_or_records_table_length}} records.{% endblocktrans %} -

- {% endif %} - - - - - - - - - - - {% for record in records|slice:releases_or_records_table_slice %} - - - - - - - {% endfor %} - -
ocid{% trans "release count" %}compiledReleaseversionedRelease
{{ record.ocid }}{{ record.releases|length }}{% if record.compiledRelease %}{% trans "Yes" %}{% else %}{% trans "No" %}{% endif %}{% if record.versionedRelease %}{% trans "Yes" %}{% else %}{% trans "No" %}{% endif %}
-
-
-
-
{% endblock %} diff --git a/cove_ocds/templates/cove_ocds/explore_release.html b/cove_ocds/templates/cove_ocds/explore_release.html index 05f2a57e..d0603c22 100644 --- a/cove_ocds/templates/cove_ocds/explore_release.html +++ b/cove_ocds/templates/cove_ocds/explore_release.html @@ -331,91 +331,4 @@

{% trans 'Documents' %}

{% endwith %} - -
-
-
-
-

- {% trans "Releases Table:" %} -

-
-
- {% if releases|length > releases_or_records_table_length %} -

- {% blocktrans %}Showing the first {{releases_or_records_table_length}} releases. To explore all your data in a tabular format, convert it to a spreadsheet using the "Convert" section, above.{% endblocktrans %} -

- {% endif %} - - - - - - - - - - - - {% for release in releases|slice:releases_or_records_table_slice %} - - - - - - - - {% endfor %} - -
OCID{%blocktrans%}Release Date{%endblocktrans%}{%blocktrans%}Tags{%endblocktrans%}{%blocktrans%}Descriptions{%endblocktrans%}{%blocktrans%}Purchasers{%endblocktrans%}
{{ release.ocid }}{{ release.date|to_datetime|date:"j M Y, H:i (e)" }}{% if release.tag %}{{ release.tag|join:", " }}{% endif %} -
    - {% if release.tender.title %} -
  • {%blocktrans%}Tender Title:{%endblocktrans%} {{ release.tender.title }}
  • - {% endif %} - {% if release.tender.description %} -
  • {%blocktrans%}Tender Description:{%endblocktrans%} {{ release.tender.description }}
  • - {% endif %} - {% for item in release.tender.items %} - {% if item.description %} -
  • {%blocktrans%}Tender Item Description:{%endblocktrans%} {{ item.description }}
  • - {% endif %} - {% endfor %} - {% for award in release.awards %} - {% if award.title %} -
  • {%blocktrans%}Award Title:{%endblocktrans%} {{ award.title }}
  • - {% endif %} - {% if award.description %} -
  • {%blocktrans%}Award Description:{%endblocktrans%} {{ award.description }}
  • - {% endif %} - {% endfor %} - {% for contract in release.contracts %} - {% if contract.description %} -
  • {%blocktrans%}Contract Title:{%endblocktrans%} {{ contract.title }}
  • - {% endif %} - {% if contract.description %} -
  • {%blocktrans%}Contract Description:{%endblocktrans%} {{ contract.description }}
  • - {% endif %} - {% endfor %} -
-
-
    - {% if release.buyer.name or release.buyer.identifier.id %} -
  • {%blocktrans%}Buyer:{%endblocktrans%} - {% if release.buyer.name %} {{release.buyer.name}} {%endif%} - {% if release.buyer.identifier.id %} ({{ release.buyer.identifier.id }}) {%endif%} -
  • - {% endif %} - {% if release.tender.procuringEntity.name or release.tender.procuringEntity.identifier.id %} -
  • {%blocktrans%}Procuring Entity:{%endblocktrans%} - {% if release.tender.procuringEntity.name %} {{release.tender.procuringEntity.name}} {%endif%} - {% if release.tender.procuringEntity.identifier.id %} ({{ release.tender.procuringEntity.identifier.id }}) {%endif%} -
  • - {% endif %} -
-
-
-
-
-
- {% endblock %} diff --git a/cove_ocds/views.py b/cove_ocds/views.py index ce978f83..5f9c020a 100644 --- a/cove_ocds/views.py +++ b/cove_ocds/views.py @@ -199,16 +199,8 @@ def explore_ocds(request, pk): if has_records: template = "cove_ocds/explore_record.html" context["release_or_record"] = "record" - key = "records" else: template = "cove_ocds/explore_release.html" context["release_or_record"] = "release" - key = "releases" - - if isinstance(package_data, dict) and isinstance(package_data.get(key), list): - # This is for the "Releases Table" and "Records Table" features. - context[key] = package_data[key] - else: - context[key] = [] return render(request, template, context) diff --git a/tests/test_functional.py b/tests/test_functional.py index f3929f38..59977a4b 100644 --- a/tests/test_functional.py +++ b/tests/test_functional.py @@ -994,120 +994,6 @@ def test_additional_checks_error_modal(server_url, url_input_browser, httpserver browser.find_element(By.CSS_SELECTOR, "div.modal.additional-checks-1 button.close").click() -def test_releases_table_25_rows(skip_if_remote, url_input_browser): - """ - Check that when there are more than 25 releases, only 25 are shown in the - table, and there is a message. - """ - - browser = url_input_browser("30_releases.json") - assert "This file contains 30 releases" in browser.find_element(By.TAG_NAME, "body").text - panel = browser.find_element(By.CSS_SELECTOR, "#releases-table-panel") - assert "first 25 releases" in panel.text - table_rows = browser.find_elements(By.CSS_SELECTOR, "#releases-table-panel table tbody tr") - assert len(table_rows) == 25 - - -def test_releases_table_7_rows(skip_if_remote, url_input_browser): - """ - Check that when there are less than 25 releases, they are all shown in the - table, and there is no message. - """ - - browser = url_input_browser("tenders_releases_7_releases_check_ocids.json") - assert "This file contains 7 releases" in browser.find_element(By.TAG_NAME, "body").text - panel = browser.find_element(By.CSS_SELECTOR, "#releases-table-panel") - assert "first 25 releases" not in panel.text - table_rows = browser.find_elements(By.CSS_SELECTOR, "#releases-table-panel table tbody tr") - assert len(table_rows) == 7 - - -def test_releases_table_10_rows_env_var(skip_if_remote, settings_releases_table_10, url_input_browser): - """ - Check that when the appropriate setting is set, and there are more than 10 - releases, only 10 are shown in the table, and there is a message. - """ - - browser = url_input_browser("30_releases.json") - assert "This file contains 30 releases" in browser.find_element(By.TAG_NAME, "body").text - panel = browser.find_element(By.CSS_SELECTOR, "#releases-table-panel") - assert "first 10 releases" in panel.text - table_rows = browser.find_elements(By.CSS_SELECTOR, "#releases-table-panel table tbody tr") - assert len(table_rows) == 10 - - -def test_releases_table_7_rows_env_var(skip_if_remote, settings_releases_table_10, url_input_browser): - """ - Check that when the appropriate setting is set, and there are less than 10 - releases, they are all shown in the table, and there is no message. - """ - - browser = url_input_browser("tenders_releases_7_releases_check_ocids.json") - assert "This file contains 7 releases" in browser.find_element(By.TAG_NAME, "body").text - panel = browser.find_element(By.CSS_SELECTOR, "#releases-table-panel") - assert "first 25 releases" not in panel.text - assert "first 10 releases" not in panel.text - table_rows = browser.find_elements(By.CSS_SELECTOR, "#releases-table-panel table tbody tr") - assert len(table_rows) == 7 - - -def test_records_table_25_rows(skip_if_remote, url_input_browser): - """ - Check that when there are more than 25 records, only 25 are shown in the - table, and there is a message. - """ - - browser = url_input_browser("30_records.json") - assert "This file contains 30 records" in browser.find_element(By.TAG_NAME, "body").text - panel = browser.find_element(By.CSS_SELECTOR, "#records-table-panel") - assert "first 25 records" in panel.text - table_rows = browser.find_elements(By.CSS_SELECTOR, "#records-table-panel table tbody tr") - assert len(table_rows) == 25 - - -def test_records_table_7_rows(skip_if_remote, url_input_browser): - """ - Check that when there are less than 25 records, they are all shown in the - table, and there is no message. - """ - - browser = url_input_browser("7_records.json") - assert "This file contains 7 records" in browser.find_element(By.TAG_NAME, "body").text - panel = browser.find_element(By.CSS_SELECTOR, "#records-table-panel") - assert "first 25 records" not in panel.text - table_rows = browser.find_elements(By.CSS_SELECTOR, "#records-table-panel table tbody tr") - assert len(table_rows) == 7 - - -def test_records_table_10_rows_env_var(skip_if_remote, settings_records_table_10, url_input_browser): - """ - Check that when the appropriate setting is set, and there are more than 10 - records, only 10 are shown in the table, and there is a message. - """ - - browser = url_input_browser("30_records.json") - assert "This file contains 30 records" in browser.find_element(By.TAG_NAME, "body").text - panel = browser.find_element(By.CSS_SELECTOR, "#records-table-panel") - assert "first 10 records" in panel.text - table_rows = browser.find_elements(By.CSS_SELECTOR, "#records-table-panel table tbody tr") - assert len(table_rows) == 10 - - -def test_records_table_7_rows_env_var(skip_if_remote, settings_records_table_10, url_input_browser): - """ - Check that when the appropriate setting is set, and there are less than 10 - records, they are all shown in the table, and there is no message. - """ - - browser = url_input_browser("7_records.json") - assert "This file contains 7 records" in browser.find_element(By.TAG_NAME, "body").text - panel = browser.find_element(By.CSS_SELECTOR, "#records-table-panel") - assert "first 25 records" not in panel.text - assert "first 10 records" not in panel.text - table_rows = browser.find_elements(By.CSS_SELECTOR, "#records-table-panel table tbody tr") - assert len(table_rows) == 7 - - @override_settings(VALIDATION_ERROR_LOCATIONS_LENGTH=1000) def test_error_list_1000_lines(skip_if_remote, url_input_browser): """ @@ -1178,17 +1064,6 @@ def test_error_list_999_lines_sample(skip_if_remote, settings_error_locations_sa assert len(table_rows) == 999 -def test_records_table_releases_count(skip_if_remote, url_input_browser): - """ - Check that the correct releases count is shown in the records table. - """ - - browser = url_input_browser("30_records.json") - assert "release" in browser.find_elements(By.CSS_SELECTOR, "#records-table-panel table thead th")[1].text - table_rows = browser.find_elements(By.CSS_SELECTOR, "#records-table-panel table tbody tr") - assert table_rows[0].find_elements(By.CSS_SELECTOR, "td")[1].text == "5" - - @pytest.mark.parametrize( ("source_filename", "expected"), [ From 48bc988ef3bdbfe68cbdde61273f0a653676f275 Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Sat, 19 Oct 2024 04:06:45 -0400 Subject: [PATCH 05/37] feat: Remove Key Field Information --- cove_ocds/locale/en/LC_MESSAGES/django.po | 426 +++---------- cove_ocds/locale/es/LC_MESSAGES/django.po | 589 ++++-------------- .../templates/cove_ocds/explore_record.html | 121 ++-- .../templates/cove_ocds/explore_release.html | 281 +-------- cove_ocds/templatetags/cove_ocds.py | 9 - docs/code_examples/kfi-functional-test.orig | 5 - docs/code_examples/kfi-functional-test.txt | 6 - docs/code_examples/kfi-item-ids.orig | 5 - docs/code_examples/kfi-item-ids.txt | 7 - docs/code_examples/kfi-return.orig | 8 - docs/code_examples/kfi-return.txt | 9 - docs/code_examples/kfi-template-added.html | 3 - docs/code_examples/kfi-template-orig.html | 2 - docs/code_examples/kfi-variables-added.py | 5 - docs/code_examples/kfi-variables-orig.py | 4 - docs/how-to-add-kfi.rst | 132 ---- docs/index.rst | 1 - requirements.in | 2 - requirements.txt | 9 +- requirements_dev.txt | 5 +- ...badfile_all_validation_errors_results.json | 1 - tests/fixtures/release_aggregate.json | 257 -------- tests/test_functional.py | 24 - tests/test_hypothesis.py | 15 +- 24 files changed, 261 insertions(+), 1665 deletions(-) delete mode 100644 docs/code_examples/kfi-functional-test.orig delete mode 100644 docs/code_examples/kfi-functional-test.txt delete mode 100644 docs/code_examples/kfi-item-ids.orig delete mode 100644 docs/code_examples/kfi-item-ids.txt delete mode 100644 docs/code_examples/kfi-return.orig delete mode 100644 docs/code_examples/kfi-return.txt delete mode 100644 docs/code_examples/kfi-template-added.html delete mode 100644 docs/code_examples/kfi-template-orig.html delete mode 100644 docs/code_examples/kfi-variables-added.py delete mode 100644 docs/code_examples/kfi-variables-orig.py delete mode 100644 docs/how-to-add-kfi.rst delete mode 100644 tests/fixtures/release_aggregate.json diff --git a/cove_ocds/locale/en/LC_MESSAGES/django.po b/cove_ocds/locale/en/LC_MESSAGES/django.po index be5cb821..c58bc6e1 100644 --- a/cove_ocds/locale/en/LC_MESSAGES/django.po +++ b/cove_ocds/locale/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-19 05:35+0000\n" +"POT-Creation-Date: 2024-10-19 07:48+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -540,95 +540,108 @@ msgstr "" msgid "Additional Fields (fields in data not in schema)" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_record.html:12 -#: cove_ocds/templates/cove_ocds/explore_release.html:10 +#: cove_ocds/templates/cove_ocds/explore_record.html:9 +#: cove_ocds/templates/cove_ocds/explore_release.html:9 msgid "Headlines" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_record.html:17 -#: cove_ocds/templates/cove_ocds/explore_release.html:14 +#: cove_ocds/templates/cove_ocds/explore_record.html:13 +#: cove_ocds/templates/cove_ocds/explore_release.html:13 msgid "" "Please read the conversion warnings " "below." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_record.html:21 +#: cove_ocds/templates/cove_ocds/explore_record.html:18 #: cove_ocds/templates/cove_ocds/explore_release.html:18 msgid "Failed " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_record.html:23 +#: cove_ocds/templates/cove_ocds/explore_record.html:20 #: cove_ocds/templates/cove_ocds/explore_release.html:20 msgid "Passed " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_record.html:25 -#: cove_ocds/templates/cove_ocds/explore_release.html:22 -msgid "structural checks against " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:25 -msgid "OCDS record package schema version" +#: cove_ocds/templates/cove_ocds/explore_record.html:22 +#, python-format +msgid "" +"structural checks against OCDS record package " +"schema version %(version_used_display)s." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_record.html:26 +#: cove_ocds/templates/cove_ocds/explore_record.html:23 #: cove_ocds/templates/cove_ocds/explore_release.html:23 msgid "See Structural Errors below." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_record.html:30 -#: cove_ocds/templates/cove_ocds/explore_release.html:32 -msgid "At a glance" +#: cove_ocds/templates/cove_ocds/explore_record.html:28 +#: cove_ocds/templates/cove_ocds/explore_release.html:28 +#, python-format +msgid "Failed to apply %(count)s extension to the schema." +msgid_plural "" +"Failed to apply %(count)s extensions to the schema." +msgstr[0] "" +msgstr[1] "" + +#: cove_ocds/templates/cove_ocds/explore_record.html:29 +#: cove_ocds/templates/cove_ocds/explore_release.html:29 +msgid "See Extensions below." msgstr "" #: cove_ocds/templates/cove_ocds/explore_record.html:34 +#: cove_ocds/templates/cove_ocds/explore_release.html:34 +msgid "At a glance" +msgstr "" + +#: cove_ocds/templates/cove_ocds/explore_record.html:38 #, python-format -msgid "This file contains %(count)s record." -msgid_plural "This file contains %(count)s records." +msgid "This file contains %(count)s record" +msgid_plural "This file contains %(count)s records" msgstr[0] "" msgstr[1] "" #: cove_ocds/templates/cove_ocds/explore_record.html:39 -#: cove_ocds/templates/cove_ocds/explore_release.html:42 -msgid "The schema version specified in the file is" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:43 +#: cove_ocds/templates/cove_ocds/explore_release.html:39 #, python-format -msgid "There is %(count)s unique OCID." -msgid_plural "There are %(count)s unique OCIDs." +msgid " describing %(count)s contracting process" +msgid_plural " describing %(count)s contracting processes." msgstr[0] "" msgstr[1] "" -#: cove_ocds/templates/cove_ocds/explore_record.html:47 -#: cove_ocds/templates/cove_ocds/explore_release.html:47 -msgid "The publisher named in the file is" +#: cove_ocds/templates/cove_ocds/explore_record.html:45 +#: cove_ocds/templates/cove_ocds/explore_release.html:45 +msgid "The schema version specified in the file is" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_record.html:52 -#: cove_ocds/templates/cove_ocds/explore_release.html:52 -msgid "The license is" +#: cove_ocds/templates/cove_ocds/explore_record.html:51 +#: cove_ocds/templates/cove_ocds/explore_release.html:51 +msgid "The publisher named in the file is" msgstr "" #: cove_ocds/templates/cove_ocds/explore_record.html:57 #: cove_ocds/templates/cove_ocds/explore_release.html:57 -msgid "Publication policy is" +msgid "The license is" msgstr "" #: cove_ocds/templates/cove_ocds/explore_record.html:63 -#: cove_ocds/templates/cove_ocds/explore_release.html:69 +#: cove_ocds/templates/cove_ocds/explore_release.html:63 +msgid "Publication policy is" +msgstr "" + +#: cove_ocds/templates/cove_ocds/explore_record.html:70 +#: cove_ocds/templates/cove_ocds/explore_release.html:70 #, python-format msgid "" -"There is %(count)s duplicate release ID in " -"this package." +"This file applies %(count)s valid extension to the schema." msgid_plural "" -"There are %(count)s duplicate release IDs in " -"this package." +"This file applies %(count)s valid extensions to the schema." msgstr[0] "" msgstr[1] "" -#: cove_ocds/templates/cove_ocds/explore_record.html:69 -#: cove_ocds/templates/cove_ocds/explore_release.html:74 +#: cove_ocds/templates/cove_ocds/explore_record.html:77 +#: cove_ocds/templates/cove_ocds/explore_release.html:77 #, python-format msgid "" "This file uses %(count)s additional field " @@ -639,106 +652,16 @@ msgid_plural "" msgstr[0] "" msgstr[1] "" -#: cove_ocds/templates/cove_ocds/explore_record.html:74 -#: cove_ocds/templates/cove_ocds/explore_release.html:79 -msgid "This file is not 'utf-8' encoded (it is" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:74 -#: cove_ocds/templates/cove_ocds/explore_release.html:79 -msgid "encoded)." -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:78 -#: cove_ocds/templates/cove_ocds/explore_release.html:88 -msgid "Data " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:80 -#: cove_ocds/templates/cove_ocds/explore_release.html:90 -msgid "downloaded from " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:82 -#: cove_ocds/templates/cove_ocds/explore_release.html:92 -msgid "uploaded " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:84 -#: cove_ocds/templates/cove_ocds/explore_release.html:94 -msgid "on " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:102 -msgid "Is structurally correct?" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:105 -msgid "No" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:105 -msgid "Yes" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:115 -msgid "Number of records" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:126 -msgid "Unique OCIDs" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:22 -msgid "OCDS release package schema version" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:27 -msgid "Failed to apply " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:27 +#: cove_ocds/templates/cove_ocds/explore_record.html:83 +#: cove_ocds/templates/cove_ocds/explore_release.html:83 #, python-format -msgid " %(count)s extension " -msgid_plural "%(count)s extensions " -msgstr[0] "" -msgstr[1] "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:27 msgid "" -" to the schema.
See Extensions below." +"This file is not 'utf-8' encoded (it is %(csv_encoding)s " +"encoded)." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:36 -#, python-format -msgid "This file contains %(count)s release" -msgid_plural "This file contains %(count)s releases" -msgstr[0] "" -msgstr[1] "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:37 -#, python-format -msgid " describing %(count)s contracting process" -msgid_plural " describing %(count)s contracting processes." -msgstr[0] "" -msgstr[1] "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:63 -msgid "This file applies" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:63 -#, python-format -msgid "%(count)s valid extension" -msgid_plural " %(count)s valid extensions " -msgstr[0] "" -msgstr[1] "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:63 -msgid "to the schema" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:84 +#: cove_ocds/templates/cove_ocds/explore_record.html:89 +#: cove_ocds/templates/cove_ocds/explore_release.html:89 #, python-format msgid "" "This file uses %(count)s deprecated field." @@ -748,214 +671,31 @@ msgid_plural "" msgstr[0] "" msgstr[1] "" -#: cove_ocds/templates/cove_ocds/explore_release.html:113 -msgid "Key Field Information" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:118 -msgid "Initiation Types: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:119 -msgid "Tags:" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:125 -msgid "Planning: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:126 -msgid "Tenders: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:128 -msgid "Awards: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:130 -#: cove_ocds/templates/cove_ocds/explore_release.html:136 -#: cove_ocds/templates/cove_ocds/explore_release.html:145 -msgid "Total Count: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:131 -#: cove_ocds/templates/cove_ocds/explore_release.html:137 -#: cove_ocds/templates/cove_ocds/explore_release.html:146 -msgid "Unique OCIDs: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:134 -msgid "Contracts: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:139 -msgid "Contracts with no awards: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:143 -msgid "Implementation: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:150 -msgid "Earliest release: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:151 -msgid "Latest release: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:152 -msgid "Earliest tender start: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:153 -msgid "Latest tender start: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:154 -msgid "Earliest award: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:155 -msgid "Latest award: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:156 -msgid "Earliest contract start: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:157 -msgid "Latest contract start: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:160 -msgid "Total Unique Organizations: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:162 -msgid "with address details: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:163 -msgid "with contact points: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:164 -msgid "that have identifiers: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:165 -msgid "using schemes: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:168 -msgid "Organization Roles: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:172 -msgid "Buyers: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:177 -msgid "Suppliers: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:182 -msgid "Procuring Entities: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:187 -msgid "Tenderers: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:192 -#: docs/code_examples/kfi-template-added.html:1 -#: docs/code_examples/kfi-template-orig.html:1 -msgid "Total Items: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:193 -#: docs/code_examples/kfi-template-added.html:2 -msgid "Unique Item IDs: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:194 -#: docs/code_examples/kfi-template-added.html:3 -#: docs/code_examples/kfi-template-orig.html:2 -msgid "Items ID schemes: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:195 -msgid "Item Types: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:197 -msgid "Tender: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:198 -msgid "Award: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:199 -msgid "Contract: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:202 -msgid "Languages: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:203 -msgid "Currencies: " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:221 -msgid "Documents" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:226 -msgid "Part of Contracting Process" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:227 -msgid "Count of Docs" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:228 -msgid "Document Types" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:234 -msgid "Planning" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:246 -msgid "Tender" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:258 -msgid "Tender Milestones" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:270 -msgid "Awards" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:282 -msgid "Contracts" +#: cove_ocds/templates/cove_ocds/explore_record.html:95 +#: cove_ocds/templates/cove_ocds/explore_release.html:95 +#, python-format +msgid "Data downloaded from %(source_url)s on %(created_datetime)s." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:294 -msgid "Implementation" +#: cove_ocds/templates/cove_ocds/explore_record.html:97 +#: cove_ocds/templates/cove_ocds/explore_release.html:97 +#, python-format +msgid "Data uploaded on %(created_datetime)s." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:306 -msgid "Implementation Milestones" +#: cove_ocds/templates/cove_ocds/explore_release.html:22 +#, python-format +msgid "" +"structural checks against OCDS release package " +"schema version %(version_used_display)s." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:326 -msgid "Statistics cannot be produced as data is not structurally correct." -msgstr "" +#: cove_ocds/templates/cove_ocds/explore_release.html:38 +#, python-format +msgid "This file contains %(count)s release" +msgid_plural "This file contains %(count)s releases" +msgstr[0] "" +msgstr[1] "" #: cove_ocds/templates/cove_ocds/input.html:6 msgid "Loading" @@ -1222,24 +962,24 @@ msgstr "" msgid "Column" msgstr "" -#: cove_ocds/templatetags/cove_ocds.py:13 +#: cove_ocds/templatetags/cove_ocds.py:11 msgid "" "This array should contain either entirely embedded releases or linked " "releases. Embedded releases contain an 'id' whereas linked releases do not. " "Your releases contain a mixture." msgstr "" -#: cove_ocds/templatetags/cove_ocds.py:19 +#: cove_ocds/templatetags/cove_ocds.py:17 #, python-format msgid "%s is not valid under any of the given schemas" msgstr "" -#: cove_ocds/templatetags/cove_ocds.py:22 +#: cove_ocds/templatetags/cove_ocds.py:20 #, python-format msgid "%(instance)s is valid under each of %(reprs)s" msgstr "" -#: cove_ocds/templatetags/cove_ocds.py:31 +#: cove_ocds/templatetags/cove_ocds.py:29 msgid "" "Incorrect date format. Dates should use the form YYYY-MM-DDT00:00:00Z. Learn " "more about conversion warnings " "below." @@ -673,94 +673,110 @@ msgstr "" "Por favor, lea las advertencias de " "conversión más abajo." -#: cove_ocds/templates/cove_ocds/explore_record.html:21 +#: cove_ocds/templates/cove_ocds/explore_record.html:18 #: cove_ocds/templates/cove_ocds/explore_release.html:18 msgid "Failed " msgstr "Ha fallado " -#: cove_ocds/templates/cove_ocds/explore_record.html:23 +#: cove_ocds/templates/cove_ocds/explore_record.html:20 #: cove_ocds/templates/cove_ocds/explore_release.html:20 msgid "Passed " msgstr "Ha pasado " -#: cove_ocds/templates/cove_ocds/explore_record.html:25 -#: cove_ocds/templates/cove_ocds/explore_release.html:22 -msgid "structural checks against " -msgstr "comprobaciones estructurales contra" - -#: cove_ocds/templates/cove_ocds/explore_record.html:25 -msgid "OCDS record package schema version" -msgstr "Versión del esquema del paquete de registros OCDS" +#: cove_ocds/templates/cove_ocds/explore_record.html:22 +#, python-format +msgid "" +"structural checks against OCDS record package " +"schema version %(version_used_display)s." +msgstr "" -#: cove_ocds/templates/cove_ocds/explore_record.html:26 +#: cove_ocds/templates/cove_ocds/explore_record.html:23 #: cove_ocds/templates/cove_ocds/explore_release.html:23 msgid "See Structural Errors below." msgstr "" "Ver Errores Estructurales más abajo." -#: cove_ocds/templates/cove_ocds/explore_record.html:30 -#: cove_ocds/templates/cove_ocds/explore_release.html:32 +#: cove_ocds/templates/cove_ocds/explore_record.html:28 +#: cove_ocds/templates/cove_ocds/explore_release.html:28 +#, python-format +msgid "Failed to apply %(count)s extension to the schema." +msgid_plural "" +"Failed to apply %(count)s extensions to the schema." +msgstr[0] "" +"Ha fallado al aplicar %(count)s extensión al esquema." +msgstr[1] "" +"Ha fallado al aplicar %(count)s extensiones al esquema." +msgstr[2] "" +"Ha fallado al aplicar %(count)s extensiones al esquema." + +#: cove_ocds/templates/cove_ocds/explore_record.html:29 +#: cove_ocds/templates/cove_ocds/explore_release.html:29 +msgid "See Extensions below." +msgstr "Vea Extensiones más abajo." + +#: cove_ocds/templates/cove_ocds/explore_record.html:34 +#: cove_ocds/templates/cove_ocds/explore_release.html:34 msgid "At a glance" msgstr "De un vistazo" -#: cove_ocds/templates/cove_ocds/explore_record.html:34 +#: cove_ocds/templates/cove_ocds/explore_record.html:38 #, python-format -msgid "This file contains %(count)s record." -msgid_plural "This file contains %(count)s records." -msgstr[0] "Este archivo contiene %(count)s registro." -msgstr[1] "Este archivo contiene %(count)s registros." -msgstr[2] "Este archivo contiene %(count)s registros." +msgid "This file contains %(count)s record" +msgid_plural "This file contains %(count)s records" +msgstr[0] "Este archivo contiene %(count)s registro" +msgstr[1] "Este archivo contiene %(count)s registros" +msgstr[2] "Este archivo contiene %(count)s registros" #: cove_ocds/templates/cove_ocds/explore_record.html:39 -#: cove_ocds/templates/cove_ocds/explore_release.html:42 +#: cove_ocds/templates/cove_ocds/explore_release.html:39 +#, python-format +msgid " describing %(count)s contracting process" +msgid_plural " describing %(count)s contracting processes." +msgstr[0] "describiendo un proceso de contratación" +msgstr[1] "describiendo %(count)s procesos de contratación." +msgstr[2] "describiendo %(count)s procesos de contratación." + +#: cove_ocds/templates/cove_ocds/explore_record.html:45 +#: cove_ocds/templates/cove_ocds/explore_release.html:45 msgid "The schema version specified in the file is" msgstr "La versión del esquema especificada en el archivo es " -#: cove_ocds/templates/cove_ocds/explore_record.html:43 -#, python-format -msgid "There is %(count)s unique OCID." -msgid_plural "There are %(count)s unique OCIDs." -msgstr[0] "Hay una OCID." -msgstr[1] "Hay %(count)s es OCIDs únicas." -msgstr[2] "Hay %(count)s es OCIDs únicas." - -#: cove_ocds/templates/cove_ocds/explore_record.html:47 -#: cove_ocds/templates/cove_ocds/explore_release.html:47 +#: cove_ocds/templates/cove_ocds/explore_record.html:51 +#: cove_ocds/templates/cove_ocds/explore_release.html:51 msgid "The publisher named in the file is" msgstr "El publicador nombrado en el archivo es" -#: cove_ocds/templates/cove_ocds/explore_record.html:52 -#: cove_ocds/templates/cove_ocds/explore_release.html:52 +#: cove_ocds/templates/cove_ocds/explore_record.html:57 +#: cove_ocds/templates/cove_ocds/explore_release.html:57 msgid "The license is" msgstr "La licencia es " -#: cove_ocds/templates/cove_ocds/explore_record.html:57 -#: cove_ocds/templates/cove_ocds/explore_release.html:57 +#: cove_ocds/templates/cove_ocds/explore_record.html:63 +#: cove_ocds/templates/cove_ocds/explore_release.html:63 msgid "Publication policy is" msgstr "Una política de publicación es" -#: cove_ocds/templates/cove_ocds/explore_record.html:63 -#: cove_ocds/templates/cove_ocds/explore_release.html:69 +#: cove_ocds/templates/cove_ocds/explore_record.html:70 +#: cove_ocds/templates/cove_ocds/explore_release.html:70 #, python-format msgid "" -"There is %(count)s duplicate release ID in " -"this package." +"This file applies %(count)s valid extension to the schema." msgid_plural "" -"There are %(count)s duplicate release IDs in " -"this package." +"This file applies %(count)s valid extensions to the schema." msgstr[0] "" -"Hay unaID de versión duplicada en este " -"\"\n" -"\"paquete." +"Este archivo incorpora %(count)s extensión válida al esquema." msgstr[1] "" -"Hay %(count)s IDs de versión duplicadas en " -"este paquete." +"Este archivo incorpora %(count)s extensiones válida al esquema." msgstr[2] "" -"Hay %(count)s IDs de versión duplicadas en " -"este paquete." +"Este archivo incorpora %(count)s extensiones válida al esquema." -#: cove_ocds/templates/cove_ocds/explore_record.html:69 -#: cove_ocds/templates/cove_ocds/explore_release.html:74 +#: cove_ocds/templates/cove_ocds/explore_record.html:77 +#: cove_ocds/templates/cove_ocds/explore_release.html:77 #, python-format msgid "" "This file uses %(count)s additional field " @@ -779,114 +795,18 @@ msgstr[2] "" "Este archivo utiliza %(count)s campos " "adicionalesno incluidos en el estándar." -#: cove_ocds/templates/cove_ocds/explore_record.html:74 -#: cove_ocds/templates/cove_ocds/explore_release.html:79 -msgid "This file is not 'utf-8' encoded (it is" -msgstr "Este archivo no ha sido codificado con 'utf-8' (ha sido " - -#: cove_ocds/templates/cove_ocds/explore_record.html:74 -#: cove_ocds/templates/cove_ocds/explore_release.html:79 -msgid "encoded)." -msgstr "codificado)." - -#: cove_ocds/templates/cove_ocds/explore_record.html:78 -#: cove_ocds/templates/cove_ocds/explore_release.html:88 -msgid "Data " -msgstr "Datos " - -#: cove_ocds/templates/cove_ocds/explore_record.html:80 -#: cove_ocds/templates/cove_ocds/explore_release.html:90 -msgid "downloaded from " -msgstr "descargado desde " - -#: cove_ocds/templates/cove_ocds/explore_record.html:82 -#: cove_ocds/templates/cove_ocds/explore_release.html:92 -msgid "uploaded " -msgstr "subido " - -#: cove_ocds/templates/cove_ocds/explore_record.html:84 -#: cove_ocds/templates/cove_ocds/explore_release.html:94 -msgid "on " -msgstr "el " - -#: cove_ocds/templates/cove_ocds/explore_record.html:102 -msgid "Is structurally correct?" -msgstr "¿Es estructuralmente correcto?" - -#: cove_ocds/templates/cove_ocds/explore_record.html:105 -msgid "No" -msgstr "No" - -#: cove_ocds/templates/cove_ocds/explore_record.html:105 -msgid "Yes" -msgstr "Si" - -#: cove_ocds/templates/cove_ocds/explore_record.html:115 -msgid "Number of records" -msgstr "Número de registros" - -#: cove_ocds/templates/cove_ocds/explore_record.html:126 -msgid "Unique OCIDs" -msgstr "OCIDs únicas" - -#: cove_ocds/templates/cove_ocds/explore_release.html:22 -msgid "OCDS release package schema version" -msgstr "Versión del esquema del paquete de entrega de OCDS" - -#: cove_ocds/templates/cove_ocds/explore_release.html:27 -msgid "Failed to apply " -msgstr " Ha fallado al aplicar" - -#: cove_ocds/templates/cove_ocds/explore_release.html:27 +#: cove_ocds/templates/cove_ocds/explore_record.html:83 +#: cove_ocds/templates/cove_ocds/explore_release.html:83 #, python-format -msgid " %(count)s extension " -msgid_plural "%(count)s extensions " -msgstr[0] "%(count)s extensión" -msgstr[1] "%(count)s extensiones" -msgstr[2] "%(count)s extensiones" - -#: cove_ocds/templates/cove_ocds/explore_release.html:27 msgid "" -" to the schema.
See Extensions below." +"This file is not 'utf-8' encoded (it is %(csv_encoding)s " +"encoded)." msgstr "" -"al esquema.
Vea Extensiones más " -"abajo." - -#: cove_ocds/templates/cove_ocds/explore_release.html:36 -#, python-format -msgid "This file contains %(count)s release" -msgid_plural "This file contains %(count)s releases" -msgstr[0] "Este archivo contiene una entrega" -msgstr[1] "Este archivo contiene %(count)s entregas" -msgstr[2] "Este archivo contiene %(count)s entregas" +"Este archivo no ha sido codificado con 'utf-8' (ha sido codificado con " +"%(csv_encoding)s)." -#: cove_ocds/templates/cove_ocds/explore_release.html:37 -#, python-format -msgid " describing %(count)s contracting process" -msgid_plural " describing %(count)s contracting processes." -msgstr[0] "describiendo un proceso de contratación" -msgstr[1] "describiendo %(count)s procesos de contratación." -msgstr[2] "describiendo %(count)s procesos de contratación." - -#: cove_ocds/templates/cove_ocds/explore_release.html:63 -msgid "This file applies" -msgstr "Este archivo incorpora " - -#: cove_ocds/templates/cove_ocds/explore_release.html:63 -#, python-format -msgid "%(count)s valid extension" -msgid_plural " %(count)s valid extensions " -msgstr[0] "%(count)s extensión válida" -msgstr[1] "" -"%(count)s extensiones válidas " -msgstr[2] "" -"%(count)s extensiones válidas " - -#: cove_ocds/templates/cove_ocds/explore_release.html:63 -msgid "to the schema" -msgstr "al esquema" - -#: cove_ocds/templates/cove_ocds/explore_release.html:84 +#: cove_ocds/templates/cove_ocds/explore_record.html:89 +#: cove_ocds/templates/cove_ocds/explore_release.html:89 #, python-format msgid "" "This file uses %(count)s deprecated field." @@ -902,216 +822,32 @@ msgstr[2] "" "Este archivo usa %(count)s campos " "obsoletos." -#: cove_ocds/templates/cove_ocds/explore_release.html:113 -msgid "Key Field Information" -msgstr "Información de Campos Clave" - -#: cove_ocds/templates/cove_ocds/explore_release.html:118 -msgid "Initiation Types: " -msgstr "Tipos de iniciación:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:119 -msgid "Tags:" -msgstr "Etiquetas:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:125 -msgid "Planning: " -msgstr "Planificación:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:126 -msgid "Tenders: " -msgstr "Licitaciones:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:128 -msgid "Awards: " -msgstr "Adjudicaciones:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:130 -#: cove_ocds/templates/cove_ocds/explore_release.html:136 -#: cove_ocds/templates/cove_ocds/explore_release.html:145 -msgid "Total Count: " -msgstr "Total:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:131 -#: cove_ocds/templates/cove_ocds/explore_release.html:137 -#: cove_ocds/templates/cove_ocds/explore_release.html:146 -msgid "Unique OCIDs: " -msgstr "OCIDs únicas:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:134 -msgid "Contracts: " -msgstr "Contratos:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:139 -msgid "Contracts with no awards: " -msgstr "Contratos sin adjudicaciones:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:143 -msgid "Implementation: " -msgstr "Implementación:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:150 -msgid "Earliest release: " -msgstr "Apertura de entrega:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:151 -msgid "Latest release: " -msgstr "Última entrega:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:152 -msgid "Earliest tender start: " -msgstr "Apertura de inicio de licitación:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:153 -msgid "Latest tender start: " -msgstr "Último inicio de licitación:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:154 -msgid "Earliest award: " -msgstr "Apertura de adjudicación:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:155 -msgid "Latest award: " -msgstr "Última adjudicación:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:156 -msgid "Earliest contract start: " -msgstr "Apertura de inicio del contrato:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:157 -msgid "Latest contract start: " -msgstr "Último inicio del contrato:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:160 -msgid "Total Unique Organizations: " -msgstr "Número Total de Organizaciones Distintas:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:162 -msgid "with address details: " -msgstr "con detalles de dirección:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:163 -msgid "with contact points: " -msgstr "con puntos de contacto:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:164 -msgid "that have identifiers: " -msgstr "que tienen identificadores:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:165 -msgid "using schemes: " -msgstr "utilizando esquemas:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:168 -msgid "Organization Roles: " -msgstr "Roles de la Organización:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:172 -msgid "Buyers: " -msgstr "Compradores:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:177 -msgid "Suppliers: " -msgstr "Proveedores:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:182 -msgid "Procuring Entities: " -msgstr "Entidades Contratantes:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:187 -msgid "Tenderers: " -msgstr "Llicitadores:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:192 -#: docs/code_examples/kfi-template-added.html:1 -#: docs/code_examples/kfi-template-orig.html:1 -msgid "Total Items: " -msgstr "Número Total de Artículos:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:193 -#: docs/code_examples/kfi-template-added.html:2 -msgid "Unique Item IDs: " -msgstr "IDs de artículos únicos" - -#: cove_ocds/templates/cove_ocds/explore_release.html:194 -#: docs/code_examples/kfi-template-added.html:3 -#: docs/code_examples/kfi-template-orig.html:2 -msgid "Items ID schemes: " -msgstr "Esquemas de ID de artículos:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:195 -msgid "Item Types: " -msgstr "Tipos de Artículos:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:197 -msgid "Tender: " -msgstr "Licitación:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:198 -msgid "Award: " -msgstr "Adjudicación:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:199 -msgid "Contract: " -msgstr "Contrato:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:202 -msgid "Languages: " -msgstr "Idiomas:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:203 -msgid "Currencies: " -msgstr "Divisas:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:221 -msgid "Documents" -msgstr "Documentos" - -#: cove_ocds/templates/cove_ocds/explore_release.html:226 -msgid "Part of Contracting Process" -msgstr "Parte del Proceso de Contratación" - -#: cove_ocds/templates/cove_ocds/explore_release.html:227 -msgid "Count of Docs" -msgstr "Total de Documentos" - -#: cove_ocds/templates/cove_ocds/explore_release.html:228 -msgid "Document Types" -msgstr "Tipos de Documentos" - -#: cove_ocds/templates/cove_ocds/explore_release.html:234 -msgid "Planning" -msgstr "Planificación" - -#: cove_ocds/templates/cove_ocds/explore_release.html:246 -msgid "Tender" -msgstr "Licitación" - -#: cove_ocds/templates/cove_ocds/explore_release.html:258 -msgid "Tender Milestones" -msgstr "Hitos de la Licitación" - -#: cove_ocds/templates/cove_ocds/explore_release.html:270 -msgid "Awards" -msgstr "Adjudicaciones" - -#: cove_ocds/templates/cove_ocds/explore_release.html:282 -msgid "Contracts" -msgstr "Contratos" - -#: cove_ocds/templates/cove_ocds/explore_release.html:294 -msgid "Implementation" -msgstr "Implementación" +#: cove_ocds/templates/cove_ocds/explore_record.html:95 +#: cove_ocds/templates/cove_ocds/explore_release.html:95 +#, python-format +msgid "Data downloaded from %(source_url)s on %(created_datetime)s." +msgstr "Datos descargado desde %(source_url)s el %(created_datetime)s." -#: cove_ocds/templates/cove_ocds/explore_release.html:306 -msgid "Implementation Milestones" -msgstr "Hitos de ejecución" +#: cove_ocds/templates/cove_ocds/explore_record.html:97 +#: cove_ocds/templates/cove_ocds/explore_release.html:97 +#, python-format +msgid "Data uploaded on %(created_datetime)s." +msgstr "Datos subido el %(created_datetime)s." -#: cove_ocds/templates/cove_ocds/explore_release.html:326 -msgid "Statistics cannot be produced as data is not structurally correct." +#: cove_ocds/templates/cove_ocds/explore_release.html:22 +#, python-format +msgid "" +"structural checks against OCDS release package " +"schema version %(version_used_display)s." msgstr "" -"No se pueden producir estadísticas porque los datos no son estructuralmente " -"correctos." + +#: cove_ocds/templates/cove_ocds/explore_release.html:38 +#, python-format +msgid "This file contains %(count)s release" +msgid_plural "This file contains %(count)s releases" +msgstr[0] "Este archivo contiene una entrega" +msgstr[1] "Este archivo contiene %(count)s entregas" +msgstr[2] "Este archivo contiene %(count)s entregas" #: cove_ocds/templates/cove_ocds/input.html:6 msgid "Loading" @@ -1447,7 +1183,7 @@ msgstr "Fila" msgid "Column" msgstr "Columna" -#: cove_ocds/templatetags/cove_ocds.py:13 +#: cove_ocds/templatetags/cove_ocds.py:11 msgid "" "This array should contain either entirely embedded releases or linked " "releases. Embedded releases contain an 'id' whereas linked releases do not. " @@ -1457,17 +1193,17 @@ msgstr "" "vinculadas. Las entregas integradas contienen un \"identificador\", mientras " "que las entregas vinculadas no. Estas entregas contienen una mezcla de ambos." -#: cove_ocds/templatetags/cove_ocds.py:19 +#: cove_ocds/templatetags/cove_ocds.py:17 #, python-format msgid "%s is not valid under any of the given schemas" msgstr "%s no es válido bajo ninguno de los esquemas dados" -#: cove_ocds/templatetags/cove_ocds.py:22 +#: cove_ocds/templatetags/cove_ocds.py:20 #, python-format msgid "%(instance)s is valid under each of %(reprs)s" msgstr "%(instance)s es válido bajo cada uno de %(reprs)s" -#: cove_ocds/templatetags/cove_ocds.py:31 +#: cove_ocds/templatetags/cove_ocds.py:29 msgid "" "Incorrect date format. Dates should use the form YYYY-MM-DDT00:00:00Z. Learn " "more about
- {% endif %} -
+ {% endif %} + +
{% if validation_errors or additional_closed_codelist_values %} {% trans "Failed " %} - {% else %} - {% trans "Passed " %} + {% else %} + {% trans "Passed " %} {% endif %} - {% blocktrans %}structural checks against {% endblocktrans %}{% blocktrans %}OCDS record package schema version{% endblocktrans %} {{ version_used_display }}. + {% blocktrans %}structural checks against OCDS record package schema version {{ version_used_display }}.{% endblocktrans %} {% if validation_errors %}
{% blocktrans %}See Structural Errors below.{% endblocktrans %}{% endif %}
-
+ {% if extensions and extensions.invalid_extension %} +
+ {% blocktrans count count=extensions.invalid_extension.keys|length %}Failed to apply {{count}} extension to the schema.{% plural %}Failed to apply {{count}} extensions to the schema.{% endblocktrans %}
+ {% blocktrans %}See Extensions below.{% endblocktrans %} +
+ {% endif %} + +
{% trans "At a glance" %}
    + {% if count %}
  • - {% if records_aggregates.count %} - {% blocktrans count count=records_aggregates.count %}This file contains {{count}} record.{% plural %}This file contains {{count}} records.{% endblocktrans %} - {% endif %} + {% blocktrans count count=count %}This file contains {{count}} record{% plural %}This file contains {{count}} records{% endblocktrans %} + {% blocktrans count count=unique_ocids_count %} describing {{count}} contracting process{% plural %} describing {{count}} contracting processes.{% endblocktrans %}
  • + {% endif %} + {% if data_schema_version %}
  • {% trans "The schema version specified in the file is" %} {{data_schema_version}}.
  • {% endif %} -
  • - {% blocktrans count count=records_aggregates.unique_ocids|length %}There is {{count}} unique OCID.{% plural %}There are {{count}} unique OCIDs.{% endblocktrans %} -
  • + {% if json_data.publisher %}
  • {% trans "The publisher named in the file is" %} {{json_data.publisher.name}}.
  • {% endif %} + {% if json_data.license %}
  • {% trans "The license is" %} {{json_data.license}}.
  • {% endif %} + {% if json_data.publicationPolicy %}
  • {% trans "Publication policy is" %} {{json_data.publicationPolicy}}.
  • {% endif %} - - {% if ra.duplicate_release_ids %} -
  • - {% blocktrans count count=ra.duplicate_release_ids|length %}There is {{ count }} duplicate release ID in this package.{% plural %}There are {{ count }} duplicate release IDs in this package.{% endblocktrans %} + + {% if extensions and extensions.is_extended_schema %} +
  • + {% with n_invalid=extensions.invalid_extension.keys|length %} + {% blocktrans count count=extensions.extensions.keys|length|subtract:n_invalid %}This file applies {{count}} valid extension to the schema.{% plural %}This file applies {{count}} valid extensions to the schema.{% endblocktrans %} + {% endwith %}
  • {% endif %} - + {% if data_only %}
  • {% blocktrans count count=data_only|length %}This file uses {{count}} additional field not used in the standard.{% plural %}This file uses {{count}} additional fields not used in the standard.{% endblocktrans %}
  • {% endif %} + {% if csv_encoding and csv_encoding != "utf-8-sig" %}
  • - {% trans "This file is not 'utf-8' encoded (it is" %} {{csv_encoding}} {% trans "encoded)." %} + {% blocktrans %}This file is not 'utf-8' encoded (it is {{csv_encoding}} encoded).{% endblocktrans %}
  • {% endif %} + + {% if deprecated_fields %} +
  • + {% blocktrans count count=deprecated_fields|length %}This file uses {{count}} deprecated field.{% plural %} This file uses {{count}} deprecated fields.{% endblocktrans %} +
  • + {% endif %} +
  • - {% trans "Data " %} {% if source_url %} - {% trans "downloaded from " %} {{source_url}} + {% blocktrans %}Data downloaded from {{ source_url }} on {{ created_datetime }}.{% endblocktrans %} {% else %} - {% trans "uploaded " %} + {% blocktrans %}Data uploaded on {{ created_datetime }}.{% endblocktrans %} {% endif %} - {% trans "on " %} {{created_datetime}}
-
-
-
-
- -{% endwith %} -{% endblock %} - -{% block explore_additional_content %} -
- {% if schema_url %} - -
-
-
-

{% trans 'Is structurally correct?' %}

-
-
- {% if validation_errors %}{% trans "No" %}{% else %}{% trans "Yes" %}{% endif %} - -
-
-
- - {% endif %} -
-
-
-

{% trans 'Number of records' %}

-
-
- {{records_aggregates.count}} -
-
-
-
-
-
-

- {% blocktrans %}Unique OCIDs{% endblocktrans %} ({{records_aggregates.unique_ocids|length}}) -

-
-
-
    - {% for ocid in records_aggregates.unique_ocids %} -
  • {{ocid}}
  • - {% endfor %} -
+
-
- {% endblock %} diff --git a/cove_ocds/templates/cove_ocds/explore_release.html b/cove_ocds/templates/cove_ocds/explore_release.html index d0603c22..a9422b3d 100644 --- a/cove_ocds/templates/cove_ocds/explore_release.html +++ b/cove_ocds/templates/cove_ocds/explore_release.html @@ -1,9 +1,8 @@ {% extends 'cove_ocds/explore_base.html' %} {% load i18n %} -{% load cove_ocds %} +{% load cove_tags %}{# subtract #} {% block key_facts %} -{% with releases_aggregates as ra %}
@@ -12,323 +11,95 @@

{% trans 'Headlines' %}

{% if conversion_warning_messages or conversion_warning_messages_titles %}
{% blocktrans %}Please read the conversion warnings below.{% endblocktrans %}
- {% endif %} + {% endif %} +
{% if validation_errors or additional_closed_codelist_values %} {% trans "Failed " %} - {% else %} - {% trans "Passed " %} + {% else %} + {% trans "Passed " %} {% endif %} - {% blocktrans %}structural checks against {% endblocktrans %}{% blocktrans %}OCDS release package schema version{% endblocktrans %} {{ version_used_display }}. + {% blocktrans %}structural checks against OCDS release package schema version {{ version_used_display }}.{% endblocktrans %} {% if validation_errors %}
{% blocktrans %}See Structural Errors below.{% endblocktrans %}{% endif %}
+ {% if extensions and extensions.invalid_extension %}
- {% blocktrans %}Failed to apply {% endblocktrans %}{% blocktrans count count=extensions.invalid_extension.keys|length %} {{count}} extension {% plural %}{{count}} extensions {% endblocktrans %}{% blocktrans %} to the schema.
See Extensions below.{% endblocktrans %} + {% blocktrans count count=extensions.invalid_extension.keys|length %}Failed to apply {{count}} extension to the schema.{% plural %}Failed to apply {{count}} extensions to the schema.{% endblocktrans %}
+ {% blocktrans %}See Extensions below.{% endblocktrans %}
- {% endif %} + {% endif %}
{% trans "At a glance" %}
    - {% if ra.release_count %} + {% if count %}
  • - {% blocktrans count count=ra.release_count %}This file contains {{count}} release{% plural %}This file contains {{count}} releases{% endblocktrans %} - {% blocktrans count count=ra.unique_ocids|length %} describing {{count}} contracting process{% plural %} describing {{count}} contracting processes.{% endblocktrans %} + {% blocktrans count count=count %}This file contains {{count}} release{% plural %}This file contains {{count}} releases{% endblocktrans %} + {% blocktrans count count=unique_ocids_count %} describing {{count}} contracting process{% plural %} describing {{count}} contracting processes.{% endblocktrans %}
  • {% endif %} + {% if data_schema_version %}
  • {% trans "The schema version specified in the file is" %} {{data_schema_version}}.
  • {% endif %} + {% if json_data.publisher %}
  • {% trans "The publisher named in the file is" %} {{json_data.publisher.name}}.
  • {% endif %} + {% if json_data.license %}
  • {% trans "The license is" %} {{json_data.license}}.
  • {% endif %} + {% if json_data.publicationPolicy %}
  • {% trans "Publication policy is" %} {{json_data.publicationPolicy}}.
  • {% endif %} + {% if extensions and extensions.is_extended_schema %}
  • {% with n_invalid=extensions.invalid_extension.keys|length %} - {% trans "This file applies" %} {% blocktrans count count=extensions.extensions.keys|length|subtract:n_invalid %}{{count}} valid extension{% plural %} {{count}} valid extensions {% endblocktrans %} {% trans "to the schema" %}. + {% blocktrans count count=extensions.extensions.keys|length|subtract:n_invalid %}This file applies {{count}} valid extension to the schema.{% plural %}This file applies {{count}} valid extensions to the schema.{% endblocktrans %} {% endwith %}
  • {% endif %} - {% if ra.duplicate_release_ids %} -
  • - {% blocktrans count count=ra.duplicate_release_ids|length %}There is {{ count }} duplicate release ID in this package.{% plural %}There are {{ count }} duplicate release IDs in this package.{% endblocktrans %} -
  • - {% endif %} + {% if data_only %}
  • {% blocktrans count count=data_only|length %}This file uses {{count}} additional field not used in the standard.{% plural %}This file uses {{count}} additional fields not used in the standard.{% endblocktrans %}
  • {% endif %} + {% if csv_encoding and csv_encoding != "utf-8-sig" %}
  • - {% trans "This file is not 'utf-8' encoded (it is" %} {{csv_encoding}} {% trans "encoded)." %} + {% blocktrans %}This file is not 'utf-8' encoded (it is {{csv_encoding}} encoded).{% endblocktrans %}
  • {% endif %} + {% if deprecated_fields %}
  • {% blocktrans count count=deprecated_fields|length %}This file uses {{count}} deprecated field.{% plural %} This file uses {{count}} deprecated fields.{% endblocktrans %}
  • {% endif %} +
  • - {% trans "Data " %} {% if source_url %} - {% trans "downloaded from " %} {{source_url}} + {% blocktrans %}Data downloaded from {{ source_url }} on {{ created_datetime }}.{% endblocktrans %} {% else %} - {% trans "uploaded " %} + {% blocktrans %}Data uploaded on {{ created_datetime }}.{% endblocktrans %} {% endif %} - {% trans "on " %} {{created_datetime}}.
- -{% endwith %} -{% endblock %} - - -{% block explore_additional_content %} -{% with releases_aggregates as ra %} -{% if ra %} -
-
-
-
-

{% trans 'Key Field Information' %}

-
-
-
-
- {% trans "Initiation Types: " %} {{ra.unique_initation_type|join:", "}}
- {% trans "Tags:" %}
-
    - {% for key, value in ra.tags.items %} -
  • {{key}}: {{value}}
  • - {% endfor %} -
- {% trans "Planning: " %} {{ra.planning_count}}
- {% trans "Tenders: " %} {{ra.tender_count}}
- - {% trans "Awards: "%}
-
    -
  • {% trans "Total Count: " %} {{ra.award_count}}
  • -
  • {% trans "Unique OCIDs: " %} {{ra.processes_award_count}}
  • -
- - {% trans "Contracts: "%}
-
    -
  • {% trans "Total Count: " %} {{ra.contract_count}}
  • -
  • {% trans "Unique OCIDs: " %} {{ra.processes_contract_count}}
  • - {% if ra.contracts_without_awards %} -
  • {% trans "Contracts with no awards: " %} {{ra.contracts_without_awards|length}}
  • - {% endif %} -
- - {% trans "Implementation: "%}
-
    -
  • {% trans "Total Count: " %} {{ra.implementation_count}}
  • -
  • {% trans "Unique OCIDs: " %} {{ra.processes_implementation_count}}
  • -
-
-
- {% trans "Earliest release: " %} {{ra.min_release_date|to_datetime|date:"j M Y, H:i (e)"}}
- {% trans "Latest release: " %} {{ra.max_release_date|to_datetime|date:"j M Y, H:i (e)"}}

- {% trans "Earliest tender start: " %} {{ra.min_tender_date|to_datetime|date:"j M Y, H:i (e)"}}
- {% trans "Latest tender start: " %} {{ra.max_tender_date|to_datetime|date:"j M Y, H:i (e)"}}

- {% trans "Earliest award: " %} {{ra.min_award_date|to_datetime|date:"j M Y, H:i (e)"}}
- {% trans "Latest award: " %} {{ra.max_award_date|to_datetime|date:"j M Y, H:i (e)"}}

- {% trans "Earliest contract start: " %} {{ra.min_contract_date|to_datetime|date:"j M Y, H:i (e)"}}
- {% trans "Latest contract start: " %} {{ra.max_contract_date|to_datetime|date:"j M Y, H:i (e)"}}

-
-
- {% trans "Total Unique Organizations: " %} {{ra.unique_org_count}}
-
    -
  • {% trans "with address details: " %} {{ra.organisations_with_address}}
  • -
  • {% trans "with contact points: " %} {{ra.organisations_with_contact_point}}
  • -
  • {% trans "that have identifiers: " %} {{ra.unique_org_identifier_count}}
  • -
  • {% trans "using schemes: " %} {{ra.unique_organisation_schemes|join:", "}}
  • -
- - {% trans "Organization Roles: " %}
- - - {% trans "Total Items: " %} {{ra.total_item_count}}
- {% trans "Unique Item IDs: " %} {{ra.unique_item_ids_count}}
- {% trans "Items ID schemes: " %} {{ra.item_identifier_schemes|join:", "}}
- {% trans "Item Types: " %}
-
    -
  • {% trans "Tender: " %} {{ra.tender_item_count}}
  • -
  • {% trans "Award: " %} {{ra.award_item_count}}
  • -
  • {% trans "Contract: " %} {{ra.contract_item_count}}
  • -
- - {% trans "Languages: " %} {{ra.unique_lang|join:", "}}
- {% trans "Currencies: " %} {{ra.unique_currency|join:", "}}
- -
-
-
-
-
-
- -{% cove_modal_list className="buyer-orgs" modalTitle="Buyer Organizations" itemList=ra.unique_buyers %} -{% cove_modal_list className="supplier-orgs" modalTitle="Supplier Organizations" itemList=ra.unique_suppliers %} -{% cove_modal_list className="procuring-orgs" modalTitle="Procuring Entities" itemList=ra.unique_procuring %} -{% cove_modal_list className="tenderers-orgs" modalTitle="Tenderers" itemList=ra.unique_tenderers %} - -
-
-
-
-

{% trans 'Documents' %}

-
- - - - - - - - - - {% if ra.planning_doc_count %} - - - - - {% endif %} - {% if ra.tender_doc_count %} - - - - - {% endif %} - {% if ra.tender_milestones_doc_count %} - - - - - {% endif %} - {% if ra.award_doc_count %} - - - - - {% endif %} - {% if ra.contract_doc_count %} - - - - - {% endif %} - {% if ra.implementation_doc_count %} - - - - - {% endif %} - {% if ra.implementation_milestones_doc_count %} - - - - - {% endif %} - -
{%blocktrans%}Part of Contracting Process{%endblocktrans%}{%blocktrans%}Count of Docs{%endblocktrans%}{%blocktrans%}Document Types{%endblocktrans%}
{% trans "Planning" %} {{ra.planning_doc_count}} -
    - {% for doc_type, count in ra.planning_doctype.items %} -
  • {{doc_type}}: {{count}}
  • - {% endfor %} -
-
{% trans "Tender" %} {{ra.tender_doc_count}} -
    - {% for doc_type, count in ra.tender_doctype.items %} -
  • {{doc_type}}: {{count}}
  • - {% endfor %} -
-
{% trans "Tender Milestones" %} {{ra.tender_milestones_doc_count}} -
    - {% for doc_type, count in ra.tender_milestones_doctype.items %} -
  • {{doc_type}}: {{count}}
  • - {% endfor %} -
-
{% trans "Awards" %} {{ra.award_doc_count}} -
    - {% for doc_type, count in ra.award_doctype.items %} -
  • {{doc_type}}: {{count}}
  • - {% endfor %} -
-
{% trans "Contracts" %} {{ra.contract_doc_count}} -
    - {% for doc_type, count in ra.contract_doctype.items %} -
  • {{doc_type}}: {{count}}
  • - {% endfor %} -
-
{% trans "Implementation" %} {{ra.implementation_doc_count}} -
    - {% for doc_type, count in ra.implementation_doctype.items %} -
  • {{doc_type}}: {{count}}
  • - {% endfor %} -
-
{% trans "Implementation Milestones" %} {{ra.implementation_milestones_doc_count}} -
    - {% for doc_type, count in ra.implementation_milestones_doctype.items %} -
  • {{doc_type}}: {{count}}
  • - {% endfor %} -
-
- -
-
-
-{% else %} -
-
-
- {%blocktrans%}Statistics cannot be produced as data is not structurally correct.{%endblocktrans%} -
-
-
-{% endif %} - -{% endwith %} - {% endblock %} diff --git a/cove_ocds/templatetags/cove_ocds.py b/cove_ocds/templatetags/cove_ocds.py index e265fa72..cb6daf09 100644 --- a/cove_ocds/templatetags/cove_ocds.py +++ b/cove_ocds/templatetags/cove_ocds.py @@ -1,9 +1,7 @@ from cove.html_error_msg import html_error_msg, json_repr from cove.templatetags.cove_tags import register # as such, `load cove_ocds` implicitly calls `load cove_tags` -from dateutil import parser from django.utils.html import mark_safe from django.utils.translation import gettext as _ -from rfc3339_validator import validate_rfc3339 @register.filter(name="html_error_msg") @@ -34,10 +32,3 @@ def html_error_msg_ocds(error): ) return html_error_msg(error) - - -@register.filter -def to_datetime(value): - if value and validate_rfc3339(value): - return parser.parse(value) - return None diff --git a/docs/code_examples/kfi-functional-test.orig b/docs/code_examples/kfi-functional-test.orig deleted file mode 100644 index 801808c7..00000000 --- a/docs/code_examples/kfi-functional-test.orig +++ /dev/null @@ -1,5 +0,0 @@ - "release_aggregate.json", - [ - "Unique OCIDs: 1", - "Currencies: EUR, GBP, USD, YEN", - ], diff --git a/docs/code_examples/kfi-functional-test.txt b/docs/code_examples/kfi-functional-test.txt deleted file mode 100644 index 84c880b1..00000000 --- a/docs/code_examples/kfi-functional-test.txt +++ /dev/null @@ -1,6 +0,0 @@ - "release_aggregate.json", - [ - "Unique OCIDs: 1", - "Unique Item IDs: 2", - "Currencies: EUR, GBP, USD, YEN", - ], diff --git a/docs/code_examples/kfi-item-ids.orig b/docs/code_examples/kfi-item-ids.orig deleted file mode 100644 index e5542bda..00000000 --- a/docs/code_examples/kfi-item-ids.orig +++ /dev/null @@ -1,5 +0,0 @@ -for item in tender.get("items", []): - item_id = item.get("id") - if item_id and release_id: - release_tender_item_ids.add((ocid, release_id, item_id)) - get_item_scheme(item) diff --git a/docs/code_examples/kfi-item-ids.txt b/docs/code_examples/kfi-item-ids.txt deleted file mode 100644 index af33f609..00000000 --- a/docs/code_examples/kfi-item-ids.txt +++ /dev/null @@ -1,7 +0,0 @@ -for item in tender.get("items", []): - item_id = item.get("id") - if item_id: - unique_item_ids.add(item_id) - if item_id and release_id: - release_tender_item_ids.add((ocid, release_id, item_id)) - get_item_scheme(item) diff --git a/docs/code_examples/kfi-return.orig b/docs/code_examples/kfi-return.orig deleted file mode 100644 index ef00a774..00000000 --- a/docs/code_examples/kfi-return.orig +++ /dev/null @@ -1,8 +0,0 @@ -return { - # ... - "total_item_count": len(release_tender_item_ids) + len(release_award_item_ids) + len(release_contract_item_ids), - "tender_item_count": len(release_tender_item_ids), - "award_item_count": len(release_award_item_ids), - "contract_item_count": len(release_contract_item_ids), - # ... -} diff --git a/docs/code_examples/kfi-return.txt b/docs/code_examples/kfi-return.txt deleted file mode 100644 index 22090555..00000000 --- a/docs/code_examples/kfi-return.txt +++ /dev/null @@ -1,9 +0,0 @@ -return { - # ... - "total_item_count": len(release_tender_item_ids) + len(release_award_item_ids) + len(release_contract_item_ids), - "tender_item_count": len(release_tender_item_ids), - "award_item_count": len(release_award_item_ids), - "contract_item_count": len(release_contract_item_ids), - "unique_item_ids_count": len(unique_item_ids), - # ... -} diff --git a/docs/code_examples/kfi-template-added.html b/docs/code_examples/kfi-template-added.html deleted file mode 100644 index bf0a4677..00000000 --- a/docs/code_examples/kfi-template-added.html +++ /dev/null @@ -1,3 +0,0 @@ -{% trans "Total Items: " %} {{ra.total_item_count}}
-{% trans "Unique Item IDs: " %} {{ra.unique_item_ids_count}}
-{% trans "Items ID schemes: " %} {{ra.item_identifier_schemes|join:", "}}
\ No newline at end of file diff --git a/docs/code_examples/kfi-template-orig.html b/docs/code_examples/kfi-template-orig.html deleted file mode 100644 index a8b6e002..00000000 --- a/docs/code_examples/kfi-template-orig.html +++ /dev/null @@ -1,2 +0,0 @@ -{% trans "Total Items: " %} {{ra.total_item_count}}
-{% trans "Items ID schemes: " %} {{ra.item_identifier_schemes|join:", "}}
\ No newline at end of file diff --git a/docs/code_examples/kfi-variables-added.py b/docs/code_examples/kfi-variables-added.py deleted file mode 100644 index 221ce1df..00000000 --- a/docs/code_examples/kfi-variables-added.py +++ /dev/null @@ -1,5 +0,0 @@ -release_tender_item_ids = set() -release_award_item_ids = set() -release_contract_item_ids = set() -item_identifier_schemes = set() -unique_item_ids = set() diff --git a/docs/code_examples/kfi-variables-orig.py b/docs/code_examples/kfi-variables-orig.py deleted file mode 100644 index 1735ce48..00000000 --- a/docs/code_examples/kfi-variables-orig.py +++ /dev/null @@ -1,4 +0,0 @@ -release_tender_item_ids = set() -release_award_item_ids = set() -release_contract_item_ids = set() -item_identifier_schemes = set() diff --git a/docs/how-to-add-kfi.rst b/docs/how-to-add-kfi.rst deleted file mode 100644 index 30b6b372..00000000 --- a/docs/how-to-add-kfi.rst +++ /dev/null @@ -1,132 +0,0 @@ -How to add key field information -================================ - -Key Field Information is a summary of key statistics about the data that's been provided. - -Before you start ----------------- - -These instructions assume that you are familiar with OCDS, Django and Python development. The index page of these documents give instructions on how to set up and run the Data Review Tool locally, for development purposes. These instructions also assume that you're working on improvements to the live OCDS Data Review Tool, but they're equally relevant if you're modifying the DRT for a particular local use case. If you're contributing to the live DRT but aren't part of a team doing so for OCP, please contact the Data Support Team to let us know what you're working on, so that we can help make sure that your work is relevant. - -Because adding to KFI requires changes in both lib-cove-ocds and cove-ocds, you might find it helpful to install lib-cove-ocds using ``pip``'s ``-e`` option, which will ensure that changes that you make to your lib-cove-ocds installation are immediately available in your cove-ocds installation. To do this, simply run ``pip install -e /path/to/lib-cove-ocds`` after installing the normal development requirements. - -Because the code changes over time, links are to lines in specific versions of files; some copy/paste/search may be required to cross-reference with newer versions of files. - -Overview --------- - -The Key Field Information section of the results page presents summary statistics that are generated in the `lib-cove-ocds `_ library and are presented in the UI via templates in cove-ocds. To make a change, we're going to add the code that generates the statistic to lib-cove-ocds's `common_checks.py `_, and then present it in the explore_additional_content block of of the `results page template `_ - -For this article, we'll be using a real-life example that was `reported on GitHub `_ - adding a count of unique item IDs to KFI. To achieve this, we'll carry out three steps: - -* Generate the stats in common.py -* Present the stats in the template -* Write appropriate tests - -This article doesn't cover getting your work merged and deployed; please contact data@open-contracting.org if you're looking to contribute to the Data Review Tool and need help with this. - - -Generating the statistics in common.py --------------------------------------- - -common.py contains a function called ``get_release_aggregates``, which broadly comprises three parts: - -* Set up variables -* Iterate through the data, adding to various counters and collections as it goes -* Return a ``dict``, which contains either variables verbatim or with minimal processing (eg sorting) - -KFIs are generated on a best-effort basis, so be aware that the data might be invalid, missing fields, or use unexpected formats. For this reason, and for reasons of performance, KFI checks are typically small, high-level and not computationally expensive. - -.. tip:: Safely accessing data - Because KFIs are generated from data that might not be using the standard, it's important to use safe ways of accessing the data. The existing code already always uses get() to access attributes (because get() doesn't throw an exception if the key doesn't exist), and always tests that a value isn't null before using it. It also uses default values to ensure that types are correct - for example if an attribute is a list, then the default value should be an empty list in order to avoid a TypeError. New KFIs should follow these same patterns. - -In this case, KFIs already has some code that iterates through the items in each of the `tender `_, `award `_ and `contract `_ stages, so we'll be adding to that. - -First, we're going to need a new variable. We don't care about how many times an item ID appears, just the number of item IDs that appear in the whole of the data, so we'll use a ``set``: - -.. literalinclude:: code_examples/kfi-variables-added.py - :diff: code_examples/kfi-variables-orig.py - -Next, we'll add the IDs of each item to that ``set`` when we're iterating through them: - -For tenders: - -.. literalinclude:: code_examples/kfi-item-ids.txt - :language: python - :diff: code_examples/kfi-item-ids.orig - -Next, make the same change to the similar code for both awards and contracts. This is left as an exercise for the reader. - -Finally, add the new ``set`` to the return ``dict``: - -.. literalinclude:: code_examples/kfi-return.txt - :language: python - :diff: code_examples/kfi-return.orig - - -Presenting the statistics in the template ------------------------------------------ - -The `template `_ is passed the returned dict from ``get_release_aggregates``, and names it ``ra``. - -Therefore, we need to choose an appropriate place in the template, and use our new variable: - -.. literalinclude:: code_examples/kfi-template-added.html - :diff: code_examples/kfi-template-orig.html - -Because the DRT interface is fully translated, don't forget to add :doc:`translations` for the any new text in templates. - - -Adding tests ------------- - -**Note:** Edit the tests in lib-cove-ocds instead. - -Because the DRT has a lib+app architecture, we need to add tests to both the library (lib-cove-ocds) and the app (cove-ocds). This does mean that there's some duplication, but it helps to locate errors when they occur. Because there's already tests for the adjacent code, we will be modifying what's already there rather than adding new tests. - -First, we'll look at the `unit tests in lib-cove-ocds `_ - -The unit test file contains some setup at the top, and then a series of tests. - -So, we'll add our new values to the dicts that support the unit tests for the KFIs - ``EMPTY_RELEASE_AGGREGATE``, ``EXPECTED_RELEASE_AGGREGATE`` and ``EXPECTED_RELEASE_AGGREGATE_RANDOM``. - -``EMPTY_RELEASE_AGGREGATE`` is straightforward - we'll just add a row for our new variable, with a value of 0. - -``EXPECTED_RELEASE_AGGREGATE`` is populated with the expected results from `fixtures/release_aggregate.json `_ , which is a small OCDS JSON file specifically to support testing KFIs. In order to work out the values here, calculate what the value should be based on that file, and insert the relevant result. If you've got a way of calculating the value in a way that's not the code that you've just written, this is a good chance to validate that your code is behaving correctly! If the KFI that you're adding can't be calculated from the existing data in that file, then add the relevant data, and update any other values that change as a result. - -In this case, we can carry out the same calculation with ``jq`` and basic UNIX commandline tools: - -.. code-block:: bash - - jq ".releases[] | (.tender?,.awards[]?,.contracts[]?) | .items[]?.id" tests/fixtures/release_aggregate.json | sort | uniq | wc -l - 2 - -(note that various values can be can be null or missing, hence using the ? so that jq doesn't stop with an error) - -``EXPECTED_RELEASE_AGGREGATE_RANDOM`` is populated with the expected results from `fixtures/samplerubbish.json `_. This is a large OCDS JSON file that's nonsense, and is intended to provide a more robust test of the code. If the KFI that you're adding can't be calculated from the existing data in that file, then contact the Data Support Team to discuss generating a new version of the file that does include the relevant fields. - -.. code-block:: bash - - jq ".releases[] | (.tender?,.awards[]?,.contracts[]?) | .items[]?.id" tests/fixtures/samplerubbish.json | sort | uniq | wc -l - 4698 - - -Then, we'll look at the `unit tests in cove-ocds `_. These are very similar to the unit tests in lib-cove-ocds, so we'll just apply the same changes here. - -Then, we'll look at the `functional tests `_ - -There's a ``test_key_field_information`` already, so we'll just add our new value to that: - -.. literalinclude:: code_examples/kfi-functional-test.txt - :language: python - :diff: code_examples/kfi-functional-test.orig - - -Finishing up ------------- - -If you're contributing to the OCP-maintained Data Review Tool, then you'll now need to: - -* Make a PR against lib-cove-ocds with your work, and get it merged and released -* Then, make a PR against cove-ocds to use the new version of lib-cove-ocds and to include your new templates and tests. - diff --git a/docs/index.rst b/docs/index.rst index 1bfd4a68..498e7a3f 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -18,7 +18,6 @@ The `CoVE `__ documentation might also b how-to-add-a-validation-check how-to-edit-stylesheet how-to-config-frontend - how-to-add-kfi tests There are `drafts `__ of another couple how-tos for adding headlines and modifying validation error messages. diff --git a/requirements.in b/requirements.in index 14567c6a..43f06fe0 100644 --- a/requirements.in +++ b/requirements.in @@ -5,6 +5,4 @@ gunicorn[setproctitle] libcove libcoveocds[perf,web] libcoveweb -python-dateutil -rfc3339-validator sentry-sdk diff --git a/requirements.txt b/requirements.txt index 4223a136..151272a9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -72,7 +72,7 @@ libcove==0.32.1 # -r requirements.in # libcoveocds # libcoveweb -libcoveocds==0.16.2 +libcoveocds==0.17.0 # via -r requirements.in libcoveweb==0.31.0 # via -r requirements.in @@ -102,8 +102,6 @@ platformdirs==3.8.1 # via requests-cache pycparser==2.20 # via cffi -python-dateutil==2.8.1 - # via -r requirements.in pytz==2021.1 # via flattentool referencing==0.29.1 @@ -122,9 +120,7 @@ requests==2.32.3 requests-cache==1.1.0 # via ocdsextensionregistry rfc3339-validator==0.1.4 - # via - # -r requirements.in - # libcove + # via libcove rfc3987==1.3.8 # via libcove rpds-py==0.8.8 @@ -146,7 +142,6 @@ setuptools==74.1.1 six==1.16.0 # via # bleach - # python-dateutil # rfc3339-validator # url-normalize sqlparse==0.5.0 diff --git a/requirements_dev.txt b/requirements_dev.txt index 0c6d81b5..4a92cc8f 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -121,7 +121,7 @@ libcove==0.32.1 # -r requirements.txt # libcoveocds # libcoveweb -libcoveocds==0.16.2 +libcoveocds==0.17.0 # via -r requirements.txt libcoveweb==0.31.0 # via -r requirements.txt @@ -187,8 +187,6 @@ pytest-django==4.5.2 # via -r requirements_dev.in pytest-localserver==0.7.1 # via -r requirements_dev.in -python-dateutil==2.8.1 - # via -r requirements.txt pytz==2021.1 # via # -r requirements.txt @@ -248,7 +246,6 @@ six==1.16.0 # -r requirements.txt # bleach # libsass - # python-dateutil # rfc3339-validator # url-normalize sniffio==1.3.0 diff --git a/tests/fixtures/badfile_all_validation_errors_results.json b/tests/fixtures/badfile_all_validation_errors_results.json index af4ed93c..2f615d63 100644 --- a/tests/fixtures/badfile_all_validation_errors_results.json +++ b/tests/fixtures/badfile_all_validation_errors_results.json @@ -122,7 +122,6 @@ ], "version_used": "1.1", "file_type": "json", - "releases_aggregates": {}, "additional_fields": [], "all_additional_fields": [], "additional_open_codelist_values": {}, diff --git a/tests/fixtures/release_aggregate.json b/tests/fixtures/release_aggregate.json deleted file mode 100644 index fa340f6a..00000000 --- a/tests/fixtures/release_aggregate.json +++ /dev/null @@ -1,257 +0,0 @@ -{ - "releases": [ - { - "ocid": "1", - "id": "1", - "date": "2015-01-02T00:00Z", - "language": "English", - "tag": ["tender", "planning"], - "initiationType": "tender", - "buyer": { - "name": "Gov", - "identifier": {"id": "1"} - }, - "planning": { - "budget": {"amount": {"currency": "GBP"}}, - "documents": [ - { - "id": "doc1", - "documentType": "doctype1" - }, - { - "id": "doc1", - "documentType": "doctype1" - }, - { - "id": "doc1", - "documentType": "doctype2" - } - ] - }, - "tender": { - "id": "1", - "minValue": {"currency": "YEN"}, - "value": {"currency": "YEN"}, - "documents": [ - { - "id": "doc1", - "documentType": "doctype1" - }, - { - "id": "doc1", - "documentType": "doctype1" - }, - { - "id": "doc1", - "documentType": "doctype2" - } - ], - "tenderPeriod": { - "startDate": "2015-01-02T00:00Z" - }, - "procuringEntity": { - "name": "Gov", - "identifier": {"id": "1"} - }, - "tenderers": [ - { - "name": "Big corp1", - "address": {"streetAddress": "1"}, - "contactPoint": {"name": "a"} - }, - { - "name": "Big corp2" - }, - { - "name": "Big corp2" - }, - { - "name": "Big corp3", - "identifier": {"id": "2", "scheme": "a"}, - "address": {"streetAddress": "1"}, - "contactPoint": {"name": "a"} - }, - { - "name": "Big corp3", - "identifier": {"id": "2", "scheme": "b"} - } - ], - "items": [ - { - "id": "1", - "classification": { - "scheme": "scheme1" - } - }, - { - "id": "2", - "classification": { - "scheme": "scheme2" - } - } - ], - "milestones": [ - { - "id": "1", - "documents": [ - { - "id": "doc1", - "documentType": "doctype1" - }, - { - "id": "doc2", - "documentType": "doctype1" - }, - { - "id": "doc1", - "documentType": "doctype2" - } - ] - } - ] - }, - "awards": [ - { - "id": "2", - "date": "2015-01-02T00:00Z", - "value": {"currency": "USD"} - }, - { - "id": "1", - "date": "2015-01-01T00:00Z", - "items": [ - { - "id": "1", - "classification": { - "scheme": "scheme1" - } - }, - { - "id": "2", - "classification": { - "scheme": "scheme2" - } - } - ], - "suppliers": [ - { - "name": "Big corp1", - "address": {"streetAddress": "1"}, - "contactPoint": {"name": "a"} - }, - { - "name": "Big corp2" - }, - { - "name": "Big corp2" - }, - { - "name": "Big corp3", - "identifier": {"id": "2"}, - "address": {"streetAddress": "1"}, - "contactPoint": {"name": "a"} - }, - { - "name": "Big corp3", - "identifier": {"id": "2"} - } - ], - "documents": [ - { - "id": "doc1", - "documentType": "doctype1" - }, - { - "id": "doc1", - "documentType": "doctype1" - }, - { - "id": "doc1", - "documentType": "doctype2" - } - ] - } - ], - "contracts": [ - { - "id": "2", - "awardID": "no", - "period": { - "startDate": "2015-01-02T00:00Z" - }, - "value": {"currency": "EUR"} - }, - { - "id": "1", - "awardID": "1", - "period": { - "startDate": "2015-01-01T00:00Z" - }, - "items": [ - { - "id": "1", - "classification": { - "scheme": "scheme1" - } - }, - { - "id": "2", - "classification": { - "scheme": "scheme2" - } - } - ], - "documents": [ - { - "id": "doc1", - "documentType": "doctype1" - }, - { - "id": "doc1", - "documentType": "doctype1" - }, - { - "id": "doc1", - "documentType": "doctype2" - } - ], - "implementation": { - "documents": [ - { - "id": "doc1", - "documentType": "doctype1" - }, - { - "id": "doc1", - "documentType": "doctype1" - }, - { - "id": "doc1", - "documentType": "doctype2" - } - ], - "milestones": [ - { - "id": "1", - "documents": [ - { - "id": "doc1", - "documentType": "doctype1" - }, - { - "id": "doc1", - "documentType": "doctype1" - }, - { - "id": "doc1", - "documentType": "doctype2" - } - ] - } - ] - } - } - ] - } - ] -} diff --git a/tests/test_functional.py b/tests/test_functional.py index 59977a4b..badc7f56 100644 --- a/tests/test_functional.py +++ b/tests/test_functional.py @@ -235,7 +235,6 @@ def test_500_error(server_url, browser): "documents at the milestone level is now deprecated", "releases/0/contracts/1/milestones/0", "releases/1/tender", - "Contracts with no awards: 3", ], ["copy of the schema with extension"], True, @@ -354,7 +353,6 @@ def test_500_error(server_url, browser): ( "full_record.json", [ - "Number of records", "Structural Errors", "compiledRelease", "versionedRelease", @@ -1064,28 +1062,6 @@ def test_error_list_999_lines_sample(skip_if_remote, settings_error_locations_sa assert len(table_rows) == 999 -@pytest.mark.parametrize( - ("source_filename", "expected"), - [ - ( - "release_aggregate.json", - [ - "Unique OCIDs: 1", - "Unique Item IDs: 2", - "Currencies: EUR, GBP, USD, YEN", - ], - ), - ], -) -def test_key_field_information(server_url, url_input_browser, httpserver, source_filename, expected): - """Check that KFIs are displaying""" - - browser = url_input_browser(source_filename) - kfi_text = browser.find_element(By.ID, "kfi").text - for text in expected: - assert text in kfi_text - - def test_jsonschema_translation( url_input_browser, ): diff --git a/tests/test_hypothesis.py b/tests/test_hypothesis.py index 57ed6e47..b83e6e75 100644 --- a/tests/test_hypothesis.py +++ b/tests/test_hypothesis.py @@ -3,9 +3,8 @@ import pytest from cove.input.models import SuppliedData from django.core.files.base import ContentFile -from hypothesis import HealthCheck, assume, example, given, settings +from hypothesis import HealthCheck, example, given, settings from hypothesis import strategies as st -from libcoveocds.lib.common_checks import get_releases_aggregates """ ## Suggested testing patterns (from CamPUG talk) @@ -21,18 +20,6 @@ ) -@given(general_json) -def test_get_releases_aggregates(json_data): - get_releases_aggregates(json_data) - - -@given(general_json) -@settings(suppress_health_check=[HealthCheck.too_slow]) -def test_get_releases_aggregates_dict(json_data): - assume(type(json_data) is dict) - get_releases_aggregates(json_data) - - @pytest.mark.xfail @pytest.mark.django_db @pytest.mark.parametrize("current_app", ["cove-ocds"]) From 8c3a3436c1c6a710118c7b7a88a8c39f61794d54 Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Sat, 19 Oct 2024 14:31:55 -0400 Subject: [PATCH 06/37] chore(content): Remove "More Information" and "User Tracking" blocks --- cove_ocds/locale/en/LC_MESSAGES/django.po | 152 +------------- cove_ocds/locale/es/LC_MESSAGES/django.po | 200 +------------------ cove_ocds/templates/cove_ocds/base.html | 4 - cove_ocds/templates/cove_ocds/more_info.html | 45 ----- tests/test_functional.py | 4 - 5 files changed, 18 insertions(+), 387 deletions(-) delete mode 100644 cove_ocds/templates/cove_ocds/more_info.html diff --git a/cove_ocds/locale/en/LC_MESSAGES/django.po b/cove_ocds/locale/en/LC_MESSAGES/django.po index c58bc6e1..81bf9359 100644 --- a/cove_ocds/locale/en/LC_MESSAGES/django.po +++ b/cove_ocds/locale/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-19 07:48+0000\n" +"POT-Creation-Date: 2024-10-19 18:32+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -163,35 +163,35 @@ msgid "" "example/1.1/ocds-213czf-000-00001-02-tender.json" msgstr "" -#: cove_ocds/templates/cove_ocds/base.html:153 +#: cove_ocds/templates/cove_ocds/base.html:149 msgid "Built by" msgstr "" -#: cove_ocds/templates/cove_ocds/base.html:153 +#: cove_ocds/templates/cove_ocds/base.html:149 msgid "Open Data Services" msgstr "" -#: cove_ocds/templates/cove_ocds/base.html:154 +#: cove_ocds/templates/cove_ocds/base.html:150 msgid "The code for this site is available on" msgstr "" -#: cove_ocds/templates/cove_ocds/base.html:154 +#: cove_ocds/templates/cove_ocds/base.html:150 msgid "GitHub" msgstr "" -#: cove_ocds/templates/cove_ocds/base.html:154 +#: cove_ocds/templates/cove_ocds/base.html:150 msgid "Licence" msgstr "" -#: cove_ocds/templates/cove_ocds/base.html:154 +#: cove_ocds/templates/cove_ocds/base.html:150 msgid "AGPLv3" msgstr "" -#: cove_ocds/templates/cove_ocds/base.html:154 +#: cove_ocds/templates/cove_ocds/base.html:150 msgid "Report/View issues" msgstr "" -#: cove_ocds/templates/cove_ocds/base.html:154 +#: cove_ocds/templates/cove_ocds/base.html:150 msgid "cove-ocds issues" msgstr "" @@ -719,140 +719,6 @@ msgstr "" msgid "Paste" msgstr "" -#: cove_ocds/templates/cove_ocds/more_info.html:4 -msgid "More Information " -msgstr "" - -#: cove_ocds/templates/cove_ocds/more_info.html:4 -msgid "click to see." -msgstr "" - -#: cove_ocds/templates/cove_ocds/more_info.html:10 -msgid "What happens to the data I provide to this site?" -msgstr "" - -#: cove_ocds/templates/cove_ocds/more_info.html:11 -#, python-format -msgid "" -"We retain the data you upload or paste to this site, on our server, for " -"%(delete_files_after_days)s days." -msgstr "" - -#: cove_ocds/templates/cove_ocds/more_info.html:12 -#, python-format -msgid "" -"If you supply a link, we fetch the data from that link and store it on our " -"server for %(delete_files_after_days)s days." -msgstr "" - -#: cove_ocds/templates/cove_ocds/more_info.html:13 -#, python-format -msgid "" -"We delete all data older than %(delete_files_after_days)s days from our " -"servers daily, retaining none of the original data." -msgstr "" - -#: cove_ocds/templates/cove_ocds/more_info.html:14 -msgid "" -"While the data is on our servers we may access that data to help us " -"understand how people are using this application, what types of data are " -"being supplied, what common errors exist and so on." -msgstr "" - -#: cove_ocds/templates/cove_ocds/more_info.html:15 -msgid "" -"We may also retain data in backups of our servers, which means on occasion, " -"some data may be retained longer. We have no intention of using this data " -"for anything other than server recovery in an emergency." -msgstr "" - -#: cove_ocds/templates/cove_ocds/more_info.html:16 -msgid "" -"We do retain some metadata about data supplied to this site. Details can be " -"found in the code, but may include information about whether or not the file " -"was uploaded, linked or pasted, the size of the file, the date/time it was " -"supplied and so on. " -msgstr "" - -#: cove_ocds/templates/cove_ocds/more_info.html:18 -#, python-format -msgid "Why do you delete data after %(delete_files_after_days)s days?" -msgstr "" - -#: cove_ocds/templates/cove_ocds/more_info.html:19 -#, python-format -msgid "" -"This is service to allow people to explore machine readable data. As such we " -"see no need to store and gather everything people submit to the site " -"forever. We have chosen %(delete_files_after_days)s days as a practical time " -"frame that allows people to share results with colleagues, but also allows " -"data to disappear over time to save people having to clean up after " -"themselves." -msgstr "" - -#: cove_ocds/templates/cove_ocds/more_info.html:20 -#, python-format -msgid "" -"We believe that deleting supplied data after %(delete_files_after_days)s " -"days provides a level of privacy for the users of this service. " -msgstr "" - -#: cove_ocds/templates/cove_ocds/more_info.html:24 -msgid "Why provide converted versions?" -msgstr "" - -#: cove_ocds/templates/cove_ocds/more_info.html:25 -msgid "The W3C" -msgstr "" - -#: cove_ocds/templates/cove_ocds/more_info.html:25 -msgid "Data on the Web Best Practices" -msgstr "" - -#: cove_ocds/templates/cove_ocds/more_info.html:25 -msgid "" -"recommend making open data available in a range of formats to meet the needs " -"of different users, for example, developers may want JSON, researchers might " -"prefer a spreadsheet format." -msgstr "" - -#: cove_ocds/templates/cove_ocds/more_info.html:33 -msgid "User Tracking" -msgstr "" - -#: cove_ocds/templates/cove_ocds/more_info.html:37 -msgid "What information does the tool collect about website visitors?" -msgstr "" - -#: cove_ocds/templates/cove_ocds/more_info.html:39 -#, python-format -msgid "" -"In order to understand who is using the Data Review Tool and how they use " -"it, we collect basic analytics data about users. For more information and to " -"learn how to opt out of this, see the Privacy " -"Notice." -msgstr "" - -#: cove_ocds/templates/cove_ocds/more_info.html:40 -#, python-format -msgid "" -"We also collect server logs, which we analyse from time to time to " -"understand traffic to the site. Users cannot opt out of this data " -"collection, and data is treated with respect. For more information, see the " -"Privacy Notice." -msgstr "" - -#: cove_ocds/templates/cove_ocds/more_info.html:42 -#, python-format -msgid "" -"In order to understand the behaviour of website visitors, to help us " -"understand the most popular features and understand potential sources of " -"frustration for website users, we are currently running a time-limited " -"experiment using HotJar behaviour tracking. For more information and to " -"learn how to opt out of this, see the Privacy " -"Notice." -msgstr "" - #: cove_ocds/templates/cove_ocds/ocds_missing_ids_table.html:3 #, python-format msgid "" diff --git a/cove_ocds/locale/es/LC_MESSAGES/django.po b/cove_ocds/locale/es/LC_MESSAGES/django.po index 1b6acb2e..155ff867 100644 --- a/cove_ocds/locale/es/LC_MESSAGES/django.po +++ b/cove_ocds/locale/es/LC_MESSAGES/django.po @@ -15,7 +15,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-19 07:48+0000\n" +"POT-Creation-Date: 2024-10-19 18:32+0000\n" "PO-Revision-Date: 2020-09-08 08:53+0000\n" "Last-Translator: James McKinney, 2024\n" "Language-Team: Spanish (https://app.transifex.com/open-contracting-" @@ -211,35 +211,35 @@ msgstr "" "https://raw.githubusercontent.com/open-contracting/sample-data/main/" "fictional-example/1.1/ocds-213czf-000-00001-02-tender.json" -#: cove_ocds/templates/cove_ocds/base.html:153 +#: cove_ocds/templates/cove_ocds/base.html:149 msgid "Built by" msgstr "Construido por " -#: cove_ocds/templates/cove_ocds/base.html:153 +#: cove_ocds/templates/cove_ocds/base.html:149 msgid "Open Data Services" msgstr "Open Data Services" -#: cove_ocds/templates/cove_ocds/base.html:154 +#: cove_ocds/templates/cove_ocds/base.html:150 msgid "The code for this site is available on" msgstr "El código de este sitio está disponible en " -#: cove_ocds/templates/cove_ocds/base.html:154 +#: cove_ocds/templates/cove_ocds/base.html:150 msgid "GitHub" msgstr "GitHub" -#: cove_ocds/templates/cove_ocds/base.html:154 +#: cove_ocds/templates/cove_ocds/base.html:150 msgid "Licence" msgstr "Licencia" -#: cove_ocds/templates/cove_ocds/base.html:154 +#: cove_ocds/templates/cove_ocds/base.html:150 msgid "AGPLv3" msgstr "AGPLv3" -#: cove_ocds/templates/cove_ocds/base.html:154 +#: cove_ocds/templates/cove_ocds/base.html:150 msgid "Report/View issues" msgstr "Reportar / Ver issues" -#: cove_ocds/templates/cove_ocds/base.html:154 +#: cove_ocds/templates/cove_ocds/base.html:150 msgid "cove-ocds issues" msgstr "cove-ocds issues" @@ -871,188 +871,6 @@ msgstr "Subir" msgid "Paste" msgstr "Pegar" -#: cove_ocds/templates/cove_ocds/more_info.html:4 -msgid "More Information " -msgstr "Más información" - -#: cove_ocds/templates/cove_ocds/more_info.html:4 -msgid "click to see." -msgstr "Haga clic para ver." - -#: cove_ocds/templates/cove_ocds/more_info.html:10 -msgid "What happens to the data I provide to this site?" -msgstr "¿Qué sucede con los datos que proporciono a este sitio?" - -#: cove_ocds/templates/cove_ocds/more_info.html:11 -#, python-format -msgid "" -"We retain the data you upload or paste to this site, on our server, for " -"%(delete_files_after_days)s days." -msgstr "" -"Conservamos los datos que cargas o pegas a este sitio en nuestro servidor " -"durante %(delete_files_after_days)s días." - -#: cove_ocds/templates/cove_ocds/more_info.html:12 -#, python-format -msgid "" -"If you supply a link, we fetch the data from that link and store it on our " -"server for %(delete_files_after_days)s days." -msgstr "" -"Si proporciona un enlace, buscamos los datos de ese enlace y los almacenamos " -"en nuestro servidor durante %(delete_files_after_days)s días." - -#: cove_ocds/templates/cove_ocds/more_info.html:13 -#, python-format -msgid "" -"We delete all data older than %(delete_files_after_days)s days from our " -"servers daily, retaining none of the original data." -msgstr "" -"Borramos todos los datos de más de %(delete_files_after_days)s días desde " -"nuestros servidores diariamente, no conservamos ninguno de los datos " -"originales." - -#: cove_ocds/templates/cove_ocds/more_info.html:14 -msgid "" -"While the data is on our servers we may access that data to help us " -"understand how people are using this application, what types of data are " -"being supplied, what common errors exist and so on." -msgstr "" -"Mientras los datos están en nuestros servidores podemos acceder a ellos para " -"ayudarnos a entender cómo las personas usan esta aplicación, los tipos de " -"datos suministrados, los errores más comunes que existen, etc." - -#: cove_ocds/templates/cove_ocds/more_info.html:15 -msgid "" -"We may also retain data in backups of our servers, which means on occasion, " -"some data may be retained longer. We have no intention of using this data " -"for anything other than server recovery in an emergency." -msgstr "" -"También podemos conservar datos en las copias de seguridad de nuestros " -"servidores, lo que significa que algunos datos pueden ser retenidos por más " -"tiempo. No tenemos ninguna intención de utilizar estos datos para nada que " -"no sea la recuperación del servidor en caso de emergencia." - -#: cove_ocds/templates/cove_ocds/more_info.html:16 -msgid "" -"We do retain some metadata about data supplied to this site. Details can be " -"found in the code, but may include information about whether or not the file " -"was uploaded, linked or pasted, the size of the file, the date/time it was " -"supplied and so on. " -msgstr "" -"Guardamos algunos metadatos sobre los datos suministrados a este sitio. Los " -"detalles se pueden encontrar en el código, pero pueden incluir información " -"sobre si el archivo fue subido, vinculado o pegado, el tamaño del archivo, " -"la fecha / hora en que se suministra y así sucesivamente." - -#: cove_ocds/templates/cove_ocds/more_info.html:18 -#, python-format -msgid "Why do you delete data after %(delete_files_after_days)s days?" -msgstr "" -"¿Por qué eliminan los datos después de %(delete_files_after_days)s días?" - -#: cove_ocds/templates/cove_ocds/more_info.html:19 -#, python-format -msgid "" -"This is service to allow people to explore machine readable data. As such we " -"see no need to store and gather everything people submit to the site " -"forever. We have chosen %(delete_files_after_days)s days as a practical time " -"frame that allows people to share results with colleagues, but also allows " -"data to disappear over time to save people having to clean up after " -"themselves." -msgstr "" -"Este es un servicio que permite a la gente a explorar datos legibles por " -"computadora. Como tal no vemos la necesidad de almacenar y reunir todo lo " -"que la gente subre al sitio por siempre. Hemos optado por " -"%(delete_files_after_days)s días como un tiempo práctico que permite a la " -"gente compartir los resultados con colegas, pero también permite que los " -"datos desaparezcan a su debido tiempo para así ahorrar a las personas tener " -"que hacer una limpieza ellos mismos." - -#: cove_ocds/templates/cove_ocds/more_info.html:20 -#, python-format -msgid "" -"We believe that deleting supplied data after %(delete_files_after_days)s " -"days provides a level of privacy for the users of this service. " -msgstr "" -"Creemos que la supresión de los datos suministrados después de " -"%(delete_files_after_days)s días proporciona un nivel de privacidad para los " -"usuarios de este servicio." - -#: cove_ocds/templates/cove_ocds/more_info.html:24 -msgid "Why provide converted versions?" -msgstr "¿Por qué ofrecer versiones convertidas?" - -#: cove_ocds/templates/cove_ocds/more_info.html:25 -msgid "The W3C" -msgstr "El W3C" - -#: cove_ocds/templates/cove_ocds/more_info.html:25 -msgid "Data on the Web Best Practices" -msgstr "Datos sobre Mejores Prácticas en la Web" - -#: cove_ocds/templates/cove_ocds/more_info.html:25 -msgid "" -"recommend making open data available in a range of formats to meet the needs " -"of different users, for example, developers may want JSON, researchers might " -"prefer a spreadsheet format." -msgstr "" -"recomienda ofrecer los datos abiertos en una variedad de formatos para " -"satisfacer las necesidades de los distintos usuarios. Por ejemplo, los " -"desarrolladores pueden requerir JSON, mientras los investigadores puede que " -"prefieran un formato de hoja de cálculo." - -#: cove_ocds/templates/cove_ocds/more_info.html:33 -msgid "User Tracking" -msgstr "Rastreo de Usuarios" - -#: cove_ocds/templates/cove_ocds/more_info.html:37 -msgid "What information does the tool collect about website visitors?" -msgstr "" -"¿Qué información obtiene la herramienta sobre los usuarios de la página web?" - -#: cove_ocds/templates/cove_ocds/more_info.html:39 -#, python-format -msgid "" -"In order to understand who is using the Data Review Tool and how they use " -"it, we collect basic analytics data about users. For more information and to " -"learn how to opt out of this, see the Privacy " -"Notice." -msgstr "" -"Para poder entender quien usa la Herramienta de Revisión de Datos y como la " -"usan, recolectamos analítica básica sobre los usuarios. Para más información " -"y para entender como puede optar para que no recolectemos sus datos, vea " -"elAviso de Privacidad." - -#: cove_ocds/templates/cove_ocds/more_info.html:40 -#, python-format -msgid "" -"We also collect server logs, which we analyse from time to time to " -"understand traffic to the site. Users cannot opt out of this data " -"collection, and data is treated with respect. For more information, see the " -"Privacy Notice." -msgstr "" -"También recolectamos registros del servidor, los cuáles analizamos para " -"entender el tráfico en el sitio. Los usuarios no pueden optar porque esta " -"información no sea recolectada, y los datos se tratan con respecto. Para más " -"información, vea el Aviso de privacidad ." - -#: cove_ocds/templates/cove_ocds/more_info.html:42 -#, python-format -msgid "" -"In order to understand the behaviour of website visitors, to help us " -"understand the most popular features and understand potential sources of " -"frustration for website users, we are currently running a time-limited " -"experiment using HotJar behaviour tracking. For more information and to " -"learn how to opt out of this, see the Privacy " -"Notice." -msgstr "" -"Para poder entender el comportamiento de los usuarios del sitio y para " -"entender las funciones más populares, y fuentes potenciales de frustración " -"para los usuarios del sitio, actualmente usamos un experimento de tiempo " -"limitado utilizando el rastreador de comportamiento HotJar. Para más " -"información y para entender como optar por no ser parte de este experimento, " -"vea el Aviso de Privacidad." - #: cove_ocds/templates/cove_ocds/ocds_missing_ids_table.html:3 #, python-format msgid "" diff --git a/cove_ocds/templates/cove_ocds/base.html b/cove_ocds/templates/cove_ocds/base.html index 7e6d9c2c..cbaa7827 100644 --- a/cove_ocds/templates/cove_ocds/base.html +++ b/cove_ocds/templates/cove_ocds/base.html @@ -145,10 +145,6 @@

{% blocktrans %}Using the data review tool {% endblock %} -{% block bottomcontent3 %} -{% include "cove_ocds/more_info.html" %} -{% endblock %} - {% block about %}
  • {% trans "Built by" %} {% trans "Open Data Services" %}
  • {% trans "The code for this site is available on" %}
    {% trans "GitHub" %}: cove-ocds
    {% trans "Licence" %}: {% trans "AGPLv3" %}
    {% trans "Report/View issues" %}: {% trans "cove-ocds issues" %} diff --git a/cove_ocds/templates/cove_ocds/more_info.html b/cove_ocds/templates/cove_ocds/more_info.html deleted file mode 100644 index 6f361586..00000000 --- a/cove_ocds/templates/cove_ocds/more_info.html +++ /dev/null @@ -1,45 +0,0 @@ -{% load i18n %} -
    -
    -

    {% blocktrans %}More Information {% endblocktrans %} {% blocktrans %}click to see.{% endblocktrans %}

    -
    - -
    -
    - {% block deletingData %} -

    {% trans "What happens to the data I provide to this site?" %}

    -

    {% blocktrans %}We retain the data you upload or paste to this site, on our server, for {{ delete_files_after_days }} days.{% endblocktrans %}

    -

    {% blocktrans %}If you supply a link, we fetch the data from that link and store it on our server for {{ delete_files_after_days }} days.{% endblocktrans %}

    -

    {% blocktrans %}We delete all data older than {{ delete_files_after_days }} days from our servers daily, retaining none of the original data.{% endblocktrans %}

    -

    {% blocktrans %}While the data is on our servers we may access that data to help us understand how people are using this application, what types of data are being supplied, what common errors exist and so on.{% endblocktrans %}

    -

    {% blocktrans %}We may also retain data in backups of our servers, which means on occasion, some data may be retained longer. We have no intention of using this data for anything other than server recovery in an emergency.{% endblocktrans %}

    -

    {% blocktrans %}We do retain some metadata about data supplied to this site. Details can be found in the code, but may include information about whether or not the file was uploaded, linked or pasted, the size of the file, the date/time it was supplied and so on. {% endblocktrans %}

    - -

    {% blocktrans %}Why do you delete data after {{ delete_files_after_days }} days?{% endblocktrans %}

    -

    {% blocktrans %}This is service to allow people to explore machine readable data. As such we see no need to store and gather everything people submit to the site forever. We have chosen {{ delete_files_after_days }} days as a practical time frame that allows people to share results with colleagues, but also allows data to disappear over time to save people having to clean up after themselves.{% endblocktrans %}

    -

    {% blocktrans %}We believe that deleting supplied data after {{ delete_files_after_days }} days provides a level of privacy for the users of this service. {% endblocktrans %}

    - {% endblock %} - - {% block whyConvert %} -

    {% trans "Why provide converted versions?" %}

    -

    {% blocktrans %}The W3C{% endblocktrans %} {% blocktrans %}Data on the Web Best Practices{% endblocktrans %} {% blocktrans %}recommend making open data available in a range of formats to meet the needs of different users, for example, developers may want JSON, researchers might prefer a spreadsheet format.{% endblocktrans %}

    - {% endblock %} -
    -
    -
    - -
    -
    -

    {% blocktrans %}User Tracking{% endblocktrans %}

    -
    - -
    -

    {% trans "What information does the tool collect about website visitors?" %}

    - {% url 'terms' as terms_url %} -

    {% blocktrans with terms_privacy=terms_url|add:"#privacy_notice" %}In order to understand who is using the Data Review Tool and how they use it, we collect basic analytics data about users. For more information and to learn how to opt out of this, see the Privacy Notice.{% endblocktrans %}

    -

    {% blocktrans with terms_privacy=terms_url|add:"#privacy_notice" %}We also collect server logs, which we analyse from time to time to understand traffic to the site. Users cannot opt out of this data collection, and data is treated with respect. For more information, see the Privacy Notice.{% endblocktrans %}

    - {% if hotjar.id %} -

    {% blocktrans with terms_privacy=terms_url|add:"#privacy_notice" %}In order to understand the behaviour of website visitors, to help us understand the most popular features and understand potential sources of frustration for website users, we are currently running a time-limited experiment using HotJar behaviour tracking. For more information and to learn how to opt out of this, see the Privacy Notice.{% endblocktrans %}

    - {% endif %} -
    -
    diff --git a/tests/test_functional.py b/tests/test_functional.py index badc7f56..6b4a98b9 100644 --- a/tests/test_functional.py +++ b/tests/test_functional.py @@ -91,10 +91,6 @@ def test_index_page_ocds_links(server_url, browser, css_id, link_text, url): def test_common_index_elements(server_url, browser): browser.get(server_url) - browser.find_element(By.CSS_SELECTOR, "#more-information .panel-title").click() - time.sleep(0.5) - assert "What happens to the data I provide to this site?" in browser.find_element(By.TAG_NAME, "body").text - assert "Why provide converted versions?" in browser.find_element(By.TAG_NAME, "body").text assert "Terms & Conditions" in browser.find_element(By.TAG_NAME, "body").text assert "Open Data Services" in browser.find_element(By.TAG_NAME, "body").text assert "360 Giving" not in browser.find_element(By.TAG_NAME, "body").text From 054da03f36691b581d3a8c4d1f1188b1216fef3c Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Sat, 19 Oct 2024 15:10:02 -0400 Subject: [PATCH 07/37] feat: Remove conversion to CSV and Excel conversion_error and conversion_warning_messages_titles are relevant to convert_json only --- README.rst | 2 +- cove_ocds/locale/en/LC_MESSAGES/django.po | 166 +++++++---------- cove_ocds/locale/es/LC_MESSAGES/django.po | 175 +++++++----------- .../templates/cove_ocds/explore_base.html | 63 +------ .../templates/cove_ocds/explore_record.html | 2 +- .../templates/cove_ocds/explore_release.html | 2 +- cove_ocds/views.py | 31 +--- docs/architecture.rst | 10 +- docs/template-structure.rst | 2 - docs/tests.rst | 2 +- tests/test_functional.py | 58 ++---- tests/test_general.py | 77 +------- 12 files changed, 169 insertions(+), 421 deletions(-) diff --git a/README.rst b/README.rst index 4b66dcb2..c4ffb9d7 100644 --- a/README.rst +++ b/README.rst @@ -1,4 +1,4 @@ -The DRT is a web application that allows you to review Open Contracting data, validate it against the Open Contracting Data Standard, and review it for errors or places for improvement. You can also use it to convert data between JSON and Excel spreadsheet formats. +The DRT is a web application that allows you to review Open Contracting data, validate it against the Open Contracting Data Standard, and review it for errors or places for improvement. Docs about running locally etc. at https://ocds-data-review-tool.readthedocs.io/en/latest/ diff --git a/cove_ocds/locale/en/LC_MESSAGES/django.po b/cove_ocds/locale/en/LC_MESSAGES/django.po index 81bf9359..aa7e5cae 100644 --- a/cove_ocds/locale/en/LC_MESSAGES/django.po +++ b/cove_ocds/locale/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-19 18:32+0000\n" +"POT-Creation-Date: 2024-10-19 18:45+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -39,7 +39,6 @@ msgstr "" #. Translators: Label of a button that triggers search #: cove_ocds/templates/cove_ocds/base.html:54 -#: cove_ocds/templates/cove_ocds/explore_base.html:46 msgid "Go" msgstr "" @@ -246,172 +245,135 @@ msgid "" "%(release_or_record)s package schema version %(version_used_display)s." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:26 -msgid "" -"You can choose a different version of the schema to check and explore your " -"data." -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_base.html:28 -msgid "Check and explore same data against a different version of the schema" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_base.html:31 -msgid "" -"Switching the schema version will result in changes to CoVE output and " -"conversions. If you revisit or share this URL, the latest version selected " -"will be used to check your data" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_base.html:58 +#: cove_ocds/templates/cove_ocds/explore_base.html:37 msgid "Convert" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:65 +#: cove_ocds/templates/cove_ocds/explore_base.html:44 msgid "" "There were conversion warnings when " "processing your file. The converted data may not represent your data as you " "want it to be." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:68 -msgid "We have tried to convert your JSON into a spreadsheet format." +#: cove_ocds/templates/cove_ocds/explore_base.html:46 +msgid "We have tried to convert your data into JSON format." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:68 -#: cove_ocds/templates/cove_ocds/explore_base.html:92 +#: cove_ocds/templates/cove_ocds/explore_base.html:46 msgid "The results can be seen below." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:75 -#: cove_ocds/templates/cove_ocds/explore_base.html:80 -#: cove_ocds/templates/cove_ocds/explore_base.html:106 +#: cove_ocds/templates/cove_ocds/explore_base.html:60 msgid "using schema version" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:86 -msgid "The JSON could not be converted to Spreadsheet due to the error:" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_base.html:92 -msgid "We have tried to convert your data into JSON format." -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_base.html:118 -msgid "Convert to Spreadsheet" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_base.html:139 +#: cove_ocds/templates/cove_ocds/explore_base.html:77 msgid "Schema Extensions" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:145 +#: cove_ocds/templates/cove_ocds/explore_base.html:83 msgid "" "Your data has been checked against schema version 1.0 and " "includes extensions but extensions were not introduced in the schema until " "version 1.1." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:148 +#: cove_ocds/templates/cove_ocds/explore_base.html:86 msgid "Your data contains the following schema extensions" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:148 +#: cove_ocds/templates/cove_ocds/explore_base.html:86 msgid ", but it wasn't possible to fetch them" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:154 +#: cove_ocds/templates/cove_ocds/explore_base.html:92 msgid "release schema" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:171 +#: cove_ocds/templates/cove_ocds/explore_base.html:109 msgid "The following extensions failed:" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:181 +#: cove_ocds/templates/cove_ocds/explore_base.html:119 msgid "" "Only those extensions successfully fetched were applied to extend the schema." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:183 +#: cove_ocds/templates/cove_ocds/explore_base.html:121 msgid "All the extensions above were applied to extend the schema." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:185 +#: cove_ocds/templates/cove_ocds/explore_base.html:123 msgid "Get a copy of the schema with extension patches applied" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:187 +#: cove_ocds/templates/cove_ocds/explore_base.html:125 msgid "" "None of the extensions above could be applied. Your data has been checked " "against a schema with no extensions." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:200 +#: cove_ocds/templates/cove_ocds/explore_base.html:138 msgid "Conversion Errors" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:205 -#: cove_ocds/templates/cove_ocds/explore_base.html:227 +#: cove_ocds/templates/cove_ocds/explore_base.html:143 msgid "" "In order to check your data we need to convert it. During that conversion we " "found the following issues:" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:222 -msgid "Conversion Errors (titles)" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_base.html:250 +#: cove_ocds/templates/cove_ocds/explore_base.html:167 msgid "Structural Errors - Required Fields" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:254 +#: cove_ocds/templates/cove_ocds/explore_base.html:171 msgid "" "Some or all of your data is missing fields which are required by the OCDS " "schema." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:274 +#: cove_ocds/templates/cove_ocds/explore_base.html:191 msgid "Structural Errors - Format" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:278 +#: cove_ocds/templates/cove_ocds/explore_base.html:195 msgid "" "Some or all of your data includes fields which are incorrectly formatted." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:298 +#: cove_ocds/templates/cove_ocds/explore_base.html:215 msgid "Structural Errors - Other" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:302 +#: cove_ocds/templates/cove_ocds/explore_base.html:219 msgid "Some or all of your data has validation errors." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:315 -#: cove_ocds/templates/cove_ocds/explore_base.html:487 -#: cove_ocds/templates/cove_ocds/explore_base.html:490 +#: cove_ocds/templates/cove_ocds/explore_base.html:232 +#: cove_ocds/templates/cove_ocds/explore_base.html:404 +#: cove_ocds/templates/cove_ocds/explore_base.html:407 msgid "Structure Warnings" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:320 -#: cove_ocds/templates/cove_ocds/explore_base.html:342 +#: cove_ocds/templates/cove_ocds/explore_base.html:237 +#: cove_ocds/templates/cove_ocds/explore_base.html:259 msgid "" "Fixing the following issues will improve the interoperability of your data." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:337 -#: cove_ocds/templates/cove_ocds/explore_base.html:475 -#: cove_ocds/templates/cove_ocds/explore_base.html:478 +#: cove_ocds/templates/cove_ocds/explore_base.html:254 +#: cove_ocds/templates/cove_ocds/explore_base.html:392 +#: cove_ocds/templates/cove_ocds/explore_base.html:395 msgid "Conformance (Rules)" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:359 +#: cove_ocds/templates/cove_ocds/explore_base.html:276 msgid "Codelist Errors" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:364 +#: cove_ocds/templates/cove_ocds/explore_base.html:281 msgid "" "The fields below use closed codelists. When using these fields, you " "must use one of the pre-defined codelist values. If you use a " @@ -421,7 +383,7 @@ msgid "" "extensions." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:368 +#: cove_ocds/templates/cove_ocds/explore_base.html:285 msgid "" "You may need to create a mapping between your local codes and the OCDS " "closed codelists to address these errors. In most cases, there will be a " @@ -430,11 +392,11 @@ msgid "" "used in these closed codelist fields." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:379 +#: cove_ocds/templates/cove_ocds/explore_base.html:296 msgid "Additional Fields" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:383 +#: cove_ocds/templates/cove_ocds/explore_base.html:300 msgid "" "This data includes the following fields which are not part of the OCDS " "schema. You should check whether the data in these fields could be provided " @@ -443,11 +405,11 @@ msgid "" "\">extension to the schema." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:397 +#: cove_ocds/templates/cove_ocds/explore_base.html:314 msgid "Additional Codelist Values" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:401 +#: cove_ocds/templates/cove_ocds/explore_base.html:318 msgid "" "Your data contains a number of fields that use an open codelist. You should " "use values from the codelist whenever possible, but if the codelist does not " @@ -458,7 +420,7 @@ msgid "" "(-) by one or more extensions." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:407 +#: cove_ocds/templates/cove_ocds/explore_base.html:324 msgid "" "Make sure you list the definition of any additional codelist values you " "include within your OCDS issue tracker." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:417 +#: cove_ocds/templates/cove_ocds/explore_base.html:334 msgid "Additional Checks" msgstr "" +#: cove_ocds/templates/cove_ocds/explore_base.html:348 +#: cove_ocds/templates/cove_ocds/explore_base.html:428 #: cove_ocds/templates/cove_ocds/explore_base.html:431 -#: cove_ocds/templates/cove_ocds/explore_base.html:511 -#: cove_ocds/templates/cove_ocds/explore_base.html:514 msgid "Deprecated Fields" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:431 +#: cove_ocds/templates/cove_ocds/explore_base.html:348 msgid "" "Fields flagged as 'deprecated' will be either replaced or removed in future " "versions of the schema." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:447 +#: cove_ocds/templates/cove_ocds/explore_base.html:364 msgid "Save or Share these results" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:448 +#: cove_ocds/templates/cove_ocds/explore_base.html:365 msgid "Use the following url to share these results:" msgstr "" #. Translators: Paragraph that describes the application -#: cove_ocds/templates/cove_ocds/explore_base.html:453 +#: cove_ocds/templates/cove_ocds/explore_base.html:370 #, python-format msgid "" "These results will be available for %(delete_files_after_days)s days from " @@ -501,7 +463,7 @@ msgid "" "then." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:454 +#: cove_ocds/templates/cove_ocds/explore_base.html:371 #, python-format msgid "" "After %(delete_files_after_days)s days all uploaded data is deleted from our " @@ -510,33 +472,33 @@ msgid "" "been removed." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:469 -#: cove_ocds/templates/cove_ocds/explore_base.html:472 +#: cove_ocds/templates/cove_ocds/explore_base.html:386 +#: cove_ocds/templates/cove_ocds/explore_base.html:389 msgid "Structural Errors" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:481 +#: cove_ocds/templates/cove_ocds/explore_base.html:398 msgid "view all errors ▼" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:484 -#: cove_ocds/templates/cove_ocds/explore_base.html:496 -#: cove_ocds/templates/cove_ocds/explore_base.html:502 +#: cove_ocds/templates/cove_ocds/explore_base.html:401 +#: cove_ocds/templates/cove_ocds/explore_base.html:413 +#: cove_ocds/templates/cove_ocds/explore_base.html:419 msgid "View all errors ▲" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:493 +#: cove_ocds/templates/cove_ocds/explore_base.html:410 #: cove_ocds/templates/cove_ocds/ocds_missing_ids_table.html:6 #: cove_ocds/templates/cove_ocds/ocid_prefixes_table.html:5 msgid "View all errors ▼" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:499 +#: cove_ocds/templates/cove_ocds/explore_base.html:416 msgid "Quality Warnings" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:505 -#: cove_ocds/templates/cove_ocds/explore_base.html:508 +#: cove_ocds/templates/cove_ocds/explore_base.html:422 +#: cove_ocds/templates/cove_ocds/explore_base.html:425 msgid "Additional Fields (fields in data not in schema)" msgstr "" @@ -853,13 +815,13 @@ msgid "" msgstr "" #: cove_ocds/util.py:19 cove_ocds/util.py:38 cove_ocds/util.py:56 -#: cove_ocds/views.py:111 +#: cove_ocds/views.py:98 msgid "Sorry, we can't process that data" msgstr "" #: cove_ocds/util.py:22 cove_ocds/util.py:41 cove_ocds/util.py:58 #: cove_ocds/util.py:84 cove_ocds/util.py:107 cove_ocds/util.py:126 -#: cove_ocds/views.py:113 cove_ocds/views.py:148 +#: cove_ocds/views.py:100 cove_ocds/views.py:135 msgid "Try Again" msgstr "" @@ -949,7 +911,7 @@ msgstr "" msgid "%(version)s (not a string)" msgstr "" -#: cove_ocds/views.py:117 +#: cove_ocds/views.py:104 msgid "" "The table isn't structured correctly. For example, a JSON Pointer " "(tender) can't be both a value (tender), a path to " @@ -960,11 +922,11 @@ msgid "" "span> Error message: {}" msgstr "" -#: cove_ocds/views.py:146 +#: cove_ocds/views.py:133 msgid "JSON reference error" msgstr "" -#: cove_ocds/views.py:158 +#: cove_ocds/views.py:145 #, python-format msgid "%(error)s" msgstr "" diff --git a/cove_ocds/locale/es/LC_MESSAGES/django.po b/cove_ocds/locale/es/LC_MESSAGES/django.po index 155ff867..38beb141 100644 --- a/cove_ocds/locale/es/LC_MESSAGES/django.po +++ b/cove_ocds/locale/es/LC_MESSAGES/django.po @@ -15,7 +15,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-19 18:32+0000\n" +"POT-Creation-Date: 2024-10-19 18:45+0000\n" "PO-Revision-Date: 2020-09-08 08:53+0000\n" "Last-Translator: James McKinney, 2024\n" "Language-Team: Spanish (https://app.transifex.com/open-contracting-" @@ -52,7 +52,6 @@ msgstr "ver todos" #. Translators: Label of a button that triggers search #: cove_ocds/templates/cove_ocds/base.html:54 -#: cove_ocds/templates/cove_ocds/explore_base.html:46 msgid "Go" msgstr "Ir" @@ -301,35 +300,11 @@ msgstr "" "Este dato ha sido verificado con la versión " "%(version_used_display)sdel paquete del esquema %(release_or_record)s" -#: cove_ocds/templates/cove_ocds/explore_base.html:26 -msgid "" -"You can choose a different version of the schema to check and explore your " -"data." -msgstr "" -"Puede elegir una versión diferente del esquema para verificar y explorar sus " -"datos." - -#: cove_ocds/templates/cove_ocds/explore_base.html:28 -msgid "Check and explore same data against a different version of the schema" -msgstr "" -"Verifique y explore los mismos datos en relación a una versión diferente del " -"esquema" - -#: cove_ocds/templates/cove_ocds/explore_base.html:31 -msgid "" -"Switching the schema version will result in changes to CoVE output and " -"conversions. If you revisit or share this URL, the latest version selected " -"will be used to check your data" -msgstr "" -"Cambiar la versión del esquema dará como resultado cambios en las salidas y " -"conversiones del CoVE. Si vuelve a visitar o compartir esta URL, la última " -"versión seleccionada se utilizará para verificar sus datos." - -#: cove_ocds/templates/cove_ocds/explore_base.html:58 +#: cove_ocds/templates/cove_ocds/explore_base.html:37 msgid "Convert" msgstr "Convertir" -#: cove_ocds/templates/cove_ocds/explore_base.html:65 +#: cove_ocds/templates/cove_ocds/explore_base.html:44 msgid "" "There were conversion warnings when " "processing your file. The converted data may not represent your data as you " @@ -339,38 +314,23 @@ msgstr "" "procesar su archivo. Los datos convertidos puede que no representen sus " "datos como lo desea. " -#: cove_ocds/templates/cove_ocds/explore_base.html:68 -msgid "We have tried to convert your JSON into a spreadsheet format." -msgstr "Hemos intentado convertir su JSON a un formato de hoja de cálculo." +#: cove_ocds/templates/cove_ocds/explore_base.html:46 +msgid "We have tried to convert your data into JSON format." +msgstr "Hemos intentado convertir sus datos a formato JSON." -#: cove_ocds/templates/cove_ocds/explore_base.html:68 -#: cove_ocds/templates/cove_ocds/explore_base.html:92 +#: cove_ocds/templates/cove_ocds/explore_base.html:46 msgid "The results can be seen below." msgstr "Los resultados se pueden ver a continuación." -#: cove_ocds/templates/cove_ocds/explore_base.html:75 -#: cove_ocds/templates/cove_ocds/explore_base.html:80 -#: cove_ocds/templates/cove_ocds/explore_base.html:106 +#: cove_ocds/templates/cove_ocds/explore_base.html:60 msgid "using schema version" msgstr "usando versión del esquema" -#: cove_ocds/templates/cove_ocds/explore_base.html:86 -msgid "The JSON could not be converted to Spreadsheet due to the error:" -msgstr "El JSON no se pudo convertir a hoja de cálculo debido al error:" - -#: cove_ocds/templates/cove_ocds/explore_base.html:92 -msgid "We have tried to convert your data into JSON format." -msgstr "Hemos intentado convertir sus datos a formato JSON." - -#: cove_ocds/templates/cove_ocds/explore_base.html:118 -msgid "Convert to Spreadsheet" -msgstr "Convertir a hoja de cálculo" - -#: cove_ocds/templates/cove_ocds/explore_base.html:139 +#: cove_ocds/templates/cove_ocds/explore_base.html:77 msgid "Schema Extensions" msgstr "Extensiones del Esquema" -#: cove_ocds/templates/cove_ocds/explore_base.html:145 +#: cove_ocds/templates/cove_ocds/explore_base.html:83 msgid "" "Your data has been checked against schema version 1.0 and " "includes extensions but extensions were not introduced in the schema until " @@ -380,38 +340,38 @@ msgstr "" "incluyen extensiones, pero no se introdujeron extensiones en el esquema " "hasta la versión 1.1 ." -#: cove_ocds/templates/cove_ocds/explore_base.html:148 +#: cove_ocds/templates/cove_ocds/explore_base.html:86 msgid "Your data contains the following schema extensions" msgstr "Los datos contienen las siguientes extensiones de esquema" -#: cove_ocds/templates/cove_ocds/explore_base.html:148 +#: cove_ocds/templates/cove_ocds/explore_base.html:86 msgid ", but it wasn't possible to fetch them" msgstr ", pero no fue posible recuperarlos " -#: cove_ocds/templates/cove_ocds/explore_base.html:154 +#: cove_ocds/templates/cove_ocds/explore_base.html:92 msgid "release schema" msgstr "esquema de entrega" -#: cove_ocds/templates/cove_ocds/explore_base.html:171 +#: cove_ocds/templates/cove_ocds/explore_base.html:109 msgid "The following extensions failed:" msgstr "Las siguientes extensiones fallaron:" -#: cove_ocds/templates/cove_ocds/explore_base.html:181 +#: cove_ocds/templates/cove_ocds/explore_base.html:119 msgid "" "Only those extensions successfully fetched were applied to extend the schema." msgstr "" "Solo las extensiones obtenidas con éxito se aplicaron para ampliar el " "esquema." -#: cove_ocds/templates/cove_ocds/explore_base.html:183 +#: cove_ocds/templates/cove_ocds/explore_base.html:121 msgid "All the extensions above were applied to extend the schema." msgstr "Todas las extensiones anteriores se aplicaron para ampliar el esquema." -#: cove_ocds/templates/cove_ocds/explore_base.html:185 +#: cove_ocds/templates/cove_ocds/explore_base.html:123 msgid "Get a copy of the schema with extension patches applied" msgstr "Obtenga una copia del esquema con los parches de extensión aplicados" -#: cove_ocds/templates/cove_ocds/explore_base.html:187 +#: cove_ocds/templates/cove_ocds/explore_base.html:125 msgid "" "None of the extensions above could be applied. Your data has been checked " "against a schema with no extensions." @@ -419,12 +379,11 @@ msgstr "" "No se pudo aplicar ninguna de las extensiones anteriores. Sus datos han sido " "comparados con un esquema sin extensiones." -#: cove_ocds/templates/cove_ocds/explore_base.html:200 +#: cove_ocds/templates/cove_ocds/explore_base.html:138 msgid "Conversion Errors" msgstr "Errores de Conversión" -#: cove_ocds/templates/cove_ocds/explore_base.html:205 -#: cove_ocds/templates/cove_ocds/explore_base.html:227 +#: cove_ocds/templates/cove_ocds/explore_base.html:143 msgid "" "In order to check your data we need to convert it. During that conversion we " "found the following issues:" @@ -432,65 +391,61 @@ msgstr "" "Para verificar sus datos, necesitamos convertirlos. Durante esta conversión, " "encontramos los siguientes problemas:" -#: cove_ocds/templates/cove_ocds/explore_base.html:222 -msgid "Conversion Errors (titles)" -msgstr "Errores de Conversión (títulos)" - -#: cove_ocds/templates/cove_ocds/explore_base.html:250 +#: cove_ocds/templates/cove_ocds/explore_base.html:167 msgid "Structural Errors - Required Fields" msgstr "Errores Estructurales - Campos Requeridos" -#: cove_ocds/templates/cove_ocds/explore_base.html:254 +#: cove_ocds/templates/cove_ocds/explore_base.html:171 msgid "" "Some or all of your data is missing fields which are required by the OCDS " "schema." msgstr "" "En alguno o todos tus datos faltan campos requeridos por el esquema OCDS." -#: cove_ocds/templates/cove_ocds/explore_base.html:274 +#: cove_ocds/templates/cove_ocds/explore_base.html:191 msgid "Structural Errors - Format" msgstr "Errores Estructurales - Formato" -#: cove_ocds/templates/cove_ocds/explore_base.html:278 +#: cove_ocds/templates/cove_ocds/explore_base.html:195 msgid "" "Some or all of your data includes fields which are incorrectly formatted." msgstr "" "Alguno o todos tus datos incluyen campos que están formateados " "incorrectamente." -#: cove_ocds/templates/cove_ocds/explore_base.html:298 +#: cove_ocds/templates/cove_ocds/explore_base.html:215 msgid "Structural Errors - Other" msgstr "Errores Estructurales - Otro" -#: cove_ocds/templates/cove_ocds/explore_base.html:302 +#: cove_ocds/templates/cove_ocds/explore_base.html:219 msgid "Some or all of your data has validation errors." msgstr "Alguno o todos tus datos tienen errores de validación." -#: cove_ocds/templates/cove_ocds/explore_base.html:315 -#: cove_ocds/templates/cove_ocds/explore_base.html:487 -#: cove_ocds/templates/cove_ocds/explore_base.html:490 +#: cove_ocds/templates/cove_ocds/explore_base.html:232 +#: cove_ocds/templates/cove_ocds/explore_base.html:404 +#: cove_ocds/templates/cove_ocds/explore_base.html:407 msgid "Structure Warnings" msgstr "Advertencias de Estructura" -#: cove_ocds/templates/cove_ocds/explore_base.html:320 -#: cove_ocds/templates/cove_ocds/explore_base.html:342 +#: cove_ocds/templates/cove_ocds/explore_base.html:237 +#: cove_ocds/templates/cove_ocds/explore_base.html:259 msgid "" "Fixing the following issues will improve the interoperability of your data." msgstr "" "La resolución de los siguientes problemas mejorará la interoperabilidad de " "sus datos." -#: cove_ocds/templates/cove_ocds/explore_base.html:337 -#: cove_ocds/templates/cove_ocds/explore_base.html:475 -#: cove_ocds/templates/cove_ocds/explore_base.html:478 +#: cove_ocds/templates/cove_ocds/explore_base.html:254 +#: cove_ocds/templates/cove_ocds/explore_base.html:392 +#: cove_ocds/templates/cove_ocds/explore_base.html:395 msgid "Conformance (Rules)" msgstr "Conformidad (Reglas)" -#: cove_ocds/templates/cove_ocds/explore_base.html:359 +#: cove_ocds/templates/cove_ocds/explore_base.html:276 msgid "Codelist Errors" msgstr "Errores de la Lista de Códigos" -#: cove_ocds/templates/cove_ocds/explore_base.html:364 +#: cove_ocds/templates/cove_ocds/explore_base.html:281 msgid "" "The fields below use closed codelists. When using these fields, you " "must use one of the pre-defined codelist values. If you use a " @@ -506,7 +461,7 @@ msgstr "" "+ o - esto indica que la lista de códigos ha sido modificada con estas " "adiciones (+) o sustracciones (-) por una o más extensiones." -#: cove_ocds/templates/cove_ocds/explore_base.html:368 +#: cove_ocds/templates/cove_ocds/explore_base.html:285 msgid "" "You may need to create a mapping between your local codes and the OCDS " "closed codelists to address these errors. In most cases, there will be a " @@ -520,11 +475,11 @@ msgstr "" "códigos locales. Si ya ha completado un mapeo, favor revise la ortografía y " "las mayúsculas utilizadas en estos campos cerrados de la lista de códigos." -#: cove_ocds/templates/cove_ocds/explore_base.html:379 +#: cove_ocds/templates/cove_ocds/explore_base.html:296 msgid "Additional Fields" msgstr "Campos adicionales" -#: cove_ocds/templates/cove_ocds/explore_base.html:383 +#: cove_ocds/templates/cove_ocds/explore_base.html:300 msgid "" "This data includes the following fields which are not part of the OCDS " "schema. You should check whether the data in these fields could be provided " @@ -538,11 +493,11 @@ msgstr "" "standard.open-contracting.org/latest/en/extensions/\">extensión " "existente del esquema." -#: cove_ocds/templates/cove_ocds/explore_base.html:397 +#: cove_ocds/templates/cove_ocds/explore_base.html:314 msgid "Additional Codelist Values" msgstr "Valores Adicionales de Listas de Códigos" -#: cove_ocds/templates/cove_ocds/explore_base.html:401 +#: cove_ocds/templates/cove_ocds/explore_base.html:318 msgid "" "Your data contains a number of fields that use an open codelist. You should " "use values from the codelist whenever possible, but if the codelist does not " @@ -561,7 +516,7 @@ msgstr "" "de códigos ha sido modificada con estas adiciones (+) o sustracciones (-) " "por una o más extensiones." -#: cove_ocds/templates/cove_ocds/explore_base.html:407 +#: cove_ocds/templates/cove_ocds/explore_base.html:324 msgid "" "Make sure you list the definition of any additional codelist values you " "include within your gestor de " "incidencias de OCDS ." -#: cove_ocds/templates/cove_ocds/explore_base.html:417 +#: cove_ocds/templates/cove_ocds/explore_base.html:334 msgid "Additional Checks" msgstr "Comprobaciones adicionales" +#: cove_ocds/templates/cove_ocds/explore_base.html:348 +#: cove_ocds/templates/cove_ocds/explore_base.html:428 #: cove_ocds/templates/cove_ocds/explore_base.html:431 -#: cove_ocds/templates/cove_ocds/explore_base.html:511 -#: cove_ocds/templates/cove_ocds/explore_base.html:514 msgid "Deprecated Fields" msgstr "Campos Obsoletos" -#: cove_ocds/templates/cove_ocds/explore_base.html:431 +#: cove_ocds/templates/cove_ocds/explore_base.html:348 msgid "" "Fields flagged as 'deprecated' will be either replaced or removed in future " "versions of the schema." @@ -596,16 +551,16 @@ msgstr "" "Campos marcados como 'obsoletos' serán reemplazados o eliminados en futuras " "versiones del esquema." -#: cove_ocds/templates/cove_ocds/explore_base.html:447 +#: cove_ocds/templates/cove_ocds/explore_base.html:364 msgid "Save or Share these results" msgstr "Guardar o Compartir estos resultados" -#: cove_ocds/templates/cove_ocds/explore_base.html:448 +#: cove_ocds/templates/cove_ocds/explore_base.html:365 msgid "Use the following url to share these results:" msgstr "Use la siguiente url para compartir estos resultados: " #. Translators: Paragraph that describes the application -#: cove_ocds/templates/cove_ocds/explore_base.html:453 +#: cove_ocds/templates/cove_ocds/explore_base.html:370 #, python-format msgid "" "These results will be available for %(delete_files_after_days)s days from " @@ -616,7 +571,7 @@ msgstr "" "días desde el día en que los datos fueron subidos. Puede revisar estos " "resultados hasta entonces." -#: cove_ocds/templates/cove_ocds/explore_base.html:454 +#: cove_ocds/templates/cove_ocds/explore_base.html:371 #, python-format msgid "" "After %(delete_files_after_days)s days all uploaded data is deleted from our " @@ -629,33 +584,33 @@ msgstr "" "Cualquiera que use el enlace a esta página después de ese periodo verá un " "mensaje informando de que el archivo ha sido borrado." -#: cove_ocds/templates/cove_ocds/explore_base.html:469 -#: cove_ocds/templates/cove_ocds/explore_base.html:472 +#: cove_ocds/templates/cove_ocds/explore_base.html:386 +#: cove_ocds/templates/cove_ocds/explore_base.html:389 msgid "Structural Errors" msgstr "Errores Estructurales" -#: cove_ocds/templates/cove_ocds/explore_base.html:481 +#: cove_ocds/templates/cove_ocds/explore_base.html:398 msgid "view all errors ▼" msgstr "ver todos los errores ▼" -#: cove_ocds/templates/cove_ocds/explore_base.html:484 -#: cove_ocds/templates/cove_ocds/explore_base.html:496 -#: cove_ocds/templates/cove_ocds/explore_base.html:502 +#: cove_ocds/templates/cove_ocds/explore_base.html:401 +#: cove_ocds/templates/cove_ocds/explore_base.html:413 +#: cove_ocds/templates/cove_ocds/explore_base.html:419 msgid "View all errors ▲" msgstr "Vea todos los errores ▲" -#: cove_ocds/templates/cove_ocds/explore_base.html:493 +#: cove_ocds/templates/cove_ocds/explore_base.html:410 #: cove_ocds/templates/cove_ocds/ocds_missing_ids_table.html:6 #: cove_ocds/templates/cove_ocds/ocid_prefixes_table.html:5 msgid "View all errors ▼" msgstr "Vea todos los errores ▼" -#: cove_ocds/templates/cove_ocds/explore_base.html:499 +#: cove_ocds/templates/cove_ocds/explore_base.html:416 msgid "Quality Warnings" msgstr "Advertencias de Calidad" -#: cove_ocds/templates/cove_ocds/explore_base.html:505 -#: cove_ocds/templates/cove_ocds/explore_base.html:508 +#: cove_ocds/templates/cove_ocds/explore_base.html:422 +#: cove_ocds/templates/cove_ocds/explore_base.html:425 msgid "Additional Fields (fields in data not in schema)" msgstr "Campos adicionales (campos en los datos que no están en el esquema)" @@ -1032,13 +987,13 @@ msgstr "" "latest/es/schema/reference/#date\"> fechas en OCDS" #: cove_ocds/util.py:19 cove_ocds/util.py:38 cove_ocds/util.py:56 -#: cove_ocds/views.py:111 +#: cove_ocds/views.py:98 msgid "Sorry, we can't process that data" msgstr "Lo sentimos, no podemos procesar esos datos" #: cove_ocds/util.py:22 cove_ocds/util.py:41 cove_ocds/util.py:58 #: cove_ocds/util.py:84 cove_ocds/util.py:107 cove_ocds/util.py:126 -#: cove_ocds/views.py:113 cove_ocds/views.py:148 +#: cove_ocds/views.py:100 cove_ocds/views.py:135 msgid "Try Again" msgstr "Inténtelo de nuevo" @@ -1154,7 +1109,7 @@ msgstr "" msgid "%(version)s (not a string)" msgstr "" -#: cove_ocds/views.py:117 +#: cove_ocds/views.py:104 msgid "" "The table isn't structured correctly. For example, a JSON Pointer " "(tender) can't be both a value (tender), a path to " @@ -1172,11 +1127,11 @@ msgstr "" " Error message: {}" -#: cove_ocds/views.py:146 +#: cove_ocds/views.py:133 msgid "JSON reference error" msgstr "Error de referencia en JSON" -#: cove_ocds/views.py:158 +#: cove_ocds/views.py:145 #, python-format msgid "%(error)s" msgstr "%(error)s" diff --git a/cove_ocds/templates/cove_ocds/explore_base.html b/cove_ocds/templates/cove_ocds/explore_base.html index aedce18c..ff10055c 100644 --- a/cove_ocds/templates/cove_ocds/explore_base.html +++ b/cove_ocds/templates/cove_ocds/explore_base.html @@ -52,43 +52,19 @@

    {% trans "Schema" %}

  • -
    +

    - {% trans 'Convert' %} + {% trans 'Submitted Files' %}

    - {% if conversion_warning_messages or conversion_warning_messages_titles %} + {% if conversion_warning_messages %}

    {% blocktrans %}There were conversion warnings when processing your file. The converted data may not represent your data as you want it to be.{% endblocktrans %}

    {% endif %} - {% if conversion == 'flatten' %} -

    {% trans "We have tried to convert your JSON into a spreadsheet format." %}

    {% trans "The results can be seen below." %}

    - - {% if conversion_error %} -

    {% blocktrans %}The JSON could not be converted to Spreadsheet due to the error:{% endblocktrans %} {{ conversion_error }}

    - - {% include 'error_extra.html' %} - {% endif %} - - {% elif conversion == 'unflatten' %} + {% if conversion == 'unflatten' %}

    {% blocktrans %}We have tried to convert your data into JSON format.{% endblocktrans %}

    {% blocktrans %}The results can be seen below.{% endblocktrans %}

    - {% else %}
    • {{JSON}} ({{original}}) {{original_file.size|filesizeformat }} - {% if conversion == 'flattenable' %} -
      -
      -
      - - {% csrf_token %} -
      - {% endif %}
    {% endif %} @@ -132,7 +99,6 @@

    {% if extensions %} {% with ext=extensions.extensions ext_errors=extensions.invalid_extension %} -

    @@ -214,27 +180,6 @@

    {% endif %} -{% if conversion_warning_messages_titles %} - -
    -
    -

    - {% trans 'Conversion Errors (titles)' %} -

    -
    -
    - {% if file_type == 'xlsx' or file_type == 'csv' %} -

    {% blocktrans %}In order to check your data we need to convert it. During that conversion we found the following issues:{% endblocktrans %}

    - {% endif %} -
      - {% for warning_message in conversion_warning_messages_titles %} -
    • {{warning_message}}
    • - {% endfor %} -
    -
    -
    -{% endif %} - {% with validation_errors=validation_errors_grouped.required error_prefix='required-' %} {% if validation_errors %} {% for error_json, values in validation_errors %} diff --git a/cove_ocds/templates/cove_ocds/explore_record.html b/cove_ocds/templates/cove_ocds/explore_record.html index 03b68918..2af7dd5e 100644 --- a/cove_ocds/templates/cove_ocds/explore_record.html +++ b/cove_ocds/templates/cove_ocds/explore_record.html @@ -9,7 +9,7 @@

    {% trans 'Headlines' %}

    - {% if conversion_warning_messages or conversion_warning_messages_titles %} + {% if conversion_warning_messages %}
    {% blocktrans %}Please read the conversion warnings below.{% endblocktrans %}
    {% endif %} diff --git a/cove_ocds/templates/cove_ocds/explore_release.html b/cove_ocds/templates/cove_ocds/explore_release.html index a9422b3d..7066b0d2 100644 --- a/cove_ocds/templates/cove_ocds/explore_release.html +++ b/cove_ocds/templates/cove_ocds/explore_release.html @@ -9,7 +9,7 @@

    {% trans 'Headlines' %}

    - {% if conversion_warning_messages or conversion_warning_messages_titles %} + {% if conversion_warning_messages %}
    {% blocktrans %}Please read the conversion warnings below.{% endblocktrans %}
    {% endif %} diff --git a/cove_ocds/views.py b/cove_ocds/views.py index 5f9c020a..43118102 100644 --- a/cove_ocds/views.py +++ b/cove_ocds/views.py @@ -13,7 +13,7 @@ from django.utils.translation import gettext as _ from flattentool.exceptions import FlattenToolValueError, FlattenToolWarning from libcove.lib.common import get_spreadsheet_meta_data -from libcove.lib.converters import convert_json, convert_spreadsheet +from libcove.lib.converters import convert_spreadsheet from libcove.lib.exceptions import CoveInputDataError from libcoveocds.common_checks import common_checks_ocds from libcoveocds.config import LibCoveOCDSConfig @@ -41,7 +41,7 @@ def explore_ocds(request, pk): for version, (display, url, tag) in lib_cove_ocds_config.config["schema_version_choices"].items() } - # Read the supplied data, and convert to alternative formats (if not done on a previous request). + # Read the supplied data. if context["file_type"] == "json": package_data = util.read_json(supplied_data.original_file.path) @@ -49,26 +49,6 @@ def explore_ocds(request, pk): schema_ocds, schema_url, replace = util.get_schema( request, context, supplied_data, lib_cove_ocds_config, package_data ) - - if "records" in package_data: - context["conversion"] = None - else: - with warnings.catch_warnings(): - warnings.filterwarnings("ignore", category=FlattenToolWarning) - - context.update( - convert_json( - upload_dir=supplied_data.upload_dir(), - upload_url=supplied_data.upload_url(), - file_name=supplied_data.original_file.path, - lib_cove_config=lib_cove_ocds_config, - schema_url=schema_url, - # Unsure why exists() was added in https://github.com/open-contracting/cove-ocds/commit/d793c49 - replace=replace and os.path.exists(os.path.join(supplied_data.upload_dir(), "flattened.xlsx")), - request=request, - flatten=request.POST.get("flatten"), - ) - ) else: with warnings.catch_warnings(): warnings.filterwarnings("ignore", category=FlattenToolWarning) @@ -92,6 +72,13 @@ def explore_ocds(request, pk): warnings.filterwarnings("ignore", category=FlattenToolWarning) try: + # Sets: + # - conversion_warning_messages: str (JSON) + # - converted_file_size: int (bytes) + # - conversion = "unflatten" + # - converted_path: str + # - converted_url: str + # - csv_encoding = "utf-8-sig" | "cp1252" | "latin_1" context.update( # __wrapped__ is missing when the function is patched by tests. getattr(convert_spreadsheet, "__wrapped__", convert_spreadsheet)( diff --git a/docs/architecture.rst b/docs/architecture.rst index d9ec7319..bf279378 100644 --- a/docs/architecture.rst +++ b/docs/architecture.rst @@ -11,7 +11,7 @@ cove-ocds ``tests/`` also contains fixtures for testing, and the tests themselves; templates and related static files; code for the CLI version of the DRT; and locale files for translations. -``cove_ocds/views.py`` does most of the heavy lifting of taking an input file from the web interface and carrying out the various validation checks and conversions, then piping the output back to the right templates. +``cove_ocds/views.py`` does most of the heavy lifting of taking an input file from the web interface and carrying out the various validation checks, then piping the output back to the right templates. ``core/`` contains the Django components (settings, URL paths, server). @@ -29,7 +29,6 @@ The OCDS Data Review Tool is just one manifestation of software historically kno * lib-cove (`opendataservices/lib-cove `_): contains functions and helpers that may be useful for data validation and review, regardless of the particular data standard. * lib-cove-web (`opendataservices/lib-cove-web `_): provides a barebones Django configuration, and baseline CSS, JS and templates that are common for all CoVE instances. It is also a place for common functions relating to presentation or display of data or output. Any templates edited here typically affect all CoVE instances. Sometimes this is useful, but for OCDS-only changes, templates can be overridden in cove-ocds. This and cove-ocds are the only places where frontend output and translatable strings should be. -* flatten-tool (`opendataservices/flatten-tool `_): a general purpose library for converting data between JSON and CSV/XLS formats. While not CoVE-specific, it is listed here because it is a specialized tool of which the DRT makes heavy use. Configuration ------------- @@ -38,9 +37,7 @@ Some configuration variables are set in ``COVE_CONFIG``, found in ``core/setting * ``app_name``, ``app_verbose_name``, ``app_strapline``, ``support_email``: set human readable strings for the DRT that can be reused in templates etc. * ``app_base_template``, ``input_template``, ``input_methods``: set the templates for the landing page. -* ``schema_version_choices`` (``version: (display, url, tag)``), ``schema_codelists``: point to JSON schema files that the DRT uses for validating and converting data. Since there is more than one version of the Open Contracting Data Standard, this lets the user choose which version of the scheme they are validating against. -* ``root_list_path``, ``root_id``: set so the DRT knows which key to use as the root of the data, and which key to use as the main identifier when parsing the data. These, along with ``convert_titles`` are passed to the flattentool library. - +* ``schema_version_choices`` (``version: (display, url, tag)``), ``schema_codelists``: point to JSON schema files that the DRT uses for validating data. Since there is more than one version of the Open Contracting Data Standard, this lets the user choose which version of the scheme they are validating against. Path through the code --------------------- @@ -52,7 +49,6 @@ Path through the code * It then performs OCDS specific JSON checks, if the input data is JSON. * And then schema-specific OCDS checks, depending on the version specified, using ``SchemaOCDS`` and ``common_checks`` from lib-cove-ocds. Functions from lib-cove-ocds also takes care of handling any extension data included in the input. lib-cove-ocds calls on lib-cove to perform schema validation that is not specific to OCDS, using JSON Schema and JSONRef, as well as common things like checking for duplicate identifiers. * lib-cove-ocds runs additional checks, which are basic data quality checks outside of the OCDS schema. - * The results of the various stages of validation are added to the context so they can be displayed on the frontend. The JSON schema error messages are currently set in lib-cove and OCDS schema specific messages are set in lib-cove-ocds or in this repo (``cove_ocds/lib/exceptions.py``). - * It uses flattentool to convert the input JSON data into XLSX, or vice versa. + * The results of the various stages of validation are added to the context so they can be displayed on the frontend. The JSON schema error messages are currently set in lib-cove and OCDS schema specific messages are set in lib-cove-ocds or in this repo. 3. The results of the validation, as well as some basic statistics on the data, are output to the ``explore_record`` and ``explore_release`` html templates in ``cove_ocds/templates``. diff --git a/docs/template-structure.rst b/docs/template-structure.rst index 4ee73091..e162fadc 100644 --- a/docs/template-structure.rst +++ b/docs/template-structure.rst @@ -29,8 +29,6 @@ Some of the templates include variables for the translation of generic terms so {% 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 %} diff --git a/docs/tests.rst b/docs/tests.rst index f71dd8ac..f3d69958 100644 --- a/docs/tests.rst +++ b/docs/tests.rst @@ -14,4 +14,4 @@ Tests are found in the following files: * Input tests (``test_input.py``): Test the input form and responses. * Functional tests (``tests_functional.py``): Do roundtrip testing of the whole DRT using `Selenium `_. Some of these tests involve hardcoded frontend text, so if you change any of the templates you might need to update a test here. * `Hypothesis `_ tests (``test_hypothesis.py``): Generate JSON for some unit and some functional tests. -* The rest of the tests (``test.py``): Are unit tests for the various validation and conversion functions. Some of these test code in lib-cove-ocds. \ No newline at end of file +* The rest of the tests (``test.py``): Are unit tests for the various validation functions. Some of these test code in lib-cove-ocds. diff --git a/tests/test_functional.py b/tests/test_functional.py index 6b4a98b9..1014639d 100644 --- a/tests/test_functional.py +++ b/tests/test_functional.py @@ -1,4 +1,3 @@ -import contextlib import os import time @@ -6,7 +5,6 @@ import requests from django.conf import settings from django.test import override_settings -from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import Select @@ -149,7 +147,12 @@ def test_500_error(server_url, browser): [ ( "tenders_releases_2_releases.json", - ["Convert", "Schema", "OCDS release package schema version 1.0. You can", *OCDS_SCHEMA_VERSIONS_DISPLAY], + [ + "Submitted Files", + "Schema", + "OCDS release package schema version 1.0. You can", + *OCDS_SCHEMA_VERSIONS_DISPLAY, + ], ["Schema Extensions"], True, ), @@ -263,7 +266,7 @@ def test_500_error(server_url, browser): ), ( "ocds_release_nulls.json", - ["Convert", "Save or Share these results"], + ["Submitted Files", "Save or Share these results"], [], True, ), @@ -317,7 +320,7 @@ def test_500_error(server_url, browser): ( "tenders_releases_2_releases_invalid.json", [ - "Convert", + "Submitted Files", "Structural Errors", "id is missing but required", "Invalid 'uri' found", @@ -327,7 +330,7 @@ def test_500_error(server_url, browser): ), ("tenders_releases_2_releases_codelists.json", ["oh no", "GSINS"], [], True), # Test UTF-8 support - ("utf8.json", ["Convert"], ["Ensure that your file uses UTF-8 encoding"], True), + ("utf8.json", ["Submitted Files"], ["Ensure that your file uses UTF-8 encoding"], True), # Test that non UTF-8 files get an error, with a helpful message ("latin1.json", ["Ensure that your file uses UTF-8 encoding"], [], False), ("utf-16.json", ["Ensure that your file uses UTF-8 encoding"], [], False), @@ -340,7 +343,7 @@ def test_500_error(server_url, browser): ), ( "tenders_releases_2_releases.xlsx", - ["Convert", "Schema", *OCDS_SCHEMA_VERSIONS_DISPLAY], + ["Submitted Files", "Schema", *OCDS_SCHEMA_VERSIONS_DISPLAY], ["Missing OCDS package"], True, ), @@ -363,7 +366,6 @@ def test_500_error(server_url, browser): "Your data specifies a version 123.123 which is not recognised", f"checked against OCDS release package schema version {OCDS_DEFAULT_SCHEMA_VERSION}. You can", "checked against the current default version.", - "Convert to Spreadsheet", ], ["Additional Fields (fields in data not in schema)", "Error message"], False, @@ -373,7 +375,6 @@ def test_500_error(server_url, browser): [ "Your data specifies a version 1000 (not a string) which is not recognised", f"checked against OCDS release package schema version {OCDS_DEFAULT_SCHEMA_VERSION}. You can", - "Convert to Spreadsheet", ], ["Additional Fields (fields in data not in schema)", "Error message"], False, @@ -385,7 +386,7 @@ def test_500_error(server_url, browser): '"100.100.0" format does not comply with the schema', "Error message", ], - ["Convert to Spreadsheet"], + [], False, ), ( @@ -401,13 +402,13 @@ def test_500_error(server_url, browser): "Unresolvable JSON pointer:", "/definitions/OrganizationReference", ], - ["Convert to Spreadsheet"], + [], False, ), ( "tenders_releases_1_release_unpackaged.json", ["Missing OCDS package", "Error message: Missing OCDS package"], - ["Convert to Spreadsheet"], + [], False, ), ( @@ -484,16 +485,6 @@ def check_url_input_result_page( not_expected_text, conversion_successful, ): - # Avoid page refresh - dont_convert = [ - "tenders_releases_1_release_with_unrecognized_version.json", - "tenders_releases_1_release_with_wrong_version_type.json", - ] - - if source_filename.endswith(".json") and source_filename not in dont_convert: - with contextlib.suppress(NoSuchElementException): - browser.find_element(By.NAME, "flatten").click() - body_text = browser.find_element(By.TAG_NAME, "body").text if isinstance(expected_text, str): expected_text = [expected_text] @@ -505,16 +496,8 @@ def check_url_input_result_page( assert "Data Review Tool" in browser.find_element(By.TAG_NAME, "body").text - if conversion_successful: - if source_filename.endswith(".json"): - assert "JSON (Original)" in body_text - original_file = browser.find_element(By.LINK_TEXT, "JSON (Original)").get_attribute("href") - if "record" not in source_filename: - converted_file = browser.find_element( - By.PARTIAL_LINK_TEXT, "Excel Spreadsheet (.xlsx) (Converted from Original using schema version" - ).get_attribute("href") - assert "flattened.xlsx" in converted_file - elif source_filename.endswith(".xlsx"): + if conversion_successful and source_filename.endswith((".xlsx", ".csv")): + if source_filename.endswith(".xlsx"): assert "(.xlsx) (Original)" in body_text original_file = browser.find_element(By.LINK_TEXT, "Excel Spreadsheet (.xlsx) (Original)").get_attribute( "href" @@ -639,18 +622,14 @@ def test_extension_validation_error_messages(url_input_browser): assert html not in browser.page_source -@pytest.mark.parametrize("flatten_or_unflatten", ["flatten", "unflatten"]) -def test_flattentool_warnings(server_url, url_input_browser, httpserver, monkeypatch, flatten_or_unflatten): +def test_flattentool_warnings(server_url, url_input_browser, httpserver, monkeypatch): # If we're testing a remove server then we can't run this test as we can't # set up the mocks if "CUSTOM_SERVER_URL" in os.environ: pytest.skip() # Actual input file doesn't matter, as we override # flattentool behaviour with a mock below - if flatten_or_unflatten == "flatten": - source_filename = "tenders_releases_2_releases.json" - else: - source_filename = "tenders_releases_2_releases.xlsx" + source_filename = "tenders_releases_2_releases.xlsx" import flattentool @@ -666,8 +645,7 @@ def mockflatten(input_name, output_name, *args, **kwargs): with open(f"{output_name}.xlsx", "w") as fp: fp.write("{}") - mocks = {"flatten": mockflatten, "unflatten": mockunflatten} - monkeypatch.setattr(flattentool, flatten_or_unflatten, mocks[flatten_or_unflatten]) + monkeypatch.setattr(flattentool, "unflatten", mockunflatten) if "CUSTOM_SERVER_URL" in os.environ: source_url = ( diff --git a/tests/test_general.py b/tests/test_general.py index 303d1e7e..8a8f6f05 100644 --- a/tests/test_general.py +++ b/tests/test_general.py @@ -10,7 +10,7 @@ from django.conf import settings from django.core.files.base import ContentFile from django.core.files.uploadedfile import UploadedFile -from libcove.lib.converters import convert_json, convert_spreadsheet +from libcove.lib.converters import convert_spreadsheet from libcoveocds.api import ocds_json_output from libcoveocds.exceptions import OCDSVersionError from libcoveocds.schema import SchemaOCDS @@ -188,22 +188,6 @@ def test_explore_page(client, json_data): assert resp.status_code == 200 -@pytest.mark.django_db -def test_explore_page_convert(client): - data = SuppliedData.objects.create() - data.original_file.save("test.json", ContentFile('{"releases":[]}')) - data.current_app = "cove_ocds" - resp = client.get(data.get_absolute_url()) - assert resp.status_code == 200 - assert resp.context["conversion"] == "flattenable" - - resp = client.post(data.get_absolute_url(), {"flatten": "true"}) - assert resp.status_code == 200 - assert resp.context["conversion"] == "flatten" - assert "converted_file_size" in resp.context - assert "converted_file_size_titles" not in resp.context - - @pytest.mark.django_db def test_explore_page_csv(client): data = SuppliedData.objects.create() @@ -234,16 +218,6 @@ def test_explore_unconvertable_spreadsheet(client): assert b"We think you tried to supply a spreadsheet, but we failed to convert it." in resp.content -@pytest.mark.django_db -def test_explore_non_dict_json(client): - data = SuppliedData.objects.create() - with open(os.path.join("tests", "fixtures", "non_dict_json.json")) as fp: - data.original_file.save("non_dict_json.json", UploadedFile(fp)) - resp = client.post(data.get_absolute_url(), {"flatten": "true"}) - assert resp.status_code == 200 - assert b"could not be converted" not in resp.content - - @pytest.mark.django_db def test_explore_page_null_tag(client): data = SuppliedData.objects.create() @@ -322,7 +296,7 @@ def test_wrong_schema_version_in_data(client): @pytest.mark.django_db @pytest.mark.parametrize( ("file_type", "converter", "replace_after_post"), - [("xlsx", convert_spreadsheet, True), ("json", convert_json, False)], + [("xlsx", convert_spreadsheet, True)], ) def test_explore_schema_version_change(client, file_type, converter, replace_after_post): data = SuppliedData.objects.create() @@ -356,53 +330,6 @@ def test_explore_schema_version_change(client, file_type, converter, replace_aft assert kwargs["replace"] is replace_after_post -@pytest.mark.django_db -@patch("cove_ocds.views.convert_json", side_effect=convert_json, autospec=True) -def test_explore_schema_version_change_with_json_to_xlsx(mock_object, client): - data = SuppliedData.objects.create() - with open(os.path.join("tests", "fixtures", "tenders_releases_2_releases.json")) as fp: - data.original_file.save("test.json", UploadedFile(fp)) - data.current_app = "cove_ocds" - - resp = client.get(data.get_absolute_url()) - args, kwargs = mock_object.call_args - assert resp.status_code == 200 - assert "/1.0/" in kwargs["schema_url"] - assert kwargs["replace"] is False - mock_object.reset_mock() - - resp = client.post(data.get_absolute_url(), {"version": "1.1"}) - args, kwargs = mock_object.call_args - assert resp.status_code == 200 - assert kwargs["replace"] is False - mock_object.reset_mock() - - # Convert to spreadsheet - resp = client.post(data.get_absolute_url(), {"flatten": "true"}) - assert kwargs["replace"] is False - mock_object.reset_mock() - - # Do replace with version change now that it's been converted once - resp = client.post(data.get_absolute_url(), {"version": "1.0"}) - args, kwargs = mock_object.call_args - assert resp.status_code == 200 - assert kwargs["replace"] is True - mock_object.reset_mock() - - # Do not replace if the version does not changed - resp = client.post(data.get_absolute_url(), {"version": "1.0"}) - args, kwargs = mock_object.call_args - assert resp.status_code == 200 - assert kwargs["replace"] is False - mock_object.reset_mock() - - resp = client.post(data.get_absolute_url(), {"version": "1.1"}) - args, kwargs = mock_object.call_args - assert resp.status_code == 200 - assert kwargs["replace"] is True - mock_object.reset_mock() - - @pytest.mark.django_db def test_data_supplied_schema_version(client): data = SuppliedData.objects.create() From a3369bf42c9065ef6ace9d0240587594ea80c652 Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Sat, 19 Oct 2024 17:16:32 -0400 Subject: [PATCH 08/37] feat: Remove version switching. Always check against the latest version (within a major version). --- cove_ocds/locale/en/LC_MESSAGES/django.po | 524 +++++++-------- cove_ocds/locale/es/LC_MESSAGES/django.po | 628 ++++++++---------- .../templates/cove_ocds/explore_base.html | 187 +++--- .../templates/cove_ocds/explore_record.html | 105 --- .../templates/cove_ocds/explore_release.html | 105 --- cove_ocds/util.py | 66 +- cove_ocds/views.py | 48 +- docs/template-structure.rst | 22 - tests/fixtures/record_minimal_valid.json | 8 +- ...elease_with_extension_broken_json_ref.json | 2 +- tests/test_functional.py | 132 +--- tests/test_general.py | 137 +--- 12 files changed, 683 insertions(+), 1281 deletions(-) delete mode 100644 cove_ocds/templates/cove_ocds/explore_record.html delete mode 100644 cove_ocds/templates/cove_ocds/explore_release.html diff --git a/cove_ocds/locale/en/LC_MESSAGES/django.po b/cove_ocds/locale/en/LC_MESSAGES/django.po index aa7e5cae..cedaf462 100644 --- a/cove_ocds/locale/en/LC_MESSAGES/django.po +++ b/cove_ocds/locale/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-19 18:45+0000\n" +"POT-Creation-Date: 2024-10-19 21:11+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,6 +17,26 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +#: cove_ocds/templates/500.html:7 +msgid "Internal Server Error" +msgstr "" + +#: cove_ocds/templates/500.html:11 +msgid "" +"Something went wrong with your request. This could be due to a bug in the " +"application and/or the data you supplied." +msgstr "" + +#: cove_ocds/templates/500.html:12 +#, python-format +msgid "" +"This error has been automatically reported to our development team. If you " +"get in " +"touch, please reference this error as %(request.sentry.id)s." +msgstr "" + #: cove_ocds/templates/cove_ocds/additional_checks_table.html:7 msgid "Check Description" msgstr "" @@ -222,15 +242,53 @@ msgid "" " " msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:5 +#: cove_ocds/templates/cove_ocds/explore_base.html:6 msgid "Load New File" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:18 -msgid "Schema" +#: cove_ocds/templates/cove_ocds/explore_base.html:15 +msgid "Headlines" +msgstr "" + +#: cove_ocds/templates/cove_ocds/explore_base.html:19 +msgid "" +"Please read the conversion warnings " +"below." +msgstr "" + +#: cove_ocds/templates/cove_ocds/explore_base.html:26 +#, python-format +msgid "" +"Failed structural checks against OCDS " +"record package schema version %(version_used_display)s." +msgstr "" + +#: cove_ocds/templates/cove_ocds/explore_base.html:28 +#, python-format +msgid "" +"Failed structural checks against OCDS " +"release package schema version %(version_used_display)s." +msgstr "" + +#: cove_ocds/templates/cove_ocds/explore_base.html:32 +#, python-format +msgid "" +"Passed structural checks against OCDS record " +"package schema version %(version_used_display)s." +msgstr "" + +#: cove_ocds/templates/cove_ocds/explore_base.html:34 +#, python-format +msgid "" +"Passed structural checks against OCDS release " +"package schema version %(version_used_display)s." +msgstr "" + +#: cove_ocds/templates/cove_ocds/explore_base.html:39 +msgid "See Structural Errors below." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:23 +#: cove_ocds/templates/cove_ocds/explore_base.html:45 #, python-format msgid "" "Your data specifies a version %(unrecognized_version_data)s " @@ -238,142 +296,229 @@ msgid "" "current default version." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:26 +#: cove_ocds/templates/cove_ocds/explore_base.html:51 +#, python-format +msgid "Failed to apply %(count)s extension to the schema." +msgid_plural "" +"Failed to apply %(count)s extensions to the schema." +msgstr[0] "" +msgstr[1] "" + +#: cove_ocds/templates/cove_ocds/explore_base.html:52 +msgid "See Extensions below." +msgstr "" + +#: cove_ocds/templates/cove_ocds/explore_base.html:58 #, python-format msgid "" -"This data has been checked against OCDS " -"%(release_or_record)s package schema version %(version_used_display)s." +"To validated your file, we converted it to JSON format (%(size)s download)." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:37 -msgid "Convert" +#: cove_ocds/templates/cove_ocds/explore_base.html:63 +msgid "At a glance" +msgstr "" + +#: cove_ocds/templates/cove_ocds/explore_base.html:68 +#, python-format +msgid "This file contains %(count)s record" +msgid_plural "This file contains %(count)s records" +msgstr[0] "" +msgstr[1] "" + +#: cove_ocds/templates/cove_ocds/explore_base.html:70 +#, python-format +msgid "This file contains %(count)s release" +msgid_plural "This file contains %(count)s releases" +msgstr[0] "" +msgstr[1] "" + +#: cove_ocds/templates/cove_ocds/explore_base.html:72 +#, python-format +msgid " describing %(count)s contracting process" +msgid_plural " describing %(count)s contracting processes." +msgstr[0] "" +msgstr[1] "" + +#: cove_ocds/templates/cove_ocds/explore_base.html:78 +#, python-format +msgid "" +"The schema version specified in the file is %(data_schema_version)s." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:44 +#: cove_ocds/templates/cove_ocds/explore_base.html:84 +#, python-format msgid "" -"There were conversion warnings when " -"processing your file. The converted data may not represent your data as you " -"want it to be." +"The publisher named in the file is %(json_data.publisher.name)s." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:46 -msgid "We have tried to convert your data into JSON format." +#: cove_ocds/templates/cove_ocds/explore_base.html:90 +#, python-format +msgid "" +"The license is %(json_data.license)s." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:46 -msgid "The results can be seen below." +#: cove_ocds/templates/cove_ocds/explore_base.html:96 +#, python-format +msgid "" +"Publication policy is %(json_data.publicationPolicy)s." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:60 -msgid "using schema version" +#: cove_ocds/templates/cove_ocds/explore_base.html:103 +#, python-format +msgid "" +"This file applies %(count)s valid extension to the schema." +msgid_plural "" +"This file applies %(count)s valid extensions to the schema." +msgstr[0] "" +msgstr[1] "" + +#: cove_ocds/templates/cove_ocds/explore_base.html:110 +#, python-format +msgid "" +"This file uses %(count)s additional field " +"not used in the standard." +msgid_plural "" +"This file uses %(count)s additional fields not used in the standard." +msgstr[0] "" +msgstr[1] "" + +#: cove_ocds/templates/cove_ocds/explore_base.html:116 +#, python-format +msgid "" +"This file is not 'utf-8' encoded (it is %(csv_encoding)s " +"encoded)." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:77 -msgid "Schema Extensions" +#: cove_ocds/templates/cove_ocds/explore_base.html:122 +#, python-format +msgid "" +"This file uses %(count)s deprecated field." +msgid_plural "" +" This file uses %(count)s deprecated fields." +msgstr[0] "" +msgstr[1] "" + +#: cove_ocds/templates/cove_ocds/explore_base.html:128 +#, python-format +msgid "" +"Data downloaded (%(size)s cached) from " +"%(source_url)s on %(created_datetime)s." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:83 +#: cove_ocds/templates/cove_ocds/explore_base.html:130 +#, python-format msgid "" -"Your data has been checked against schema version 1.0 and " -"includes extensions but extensions were not introduced in the schema until " -"version 1.1." +"Data uploaded (%(size)s cached) on " +"%(created_datetime)s." +msgstr "" + +#: cove_ocds/templates/cove_ocds/explore_base.html:145 +msgid "Schema Extensions" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:86 +#: cove_ocds/templates/cove_ocds/explore_base.html:149 msgid "Your data contains the following schema extensions" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:86 +#: cove_ocds/templates/cove_ocds/explore_base.html:149 msgid ", but it wasn't possible to fetch them" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:92 +#: cove_ocds/templates/cove_ocds/explore_base.html:155 msgid "release schema" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:109 +#: cove_ocds/templates/cove_ocds/explore_base.html:172 msgid "The following extensions failed:" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:119 +#: cove_ocds/templates/cove_ocds/explore_base.html:182 msgid "" "Only those extensions successfully fetched were applied to extend the schema." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:121 +#: cove_ocds/templates/cove_ocds/explore_base.html:184 msgid "All the extensions above were applied to extend the schema." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:123 +#: cove_ocds/templates/cove_ocds/explore_base.html:186 msgid "Get a copy of the schema with extension patches applied" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:125 +#: cove_ocds/templates/cove_ocds/explore_base.html:188 msgid "" "None of the extensions above could be applied. Your data has been checked " "against a schema with no extensions." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:138 +#: cove_ocds/templates/cove_ocds/explore_base.html:201 msgid "Conversion Errors" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:143 +#: cove_ocds/templates/cove_ocds/explore_base.html:206 msgid "" "In order to check your data we need to convert it. During that conversion we " "found the following issues:" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:167 +#: cove_ocds/templates/cove_ocds/explore_base.html:230 msgid "Structural Errors - Required Fields" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:171 +#: cove_ocds/templates/cove_ocds/explore_base.html:234 msgid "" "Some or all of your data is missing fields which are required by the OCDS " "schema." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:191 +#: cove_ocds/templates/cove_ocds/explore_base.html:254 msgid "Structural Errors - Format" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:195 +#: cove_ocds/templates/cove_ocds/explore_base.html:258 msgid "" "Some or all of your data includes fields which are incorrectly formatted." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:215 +#: cove_ocds/templates/cove_ocds/explore_base.html:278 msgid "Structural Errors - Other" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:219 +#: cove_ocds/templates/cove_ocds/explore_base.html:282 msgid "Some or all of your data has validation errors." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:232 -#: cove_ocds/templates/cove_ocds/explore_base.html:404 -#: cove_ocds/templates/cove_ocds/explore_base.html:407 +#: cove_ocds/templates/cove_ocds/explore_base.html:295 +#: cove_ocds/templates/cove_ocds/explore_base.html:467 +#: cove_ocds/templates/cove_ocds/explore_base.html:470 msgid "Structure Warnings" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:237 -#: cove_ocds/templates/cove_ocds/explore_base.html:259 +#: cove_ocds/templates/cove_ocds/explore_base.html:300 +#: cove_ocds/templates/cove_ocds/explore_base.html:322 msgid "" "Fixing the following issues will improve the interoperability of your data." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:254 -#: cove_ocds/templates/cove_ocds/explore_base.html:392 -#: cove_ocds/templates/cove_ocds/explore_base.html:395 +#: cove_ocds/templates/cove_ocds/explore_base.html:317 +#: cove_ocds/templates/cove_ocds/explore_base.html:455 +#: cove_ocds/templates/cove_ocds/explore_base.html:458 msgid "Conformance (Rules)" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:276 +#: cove_ocds/templates/cove_ocds/explore_base.html:339 msgid "Codelist Errors" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:281 +#: cove_ocds/templates/cove_ocds/explore_base.html:344 msgid "" "The fields below use closed codelists. When using these fields, you " "must use one of the pre-defined codelist values. If you use a " @@ -383,7 +528,7 @@ msgid "" "extensions." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:285 +#: cove_ocds/templates/cove_ocds/explore_base.html:348 msgid "" "You may need to create a mapping between your local codes and the OCDS " "closed codelists to address these errors. In most cases, there will be a " @@ -392,11 +537,11 @@ msgid "" "used in these closed codelist fields." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:296 +#: cove_ocds/templates/cove_ocds/explore_base.html:359 msgid "Additional Fields" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:300 +#: cove_ocds/templates/cove_ocds/explore_base.html:363 msgid "" "This data includes the following fields which are not part of the OCDS " "schema. You should check whether the data in these fields could be provided " @@ -405,11 +550,11 @@ msgid "" "\">extension to the schema." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:314 +#: cove_ocds/templates/cove_ocds/explore_base.html:377 msgid "Additional Codelist Values" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:318 +#: cove_ocds/templates/cove_ocds/explore_base.html:381 msgid "" "Your data contains a number of fields that use an open codelist. You should " "use values from the codelist whenever possible, but if the codelist does not " @@ -420,7 +565,7 @@ msgid "" "(-) by one or more extensions." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:324 +#: cove_ocds/templates/cove_ocds/explore_base.html:387 msgid "" "Make sure you list the definition of any additional codelist values you " "include within your OCDS issue tracker." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:334 +#: cove_ocds/templates/cove_ocds/explore_base.html:397 msgid "Additional Checks" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:348 -#: cove_ocds/templates/cove_ocds/explore_base.html:428 -#: cove_ocds/templates/cove_ocds/explore_base.html:431 +#: cove_ocds/templates/cove_ocds/explore_base.html:411 +#: cove_ocds/templates/cove_ocds/explore_base.html:491 +#: cove_ocds/templates/cove_ocds/explore_base.html:494 msgid "Deprecated Fields" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:348 +#: cove_ocds/templates/cove_ocds/explore_base.html:411 msgid "" "Fields flagged as 'deprecated' will be either replaced or removed in future " "versions of the schema." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:364 +#: cove_ocds/templates/cove_ocds/explore_base.html:427 msgid "Save or Share these results" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:365 +#: cove_ocds/templates/cove_ocds/explore_base.html:428 msgid "Use the following url to share these results:" msgstr "" #. Translators: Paragraph that describes the application -#: cove_ocds/templates/cove_ocds/explore_base.html:370 +#: cove_ocds/templates/cove_ocds/explore_base.html:433 #, python-format msgid "" "These results will be available for %(delete_files_after_days)s days from " @@ -463,7 +608,7 @@ msgid "" "then." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:371 +#: cove_ocds/templates/cove_ocds/explore_base.html:434 #, python-format msgid "" "After %(delete_files_after_days)s days all uploaded data is deleted from our " @@ -472,193 +617,36 @@ msgid "" "been removed." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:386 -#: cove_ocds/templates/cove_ocds/explore_base.html:389 +#: cove_ocds/templates/cove_ocds/explore_base.html:449 +#: cove_ocds/templates/cove_ocds/explore_base.html:452 msgid "Structural Errors" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:398 +#: cove_ocds/templates/cove_ocds/explore_base.html:461 msgid "view all errors ▼" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:401 -#: cove_ocds/templates/cove_ocds/explore_base.html:413 -#: cove_ocds/templates/cove_ocds/explore_base.html:419 +#: cove_ocds/templates/cove_ocds/explore_base.html:464 +#: cove_ocds/templates/cove_ocds/explore_base.html:476 +#: cove_ocds/templates/cove_ocds/explore_base.html:482 msgid "View all errors ▲" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:410 +#: cove_ocds/templates/cove_ocds/explore_base.html:473 #: cove_ocds/templates/cove_ocds/ocds_missing_ids_table.html:6 #: cove_ocds/templates/cove_ocds/ocid_prefixes_table.html:5 msgid "View all errors ▼" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:416 +#: cove_ocds/templates/cove_ocds/explore_base.html:479 msgid "Quality Warnings" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_base.html:422 -#: cove_ocds/templates/cove_ocds/explore_base.html:425 +#: cove_ocds/templates/cove_ocds/explore_base.html:485 +#: cove_ocds/templates/cove_ocds/explore_base.html:488 msgid "Additional Fields (fields in data not in schema)" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_record.html:9 -#: cove_ocds/templates/cove_ocds/explore_release.html:9 -msgid "Headlines" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:13 -#: cove_ocds/templates/cove_ocds/explore_release.html:13 -msgid "" -"Please read the conversion warnings " -"below." -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:18 -#: cove_ocds/templates/cove_ocds/explore_release.html:18 -msgid "Failed " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:20 -#: cove_ocds/templates/cove_ocds/explore_release.html:20 -msgid "Passed " -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:22 -#, python-format -msgid "" -"structural checks against OCDS record package " -"schema version %(version_used_display)s." -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:23 -#: cove_ocds/templates/cove_ocds/explore_release.html:23 -msgid "See Structural Errors below." -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:28 -#: cove_ocds/templates/cove_ocds/explore_release.html:28 -#, python-format -msgid "Failed to apply %(count)s extension to the schema." -msgid_plural "" -"Failed to apply %(count)s extensions to the schema." -msgstr[0] "" -msgstr[1] "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:29 -#: cove_ocds/templates/cove_ocds/explore_release.html:29 -msgid "See Extensions below." -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:34 -#: cove_ocds/templates/cove_ocds/explore_release.html:34 -msgid "At a glance" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:38 -#, python-format -msgid "This file contains %(count)s record" -msgid_plural "This file contains %(count)s records" -msgstr[0] "" -msgstr[1] "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:39 -#: cove_ocds/templates/cove_ocds/explore_release.html:39 -#, python-format -msgid " describing %(count)s contracting process" -msgid_plural " describing %(count)s contracting processes." -msgstr[0] "" -msgstr[1] "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:45 -#: cove_ocds/templates/cove_ocds/explore_release.html:45 -msgid "The schema version specified in the file is" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:51 -#: cove_ocds/templates/cove_ocds/explore_release.html:51 -msgid "The publisher named in the file is" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:57 -#: cove_ocds/templates/cove_ocds/explore_release.html:57 -msgid "The license is" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:63 -#: cove_ocds/templates/cove_ocds/explore_release.html:63 -msgid "Publication policy is" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:70 -#: cove_ocds/templates/cove_ocds/explore_release.html:70 -#, python-format -msgid "" -"This file applies %(count)s valid extension to the schema." -msgid_plural "" -"This file applies %(count)s valid extensions to the schema." -msgstr[0] "" -msgstr[1] "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:77 -#: cove_ocds/templates/cove_ocds/explore_release.html:77 -#, python-format -msgid "" -"This file uses %(count)s additional field " -"not used in the standard." -msgid_plural "" -"This file uses %(count)s additional fields not used in the standard." -msgstr[0] "" -msgstr[1] "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:83 -#: cove_ocds/templates/cove_ocds/explore_release.html:83 -#, python-format -msgid "" -"This file is not 'utf-8' encoded (it is %(csv_encoding)s " -"encoded)." -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:89 -#: cove_ocds/templates/cove_ocds/explore_release.html:89 -#, python-format -msgid "" -"This file uses %(count)s deprecated field." -msgid_plural "" -" This file uses %(count)s deprecated fields." -msgstr[0] "" -msgstr[1] "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:95 -#: cove_ocds/templates/cove_ocds/explore_release.html:95 -#, python-format -msgid "Data downloaded from %(source_url)s on %(created_datetime)s." -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:97 -#: cove_ocds/templates/cove_ocds/explore_release.html:97 -#, python-format -msgid "Data uploaded on %(created_datetime)s." -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:22 -#, python-format -msgid "" -"structural checks against OCDS release package " -"schema version %(version_used_display)s." -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:38 -#, python-format -msgid "This file contains %(count)s release" -msgid_plural "This file contains %(count)s releases" -msgstr[0] "" -msgstr[1] "" - #: cove_ocds/templates/cove_ocds/input.html:6 msgid "Loading" msgstr "" @@ -814,18 +802,17 @@ msgid "" "reference/#date\">dates in OCDS." msgstr "" -#: cove_ocds/util.py:19 cove_ocds/util.py:38 cove_ocds/util.py:56 -#: cove_ocds/views.py:98 +#: cove_ocds/util.py:18 cove_ocds/util.py:37 cove_ocds/util.py:55 +#: cove_ocds/views.py:97 msgid "Sorry, we can't process that data" msgstr "" -#: cove_ocds/util.py:22 cove_ocds/util.py:41 cove_ocds/util.py:58 -#: cove_ocds/util.py:84 cove_ocds/util.py:107 cove_ocds/util.py:126 -#: cove_ocds/views.py:100 cove_ocds/views.py:135 +#: cove_ocds/util.py:21 cove_ocds/util.py:40 cove_ocds/util.py:57 +#: cove_ocds/util.py:79 cove_ocds/views.py:99 cove_ocds/views.py:130 msgid "Try Again" msgstr "" -#: cove_ocds/util.py:25 +#: cove_ocds/util.py:24 msgid "" "The file that you uploaded doesn't appear to be well formed JSON. OCDS JSON " "follows the I-JSON format, which requires UTF-8 encoding. Ensure that your " @@ -835,7 +822,7 @@ msgid "" "span> Error message: {}" msgstr "" -#: cove_ocds/util.py:44 +#: cove_ocds/util.py:43 msgid "" "We think you tried to upload a JSON file, but it is not well formed JSON.\n" "\n" @@ -843,17 +830,17 @@ msgid "" "span> Error message: {}" msgstr "" -#: cove_ocds/util.py:59 +#: cove_ocds/util.py:58 msgid "" "OCDS JSON should have an object as the top level, the JSON you supplied does " "not." msgstr "" -#: cove_ocds/util.py:81 cove_ocds/util.py:82 +#: cove_ocds/util.py:76 cove_ocds/util.py:77 msgid "Missing OCDS package" msgstr "" -#: cove_ocds/util.py:87 +#: cove_ocds/util.py:82 msgid "" "We could not detect a package structure at the top-level of your data. OCDS " "releases and records should be published within a Error message: Missing OCDS package" msgstr "" -#: cove_ocds/util.py:104 -msgid "Unrecognised version of the schema" -msgstr "" - -#: cove_ocds/util.py:105 cove_ocds/util.py:124 -#, python-format -msgid "%(version)s is not a known schema version" -msgstr "" - -#: cove_ocds/util.py:110 -msgid "" -"We think you tried to run your data against an unrecognised version of the " -"schema.\n" -"\n" -" Error message: {} is not a recognised choice " -"for the schema version" -msgstr "" - -#: cove_ocds/util.py:123 -msgid "Version format does not comply with the schema" -msgstr "" - -#: cove_ocds/util.py:129 -msgid "" -"The value for the \"version\" field in your data follows the " -"major.minor.patch pattern but according to the schema the patch " -"digit shouldn't be included (e.g. \"1.1.0\" should appear as " -"\"1.1\" in your data as this tool always uses the latest patch " -"release for a major.minor version).\n" -"\n" -"Please get rid of the patch digit and try again.\n" -"\n" -" Error message: {} format does not comply " -"with the schema" -msgstr "" - -#: cove_ocds/util.py:143 -#, python-format -msgid "%(version)s (not a string)" -msgstr "" - -#: cove_ocds/views.py:104 +#: cove_ocds/views.py:103 msgid "" "The table isn't structured correctly. For example, a JSON Pointer " "(tender) can't be both a value (tender), a path to " @@ -922,11 +866,11 @@ msgid "" "span> Error message: {}" msgstr "" -#: cove_ocds/views.py:133 +#: cove_ocds/views.py:128 msgid "JSON reference error" msgstr "" -#: cove_ocds/views.py:145 +#: cove_ocds/views.py:140 #, python-format msgid "%(error)s" msgstr "" diff --git a/cove_ocds/locale/es/LC_MESSAGES/django.po b/cove_ocds/locale/es/LC_MESSAGES/django.po index 38beb141..a2c2d575 100644 --- a/cove_ocds/locale/es/LC_MESSAGES/django.po +++ b/cove_ocds/locale/es/LC_MESSAGES/django.po @@ -15,7 +15,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-19 18:45+0000\n" +"POT-Creation-Date: 2024-10-19 21:11+0000\n" "PO-Revision-Date: 2020-09-08 08:53+0000\n" "Last-Translator: James McKinney, 2024\n" "Language-Team: Spanish (https://app.transifex.com/open-contracting-" @@ -27,6 +27,33 @@ msgstr "" "Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? " "1 : 2;\n" +#: cove_ocds/templates/500.html:7 +msgid "Internal Server Error" +msgstr "Error de Servidor Interno" + +#: cove_ocds/templates/500.html:11 +msgid "" +"Something went wrong with your request. This could be due to a bug in the " +"application and/or the data you supplied." +msgstr "" +"Algo ha ido mal con su petición al servidor. Esto podría ser debido a un " +"error en la aplicación o en los datos proporcionados." + +#: cove_ocds/templates/500.html:12 +#, python-format +msgid "" +"This error has been automatically reported to our development team. If you " +"get in " +"touch, please reference this error as %(request.sentry.id)s." +msgstr "" +"Nuestro equipo de desarrollo ha sido informado de este error de forma " +"automática. Si usted póngase " +"en contacto,por favor haga referencia a este error como " +"%(request.sentry.id)s." + #: cove_ocds/templates/cove_ocds/additional_checks_table.html:7 msgid "Check Description" msgstr "Compruebe la Descripción" @@ -272,15 +299,56 @@ msgstr "" "\n" " Obsoleto en %(version)s %(description)s" -#: cove_ocds/templates/cove_ocds/explore_base.html:5 +#: cove_ocds/templates/cove_ocds/explore_base.html:6 msgid "Load New File" msgstr "Cargar archivo nuevo" -#: cove_ocds/templates/cove_ocds/explore_base.html:18 -msgid "Schema" -msgstr "Esquema" +#: cove_ocds/templates/cove_ocds/explore_base.html:15 +msgid "Headlines" +msgstr "Titulares" + +#: cove_ocds/templates/cove_ocds/explore_base.html:19 +msgid "" +"Please read the conversion warnings " +"below." +msgstr "" +"Por favor, lea las advertencias de " +"conversión más abajo." -#: cove_ocds/templates/cove_ocds/explore_base.html:23 +#: cove_ocds/templates/cove_ocds/explore_base.html:26 +#, python-format +msgid "" +"Failed structural checks against OCDS " +"record package schema version %(version_used_display)s." +msgstr "" + +#: cove_ocds/templates/cove_ocds/explore_base.html:28 +#, python-format +msgid "" +"Failed structural checks against OCDS " +"release package schema version %(version_used_display)s." +msgstr "" + +#: cove_ocds/templates/cove_ocds/explore_base.html:32 +#, python-format +msgid "" +"Passed structural checks against OCDS record " +"package schema version %(version_used_display)s." +msgstr "" + +#: cove_ocds/templates/cove_ocds/explore_base.html:34 +#, python-format +msgid "" +"Passed structural checks against OCDS release " +"package schema version %(version_used_display)s." +msgstr "" + +#: cove_ocds/templates/cove_ocds/explore_base.html:39 +msgid "See Structural Errors below." +msgstr "" +"Ver Errores Estructurales más abajo." + +#: cove_ocds/templates/cove_ocds/explore_base.html:45 #, python-format msgid "" "Your data specifies a version %(unrecognized_version_data)s " @@ -291,87 +359,207 @@ msgstr "" "strong>que no es reconocida. Por esta razón, se ha verificado en relación a " "la versión actual por defecto." -#: cove_ocds/templates/cove_ocds/explore_base.html:26 +#: cove_ocds/templates/cove_ocds/explore_base.html:51 +#, python-format +msgid "Failed to apply %(count)s extension to the schema." +msgid_plural "" +"Failed to apply %(count)s extensions to the schema." +msgstr[0] "" +"Ha fallado al aplicar %(count)s extensión al esquema." +msgstr[1] "" +"Ha fallado al aplicar %(count)s extensiones al esquema." +msgstr[2] "" +"Ha fallado al aplicar %(count)s extensiones al esquema." + +#: cove_ocds/templates/cove_ocds/explore_base.html:52 +msgid "See Extensions below." +msgstr "Vea Extensiones más abajo." + +#: cove_ocds/templates/cove_ocds/explore_base.html:58 #, python-format msgid "" -"This data has been checked against OCDS " -"%(release_or_record)s package schema version %(version_used_display)s." +"To validated your file, we converted it to JSON format (%(size)s download)." msgstr "" -"Este dato ha sido verificado con la versión " -"%(version_used_display)sdel paquete del esquema %(release_or_record)s" -#: cove_ocds/templates/cove_ocds/explore_base.html:37 -msgid "Convert" -msgstr "Convertir" +#: cove_ocds/templates/cove_ocds/explore_base.html:63 +msgid "At a glance" +msgstr "De un vistazo" + +#: cove_ocds/templates/cove_ocds/explore_base.html:68 +#, python-format +msgid "This file contains %(count)s record" +msgid_plural "This file contains %(count)s records" +msgstr[0] "Este archivo contiene %(count)s registro" +msgstr[1] "Este archivo contiene %(count)s registros" +msgstr[2] "Este archivo contiene %(count)s registros" + +#: cove_ocds/templates/cove_ocds/explore_base.html:70 +#, python-format +msgid "This file contains %(count)s release" +msgid_plural "This file contains %(count)s releases" +msgstr[0] "Este archivo contiene %(count)s entrega" +msgstr[1] "Este archivo contiene %(count)s entregas" +msgstr[2] "Este archivo contiene %(count)s entregas" -#: cove_ocds/templates/cove_ocds/explore_base.html:44 +#: cove_ocds/templates/cove_ocds/explore_base.html:72 +#, python-format +msgid " describing %(count)s contracting process" +msgid_plural " describing %(count)s contracting processes." +msgstr[0] "describiendo un proceso de contratación" +msgstr[1] "describiendo %(count)s procesos de contratación." +msgstr[2] "describiendo %(count)s procesos de contratación." + +#: cove_ocds/templates/cove_ocds/explore_base.html:78 +#, python-format msgid "" -"There were conversion warnings when " -"processing your file. The converted data may not represent your data as you " -"want it to be." +"The schema version specified in the file is %(data_schema_version)s." msgstr "" -"Hubieron advertencias de conversión al " -"procesar su archivo. Los datos convertidos puede que no representen sus " -"datos como lo desea. " +"La versión del esquema especificada en el archivo es " +"%(data_schema_version)s." -#: cove_ocds/templates/cove_ocds/explore_base.html:46 -msgid "We have tried to convert your data into JSON format." -msgstr "Hemos intentado convertir sus datos a formato JSON." +#: cove_ocds/templates/cove_ocds/explore_base.html:84 +#, python-format +msgid "" +"The publisher named in the file is %(json_data.publisher.name)s." +msgstr "" +"El publicador nombrado en el archivo es " +"%(json_data.publisher.name)s." -#: cove_ocds/templates/cove_ocds/explore_base.html:46 -msgid "The results can be seen below." -msgstr "Los resultados se pueden ver a continuación." +#: cove_ocds/templates/cove_ocds/explore_base.html:90 +#, python-format +msgid "" +"The license is %(json_data.license)s." +msgstr "" +"La licencia es %(json_data.license)s." -#: cove_ocds/templates/cove_ocds/explore_base.html:60 -msgid "using schema version" -msgstr "usando versión del esquema" +#: cove_ocds/templates/cove_ocds/explore_base.html:96 +#, python-format +msgid "" +"Publication policy is %(json_data.publicationPolicy)s." +msgstr "" +"La política de publicación es %(json_data.publicationPolicy)s." -#: cove_ocds/templates/cove_ocds/explore_base.html:77 -msgid "Schema Extensions" -msgstr "Extensiones del Esquema" +#: cove_ocds/templates/cove_ocds/explore_base.html:103 +#, python-format +msgid "" +"This file applies %(count)s valid extension to the schema." +msgid_plural "" +"This file applies %(count)s valid extensions to the schema." +msgstr[0] "" +"Este archivo incorpora %(count)s extensión válida al esquema." +msgstr[1] "" +"Este archivo incorpora %(count)s extensiones válida al esquema." +msgstr[2] "" +"Este archivo incorpora %(count)s extensiones válida al esquema." + +#: cove_ocds/templates/cove_ocds/explore_base.html:110 +#, python-format +msgid "" +"This file uses %(count)s additional field " +"not used in the standard." +msgid_plural "" +"This file uses %(count)s additional fields not used in the standard." +msgstr[0] "" +"Este archivo utiliza un campo adicional \"\n" +"\"no incluido en el estándar." +msgstr[1] "" +"Este archivo utiliza %(count)s campos " +"adicionalesno incluidos en el estándar." +msgstr[2] "" +"Este archivo utiliza %(count)s campos " +"adicionalesno incluidos en el estándar." + +#: cove_ocds/templates/cove_ocds/explore_base.html:116 +#, python-format +msgid "" +"This file is not 'utf-8' encoded (it is %(csv_encoding)s " +"encoded)." +msgstr "" +"Este archivo no ha sido codificado con 'utf-8' (ha sido codificado con " +"%(csv_encoding)s)." + +#: cove_ocds/templates/cove_ocds/explore_base.html:122 +#, python-format +msgid "" +"This file uses %(count)s deprecated field." +msgid_plural "" +" This file uses %(count)s deprecated fields." +msgstr[0] "" +"Este archivo usa uncampo obsoleto." +msgstr[1] "" +"Este archivo usa %(count)s campos " +"obsoletos." +msgstr[2] "" +"Este archivo usa %(count)s campos " +"obsoletos." -#: cove_ocds/templates/cove_ocds/explore_base.html:83 +#: cove_ocds/templates/cove_ocds/explore_base.html:128 +#, python-format +msgid "" +"Data downloaded (%(size)s cached) from " +"%(source_url)s on %(created_datetime)s." +msgstr "" +"Datos descargado (%(size)s caché) desde " +"%(source_url)s el %(created_datetime)s." + +#: cove_ocds/templates/cove_ocds/explore_base.html:130 +#, python-format msgid "" -"Your data has been checked against schema version 1.0 and " -"includes extensions but extensions were not introduced in the schema until " -"version 1.1." +"Data uploaded (%(size)s cached) on " +"%(created_datetime)s." msgstr "" -"Sus datos se han comparado con la versión 1.0 del esquema e " -"incluyen extensiones, pero no se introdujeron extensiones en el esquema " -"hasta la versión 1.1 ." +"Datos subido (%(size)s caché) el " +"%(created_datetime)s." -#: cove_ocds/templates/cove_ocds/explore_base.html:86 +#: cove_ocds/templates/cove_ocds/explore_base.html:145 +msgid "Schema Extensions" +msgstr "Extensiones del Esquema" + +#: cove_ocds/templates/cove_ocds/explore_base.html:149 msgid "Your data contains the following schema extensions" msgstr "Los datos contienen las siguientes extensiones de esquema" -#: cove_ocds/templates/cove_ocds/explore_base.html:86 +#: cove_ocds/templates/cove_ocds/explore_base.html:149 msgid ", but it wasn't possible to fetch them" msgstr ", pero no fue posible recuperarlos " -#: cove_ocds/templates/cove_ocds/explore_base.html:92 +#: cove_ocds/templates/cove_ocds/explore_base.html:155 msgid "release schema" msgstr "esquema de entrega" -#: cove_ocds/templates/cove_ocds/explore_base.html:109 +#: cove_ocds/templates/cove_ocds/explore_base.html:172 msgid "The following extensions failed:" msgstr "Las siguientes extensiones fallaron:" -#: cove_ocds/templates/cove_ocds/explore_base.html:119 +#: cove_ocds/templates/cove_ocds/explore_base.html:182 msgid "" "Only those extensions successfully fetched were applied to extend the schema." msgstr "" "Solo las extensiones obtenidas con éxito se aplicaron para ampliar el " "esquema." -#: cove_ocds/templates/cove_ocds/explore_base.html:121 +#: cove_ocds/templates/cove_ocds/explore_base.html:184 msgid "All the extensions above were applied to extend the schema." msgstr "Todas las extensiones anteriores se aplicaron para ampliar el esquema." -#: cove_ocds/templates/cove_ocds/explore_base.html:123 +#: cove_ocds/templates/cove_ocds/explore_base.html:186 msgid "Get a copy of the schema with extension patches applied" msgstr "Obtenga una copia del esquema con los parches de extensión aplicados" -#: cove_ocds/templates/cove_ocds/explore_base.html:125 +#: cove_ocds/templates/cove_ocds/explore_base.html:188 msgid "" "None of the extensions above could be applied. Your data has been checked " "against a schema with no extensions." @@ -379,11 +567,11 @@ msgstr "" "No se pudo aplicar ninguna de las extensiones anteriores. Sus datos han sido " "comparados con un esquema sin extensiones." -#: cove_ocds/templates/cove_ocds/explore_base.html:138 +#: cove_ocds/templates/cove_ocds/explore_base.html:201 msgid "Conversion Errors" msgstr "Errores de Conversión" -#: cove_ocds/templates/cove_ocds/explore_base.html:143 +#: cove_ocds/templates/cove_ocds/explore_base.html:206 msgid "" "In order to check your data we need to convert it. During that conversion we " "found the following issues:" @@ -391,61 +579,61 @@ msgstr "" "Para verificar sus datos, necesitamos convertirlos. Durante esta conversión, " "encontramos los siguientes problemas:" -#: cove_ocds/templates/cove_ocds/explore_base.html:167 +#: cove_ocds/templates/cove_ocds/explore_base.html:230 msgid "Structural Errors - Required Fields" msgstr "Errores Estructurales - Campos Requeridos" -#: cove_ocds/templates/cove_ocds/explore_base.html:171 +#: cove_ocds/templates/cove_ocds/explore_base.html:234 msgid "" "Some or all of your data is missing fields which are required by the OCDS " "schema." msgstr "" "En alguno o todos tus datos faltan campos requeridos por el esquema OCDS." -#: cove_ocds/templates/cove_ocds/explore_base.html:191 +#: cove_ocds/templates/cove_ocds/explore_base.html:254 msgid "Structural Errors - Format" msgstr "Errores Estructurales - Formato" -#: cove_ocds/templates/cove_ocds/explore_base.html:195 +#: cove_ocds/templates/cove_ocds/explore_base.html:258 msgid "" "Some or all of your data includes fields which are incorrectly formatted." msgstr "" "Alguno o todos tus datos incluyen campos que están formateados " "incorrectamente." -#: cove_ocds/templates/cove_ocds/explore_base.html:215 +#: cove_ocds/templates/cove_ocds/explore_base.html:278 msgid "Structural Errors - Other" msgstr "Errores Estructurales - Otro" -#: cove_ocds/templates/cove_ocds/explore_base.html:219 +#: cove_ocds/templates/cove_ocds/explore_base.html:282 msgid "Some or all of your data has validation errors." msgstr "Alguno o todos tus datos tienen errores de validación." -#: cove_ocds/templates/cove_ocds/explore_base.html:232 -#: cove_ocds/templates/cove_ocds/explore_base.html:404 -#: cove_ocds/templates/cove_ocds/explore_base.html:407 +#: cove_ocds/templates/cove_ocds/explore_base.html:295 +#: cove_ocds/templates/cove_ocds/explore_base.html:467 +#: cove_ocds/templates/cove_ocds/explore_base.html:470 msgid "Structure Warnings" msgstr "Advertencias de Estructura" -#: cove_ocds/templates/cove_ocds/explore_base.html:237 -#: cove_ocds/templates/cove_ocds/explore_base.html:259 +#: cove_ocds/templates/cove_ocds/explore_base.html:300 +#: cove_ocds/templates/cove_ocds/explore_base.html:322 msgid "" "Fixing the following issues will improve the interoperability of your data." msgstr "" "La resolución de los siguientes problemas mejorará la interoperabilidad de " "sus datos." -#: cove_ocds/templates/cove_ocds/explore_base.html:254 -#: cove_ocds/templates/cove_ocds/explore_base.html:392 -#: cove_ocds/templates/cove_ocds/explore_base.html:395 +#: cove_ocds/templates/cove_ocds/explore_base.html:317 +#: cove_ocds/templates/cove_ocds/explore_base.html:455 +#: cove_ocds/templates/cove_ocds/explore_base.html:458 msgid "Conformance (Rules)" msgstr "Conformidad (Reglas)" -#: cove_ocds/templates/cove_ocds/explore_base.html:276 +#: cove_ocds/templates/cove_ocds/explore_base.html:339 msgid "Codelist Errors" msgstr "Errores de la Lista de Códigos" -#: cove_ocds/templates/cove_ocds/explore_base.html:281 +#: cove_ocds/templates/cove_ocds/explore_base.html:344 msgid "" "The fields below use closed codelists. When using these fields, you " "must use one of the pre-defined codelist values. If you use a " @@ -461,7 +649,7 @@ msgstr "" "+ o - esto indica que la lista de códigos ha sido modificada con estas " "adiciones (+) o sustracciones (-) por una o más extensiones." -#: cove_ocds/templates/cove_ocds/explore_base.html:285 +#: cove_ocds/templates/cove_ocds/explore_base.html:348 msgid "" "You may need to create a mapping between your local codes and the OCDS " "closed codelists to address these errors. In most cases, there will be a " @@ -475,11 +663,11 @@ msgstr "" "códigos locales. Si ya ha completado un mapeo, favor revise la ortografía y " "las mayúsculas utilizadas en estos campos cerrados de la lista de códigos." -#: cove_ocds/templates/cove_ocds/explore_base.html:296 +#: cove_ocds/templates/cove_ocds/explore_base.html:359 msgid "Additional Fields" msgstr "Campos adicionales" -#: cove_ocds/templates/cove_ocds/explore_base.html:300 +#: cove_ocds/templates/cove_ocds/explore_base.html:363 msgid "" "This data includes the following fields which are not part of the OCDS " "schema. You should check whether the data in these fields could be provided " @@ -493,11 +681,11 @@ msgstr "" "standard.open-contracting.org/latest/en/extensions/\">extensión " "existente del esquema." -#: cove_ocds/templates/cove_ocds/explore_base.html:314 +#: cove_ocds/templates/cove_ocds/explore_base.html:377 msgid "Additional Codelist Values" msgstr "Valores Adicionales de Listas de Códigos" -#: cove_ocds/templates/cove_ocds/explore_base.html:318 +#: cove_ocds/templates/cove_ocds/explore_base.html:381 msgid "" "Your data contains a number of fields that use an open codelist. You should " "use values from the codelist whenever possible, but if the codelist does not " @@ -516,7 +704,7 @@ msgstr "" "de códigos ha sido modificada con estas adiciones (+) o sustracciones (-) " "por una o más extensiones." -#: cove_ocds/templates/cove_ocds/explore_base.html:324 +#: cove_ocds/templates/cove_ocds/explore_base.html:387 msgid "" "Make sure you list the definition of any additional codelist values you " "include within your gestor de " "incidencias de OCDS ." -#: cove_ocds/templates/cove_ocds/explore_base.html:334 +#: cove_ocds/templates/cove_ocds/explore_base.html:397 msgid "Additional Checks" msgstr "Comprobaciones adicionales" -#: cove_ocds/templates/cove_ocds/explore_base.html:348 -#: cove_ocds/templates/cove_ocds/explore_base.html:428 -#: cove_ocds/templates/cove_ocds/explore_base.html:431 +#: cove_ocds/templates/cove_ocds/explore_base.html:411 +#: cove_ocds/templates/cove_ocds/explore_base.html:491 +#: cove_ocds/templates/cove_ocds/explore_base.html:494 msgid "Deprecated Fields" msgstr "Campos Obsoletos" -#: cove_ocds/templates/cove_ocds/explore_base.html:348 +#: cove_ocds/templates/cove_ocds/explore_base.html:411 msgid "" "Fields flagged as 'deprecated' will be either replaced or removed in future " "versions of the schema." @@ -551,16 +739,16 @@ msgstr "" "Campos marcados como 'obsoletos' serán reemplazados o eliminados en futuras " "versiones del esquema." -#: cove_ocds/templates/cove_ocds/explore_base.html:364 +#: cove_ocds/templates/cove_ocds/explore_base.html:427 msgid "Save or Share these results" msgstr "Guardar o Compartir estos resultados" -#: cove_ocds/templates/cove_ocds/explore_base.html:365 +#: cove_ocds/templates/cove_ocds/explore_base.html:428 msgid "Use the following url to share these results:" msgstr "Use la siguiente url para compartir estos resultados: " #. Translators: Paragraph that describes the application -#: cove_ocds/templates/cove_ocds/explore_base.html:370 +#: cove_ocds/templates/cove_ocds/explore_base.html:433 #, python-format msgid "" "These results will be available for %(delete_files_after_days)s days from " @@ -571,7 +759,7 @@ msgstr "" "días desde el día en que los datos fueron subidos. Puede revisar estos " "resultados hasta entonces." -#: cove_ocds/templates/cove_ocds/explore_base.html:371 +#: cove_ocds/templates/cove_ocds/explore_base.html:434 #, python-format msgid "" "After %(delete_files_after_days)s days all uploaded data is deleted from our " @@ -584,226 +772,36 @@ msgstr "" "Cualquiera que use el enlace a esta página después de ese periodo verá un " "mensaje informando de que el archivo ha sido borrado." -#: cove_ocds/templates/cove_ocds/explore_base.html:386 -#: cove_ocds/templates/cove_ocds/explore_base.html:389 +#: cove_ocds/templates/cove_ocds/explore_base.html:449 +#: cove_ocds/templates/cove_ocds/explore_base.html:452 msgid "Structural Errors" msgstr "Errores Estructurales" -#: cove_ocds/templates/cove_ocds/explore_base.html:398 +#: cove_ocds/templates/cove_ocds/explore_base.html:461 msgid "view all errors ▼" msgstr "ver todos los errores ▼" -#: cove_ocds/templates/cove_ocds/explore_base.html:401 -#: cove_ocds/templates/cove_ocds/explore_base.html:413 -#: cove_ocds/templates/cove_ocds/explore_base.html:419 +#: cove_ocds/templates/cove_ocds/explore_base.html:464 +#: cove_ocds/templates/cove_ocds/explore_base.html:476 +#: cove_ocds/templates/cove_ocds/explore_base.html:482 msgid "View all errors ▲" msgstr "Vea todos los errores ▲" -#: cove_ocds/templates/cove_ocds/explore_base.html:410 +#: cove_ocds/templates/cove_ocds/explore_base.html:473 #: cove_ocds/templates/cove_ocds/ocds_missing_ids_table.html:6 #: cove_ocds/templates/cove_ocds/ocid_prefixes_table.html:5 msgid "View all errors ▼" msgstr "Vea todos los errores ▼" -#: cove_ocds/templates/cove_ocds/explore_base.html:416 +#: cove_ocds/templates/cove_ocds/explore_base.html:479 msgid "Quality Warnings" msgstr "Advertencias de Calidad" -#: cove_ocds/templates/cove_ocds/explore_base.html:422 -#: cove_ocds/templates/cove_ocds/explore_base.html:425 +#: cove_ocds/templates/cove_ocds/explore_base.html:485 +#: cove_ocds/templates/cove_ocds/explore_base.html:488 msgid "Additional Fields (fields in data not in schema)" msgstr "Campos adicionales (campos en los datos que no están en el esquema)" -#: cove_ocds/templates/cove_ocds/explore_record.html:9 -#: cove_ocds/templates/cove_ocds/explore_release.html:9 -msgid "Headlines" -msgstr "Titulares" - -#: cove_ocds/templates/cove_ocds/explore_record.html:13 -#: cove_ocds/templates/cove_ocds/explore_release.html:13 -msgid "" -"Please read the conversion warnings " -"below." -msgstr "" -"Por favor, lea las advertencias de " -"conversión más abajo." - -#: cove_ocds/templates/cove_ocds/explore_record.html:18 -#: cove_ocds/templates/cove_ocds/explore_release.html:18 -msgid "Failed " -msgstr "Ha fallado " - -#: cove_ocds/templates/cove_ocds/explore_record.html:20 -#: cove_ocds/templates/cove_ocds/explore_release.html:20 -msgid "Passed " -msgstr "Ha pasado " - -#: cove_ocds/templates/cove_ocds/explore_record.html:22 -#, python-format -msgid "" -"structural checks against OCDS record package " -"schema version %(version_used_display)s." -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:23 -#: cove_ocds/templates/cove_ocds/explore_release.html:23 -msgid "See Structural Errors below." -msgstr "" -"Ver Errores Estructurales más abajo." - -#: cove_ocds/templates/cove_ocds/explore_record.html:28 -#: cove_ocds/templates/cove_ocds/explore_release.html:28 -#, python-format -msgid "Failed to apply %(count)s extension to the schema." -msgid_plural "" -"Failed to apply %(count)s extensions to the schema." -msgstr[0] "" -"Ha fallado al aplicar %(count)s extensión al esquema." -msgstr[1] "" -"Ha fallado al aplicar %(count)s extensiones al esquema." -msgstr[2] "" -"Ha fallado al aplicar %(count)s extensiones al esquema." - -#: cove_ocds/templates/cove_ocds/explore_record.html:29 -#: cove_ocds/templates/cove_ocds/explore_release.html:29 -msgid "See Extensions below." -msgstr "Vea Extensiones más abajo." - -#: cove_ocds/templates/cove_ocds/explore_record.html:34 -#: cove_ocds/templates/cove_ocds/explore_release.html:34 -msgid "At a glance" -msgstr "De un vistazo" - -#: cove_ocds/templates/cove_ocds/explore_record.html:38 -#, python-format -msgid "This file contains %(count)s record" -msgid_plural "This file contains %(count)s records" -msgstr[0] "Este archivo contiene %(count)s registro" -msgstr[1] "Este archivo contiene %(count)s registros" -msgstr[2] "Este archivo contiene %(count)s registros" - -#: cove_ocds/templates/cove_ocds/explore_record.html:39 -#: cove_ocds/templates/cove_ocds/explore_release.html:39 -#, python-format -msgid " describing %(count)s contracting process" -msgid_plural " describing %(count)s contracting processes." -msgstr[0] "describiendo un proceso de contratación" -msgstr[1] "describiendo %(count)s procesos de contratación." -msgstr[2] "describiendo %(count)s procesos de contratación." - -#: cove_ocds/templates/cove_ocds/explore_record.html:45 -#: cove_ocds/templates/cove_ocds/explore_release.html:45 -msgid "The schema version specified in the file is" -msgstr "La versión del esquema especificada en el archivo es " - -#: cove_ocds/templates/cove_ocds/explore_record.html:51 -#: cove_ocds/templates/cove_ocds/explore_release.html:51 -msgid "The publisher named in the file is" -msgstr "El publicador nombrado en el archivo es" - -#: cove_ocds/templates/cove_ocds/explore_record.html:57 -#: cove_ocds/templates/cove_ocds/explore_release.html:57 -msgid "The license is" -msgstr "La licencia es " - -#: cove_ocds/templates/cove_ocds/explore_record.html:63 -#: cove_ocds/templates/cove_ocds/explore_release.html:63 -msgid "Publication policy is" -msgstr "Una política de publicación es" - -#: cove_ocds/templates/cove_ocds/explore_record.html:70 -#: cove_ocds/templates/cove_ocds/explore_release.html:70 -#, python-format -msgid "" -"This file applies %(count)s valid extension to the schema." -msgid_plural "" -"This file applies %(count)s valid extensions to the schema." -msgstr[0] "" -"Este archivo incorpora %(count)s extensión válida al esquema." -msgstr[1] "" -"Este archivo incorpora %(count)s extensiones válida al esquema." -msgstr[2] "" -"Este archivo incorpora %(count)s extensiones válida al esquema." - -#: cove_ocds/templates/cove_ocds/explore_record.html:77 -#: cove_ocds/templates/cove_ocds/explore_release.html:77 -#, python-format -msgid "" -"This file uses %(count)s additional field " -"not used in the standard." -msgid_plural "" -"This file uses %(count)s additional fields not used in the standard." -msgstr[0] "" -"Este archivo utiliza un campo adicional \"\n" -"\"no incluido en el estándar." -msgstr[1] "" -"Este archivo utiliza %(count)s campos " -"adicionalesno incluidos en el estándar." -msgstr[2] "" -"Este archivo utiliza %(count)s campos " -"adicionalesno incluidos en el estándar." - -#: cove_ocds/templates/cove_ocds/explore_record.html:83 -#: cove_ocds/templates/cove_ocds/explore_release.html:83 -#, python-format -msgid "" -"This file is not 'utf-8' encoded (it is %(csv_encoding)s " -"encoded)." -msgstr "" -"Este archivo no ha sido codificado con 'utf-8' (ha sido codificado con " -"%(csv_encoding)s)." - -#: cove_ocds/templates/cove_ocds/explore_record.html:89 -#: cove_ocds/templates/cove_ocds/explore_release.html:89 -#, python-format -msgid "" -"This file uses %(count)s deprecated field." -msgid_plural "" -" This file uses %(count)s deprecated fields." -msgstr[0] "" -"Este archivo usa uncampo obsoleto." -msgstr[1] "" -"Este archivo usa %(count)s campos " -"obsoletos." -msgstr[2] "" -"Este archivo usa %(count)s campos " -"obsoletos." - -#: cove_ocds/templates/cove_ocds/explore_record.html:95 -#: cove_ocds/templates/cove_ocds/explore_release.html:95 -#, python-format -msgid "Data downloaded from %(source_url)s on %(created_datetime)s." -msgstr "Datos descargado desde %(source_url)s el %(created_datetime)s." - -#: cove_ocds/templates/cove_ocds/explore_record.html:97 -#: cove_ocds/templates/cove_ocds/explore_release.html:97 -#, python-format -msgid "Data uploaded on %(created_datetime)s." -msgstr "Datos subido el %(created_datetime)s." - -#: cove_ocds/templates/cove_ocds/explore_release.html:22 -#, python-format -msgid "" -"structural checks against OCDS release package " -"schema version %(version_used_display)s." -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:38 -#, python-format -msgid "This file contains %(count)s release" -msgid_plural "This file contains %(count)s releases" -msgstr[0] "Este archivo contiene una entrega" -msgstr[1] "Este archivo contiene %(count)s entregas" -msgstr[2] "Este archivo contiene %(count)s entregas" - #: cove_ocds/templates/cove_ocds/input.html:6 msgid "Loading" msgstr "Cargando" @@ -986,18 +984,17 @@ msgstr "" "DDT00:00:00Z. Lea más sobre fechas en OCDS" -#: cove_ocds/util.py:19 cove_ocds/util.py:38 cove_ocds/util.py:56 -#: cove_ocds/views.py:98 +#: cove_ocds/util.py:18 cove_ocds/util.py:37 cove_ocds/util.py:55 +#: cove_ocds/views.py:97 msgid "Sorry, we can't process that data" msgstr "Lo sentimos, no podemos procesar esos datos" -#: cove_ocds/util.py:22 cove_ocds/util.py:41 cove_ocds/util.py:58 -#: cove_ocds/util.py:84 cove_ocds/util.py:107 cove_ocds/util.py:126 -#: cove_ocds/views.py:100 cove_ocds/views.py:135 +#: cove_ocds/util.py:21 cove_ocds/util.py:40 cove_ocds/util.py:57 +#: cove_ocds/util.py:79 cove_ocds/views.py:99 cove_ocds/views.py:130 msgid "Try Again" msgstr "Inténtelo de nuevo" -#: cove_ocds/util.py:25 +#: cove_ocds/util.py:24 msgid "" "The file that you uploaded doesn't appear to be well formed JSON. OCDS JSON " "follows the I-JSON format, which requires UTF-8 encoding. Ensure that your " @@ -1014,7 +1011,7 @@ msgstr "" " Mensaje del error: {}" -#: cove_ocds/util.py:44 +#: cove_ocds/util.py:43 msgid "" "We think you tried to upload a JSON file, but it is not well formed JSON.\n" "\n" @@ -1027,7 +1024,7 @@ msgstr "" " Mensaje del error: {}" -#: cove_ocds/util.py:59 +#: cove_ocds/util.py:58 msgid "" "OCDS JSON should have an object as the top level, the JSON you supplied does " "not." @@ -1035,11 +1032,11 @@ msgstr "" "OCDS JSON debe ser un objeto al nivel más alto pero el JSON que usted ha " "aportado no lo es." -#: cove_ocds/util.py:81 cove_ocds/util.py:82 +#: cove_ocds/util.py:76 cove_ocds/util.py:77 msgid "Missing OCDS package" msgstr "Paquete OCDS no encontrado" -#: cove_ocds/util.py:87 +#: cove_ocds/util.py:82 msgid "" "We could not detect a package structure at the top-level of your data. OCDS " "releases and records should be published within a Mensaje de error: Falta el paquete OCDS" -#: cove_ocds/util.py:104 -msgid "Unrecognised version of the schema" -msgstr "Versión del esquema no reconocida" - -#: cove_ocds/util.py:105 cove_ocds/util.py:124 -#, python-format -msgid "%(version)s is not a known schema version" -msgstr "%(version)s no es una versión conocida del esquema" - -#: cove_ocds/util.py:110 -msgid "" -"We think you tried to run your data against an unrecognised version of the " -"schema.\n" -"\n" -" Error message: {} is not a recognised choice " -"for the schema version" -msgstr "" - -#: cove_ocds/util.py:123 -msgid "Version format does not comply with the schema" -msgstr "El formato de la versión no se ajusta al esquema" - -#: cove_ocds/util.py:129 -msgid "" -"The value for the \"version\" field in your data follows the " -"major.minor.patch pattern but according to the schema the patch " -"digit shouldn't be included (e.g. \"1.1.0\" should appear as " -"\"1.1\" in your data as this tool always uses the latest patch " -"release for a major.minor version).\n" -"\n" -"Please get rid of the patch digit and try again.\n" -"\n" -" Error message: {} format does not comply " -"with the schema" -msgstr "" - -#: cove_ocds/util.py:143 -#, python-format -msgid "%(version)s (not a string)" -msgstr "" - -#: cove_ocds/views.py:104 +#: cove_ocds/views.py:103 msgid "" "The table isn't structured correctly. For example, a JSON Pointer " "(tender) can't be both a value (tender), a path to " @@ -1127,11 +1081,11 @@ msgstr "" " Error message: {}" -#: cove_ocds/views.py:133 +#: cove_ocds/views.py:128 msgid "JSON reference error" msgstr "Error de referencia en JSON" -#: cove_ocds/views.py:145 +#: cove_ocds/views.py:140 #, python-format msgid "%(error)s" msgstr "%(error)s" diff --git a/cove_ocds/templates/cove_ocds/explore_base.html b/cove_ocds/templates/cove_ocds/explore_base.html index ff10055c..3a2c18e4 100644 --- a/cove_ocds/templates/cove_ocds/explore_base.html +++ b/cove_ocds/templates/cove_ocds/explore_base.html @@ -1,5 +1,6 @@ {% extends 'explore.html' %} {% load i18n %} +{% load cove_tags %}{# subtract #} {% load cove_ocds %} {% block header_button %} {% trans 'Load New File' %} @@ -8,94 +9,133 @@ {% block explore_content %}
    -{% block key_facts %} -{% endblock %} - -{% block converted_files %} -
    -
    +
    +
    -

    {% trans "Schema" %}

    +

    {% trans 'Headlines' %}

    + {% if conversion_warning_messages %} +
    {% blocktrans %}Please read the conversion warnings below.{% endblocktrans %}
    + {% endif %} + +
    + + {% if validation_errors or additional_closed_codelist_values %} + {% if has_records %} + {% blocktrans %}Failed structural checks against OCDS record package schema version {{ version_used_display }}.{% endblocktrans %} + {% else %} + {% blocktrans %}Failed structural checks against OCDS release package schema version {{ version_used_display }}.{% endblocktrans %} + {% endif %} + {% else %} + {% if has_records %} + {% blocktrans %}Passed structural checks against OCDS record package schema version {{ version_used_display }}.{% endblocktrans %} + {% else %} + {% blocktrans %}Passed structural checks against OCDS release package schema version {{ version_used_display }}.{% endblocktrans %} + {% endif %} + {% endif %} + {% if validation_errors %} +
    + {% blocktrans %}See Structural Errors below.{% endblocktrans %} + {% endif %} +
    + {% if unrecognized_version_data %}
     {% blocktrans %}Your data specifies a version {{unrecognized_version_data}} which is not recognised. For that reason, it's been checked against the current default version.{% endblocktrans %}
    {% endif %} -

    {% blocktrans %}This data has been checked against OCDS {{ release_or_record }} package schema version {{ version_used_display }}.{% endblocktrans %} {% blocktrans %}You can choose a different version of the schema to check and explore your data.{% endblocktrans %}

    -
    - {% blocktrans %}Check and explore same data against a different version of the schema{% endblocktrans %} -
    - - {% blocktrans %}Switching the schema version will result in changes to CoVE output and conversions. If you revisit or share this URL, the latest version selected will be used to check your data{% endblocktrans %} + + {% if extensions and extensions.invalid_extension %} +
    + {% blocktrans count count=extensions.invalid_extension.keys|length %}Failed to apply {{count}} extension to the schema.{% plural %}Failed to apply {{count}} extensions to the schema.{% endblocktrans %}
    + {% blocktrans %}See Extensions below.{% endblocktrans %}
    -
    -
    -
    -
    - {% csrf_token %} - - {# Translators: Label of a button that triggers search #} - - -
    + {% endif %} + + {% if conversion %} +
    + {% blocktrans with size=converted_file_size|filesizeformat %}To validated your file, we converted it to JSON format ({{size}} download).{% endblocktrans %}
    -
    -
    -
    - -
    -
    -
    -

    - {% trans 'Submitted Files' %} -

    -
    - -
    -
    - {% if conversion_warning_messages %} -

    {% blocktrans %}There were conversion warnings when processing your file. The converted data may not represent your data as you want it to be.{% endblocktrans %}

    - {% endif %} - {% if conversion == 'unflatten' %} -

    {% blocktrans %}We have tried to convert your data into JSON format.{% endblocktrans %}

    {% blocktrans %}The results can be seen below.{% endblocktrans %}

    -
      -
    • - - - {% if file_type == 'xlsx' %} - {{xlsx}} ({{original}}) - {% elif file_type == 'csv' %} - {{csv}} ({{original}}) - {% endif %} - - {{original_file.size|filesizeformat }} + {% endif %} + +
      + {% trans "At a glance" %} +
        + {% if count %} +
      • + {% if has_records %} + {% blocktrans count count=count %}This file contains {{count}} record{% plural %}This file contains {{count}} records{% endblocktrans %} + {% else %} + {% blocktrans count count=count %}This file contains {{count}} release{% plural %}This file contains {{count}} releases{% endblocktrans %} + {% endif %} + {% blocktrans count count=unique_ocids_count %} describing {{count}} contracting process{% plural %} describing {{count}} contracting processes.{% endblocktrans %} +
      • + {% endif %} + + {% if data_schema_version %} +
      • + {% blocktrans %}The schema version specified in the file is {{data_schema_version}}.{% endblocktrans %}
      • -
      • - {{JSON}} ({{converted}} {% trans "using schema version" %} {{version_used_display}}) {{converted_file_size|filesizeformat }} + {% endif %} + + {% if json_data.publisher %} +
      • + {% blocktrans %}The publisher named in the file is {{json_data.publisher.name}}.{% endblocktrans %}
      • -
      - {% else %} -
        -
      • - {{JSON}} ({{original}}) {{original_file.size|filesizeformat }} + {% endif %} + + {% if json_data.license %} +
      • + {% blocktrans %}The license is {{json_data.license}}.{% endblocktrans %} +
      • + {% endif %} + + {% if json_data.publicationPolicy %} +
      • + {% blocktrans %}Publication policy is {{json_data.publicationPolicy}}.{% endblocktrans %} +
      • + {% endif %} + + {% if extensions and extensions.is_extended_schema %} +
      • + {% with n_invalid=extensions.invalid_extension.keys|length %} + {% blocktrans count count=extensions.extensions.keys|length|subtract:n_invalid %}This file applies {{count}} valid extension to the schema.{% plural %}This file applies {{count}} valid extensions to the schema.{% endblocktrans %} + {% endwith %} +
      • + {% endif %} + + {% if data_only %} +
      • + {% blocktrans count count=data_only|length %}This file uses {{count}} additional field not used in the standard.{% plural %}This file uses {{count}} additional fields not used in the standard.{% endblocktrans %} +
      • + {% endif %} + + {% if csv_encoding and csv_encoding != "utf-8-sig" %} +
      • + {% blocktrans %}This file is not 'utf-8' encoded (it is {{csv_encoding}} encoded).{% endblocktrans %} +
      • + {% endif %} + + {% if deprecated_fields %} +
      • + {% blocktrans count count=deprecated_fields|length %}This file uses {{count}} deprecated field.{% plural %} This file uses {{count}} deprecated fields.{% endblocktrans %}
      • -
      - {% endif %} + {% endif %} + +
    • + {% if source_url %} + {% blocktrans with url=original_file.url size=original_file.size|filesizeformat %}Data downloaded ({{size}} cached) from {{ source_url }} on {{ created_datetime }}.{% endblocktrans %} + {% else %} + {% blocktrans with url=original_file.url size=original_file.size|filesizeformat %}Data uploaded ({{size}} cached) on {{ created_datetime }}.{% endblocktrans %} + {% endif %}
      +
    • +
    -{% endblock %} - -
    +
    {% if extensions %} {% with ext=extensions.extensions ext_errors=extensions.invalid_extension %} @@ -106,11 +146,6 @@

    - {% if extensions and version_used_display == "1.0" %} -
    -  {% blocktrans %}Your data has been checked against schema version 1.0 and includes extensions but extensions were not introduced in the schema until version 1.1.{% endblocktrans %} -
    - {% endif %}

    {% blocktrans %}Your data contains the following schema extensions{% endblocktrans %}{% if not extensions.is_extended_schema %}{% blocktrans %}, but it wasn't possible to fetch them{% endblocktrans %}{% endif %}:

    +
    +
    +
    +
    + +
    +
    +
    + {% block header_button %}{% endblock header_button %} +
    +
    +
    + +
    + {% block content %}{% endblock %} +
    + +
    + {% block bottomcontent1 %}{% endblock %} + {% block bottomcontent2 %}{% endblock %} +
    + + +{% bootstrap_javascript %} +{% block extrafooterscript %}{% endblock %} + + + diff --git a/cove_ocds/templates/cove_ocds/additional_checks_table.html b/cove_ocds/templates/cove_ocds/additional_checks_table.html deleted file mode 100644 index fed64f0c..00000000 --- a/cove_ocds/templates/cove_ocds/additional_checks_table.html +++ /dev/null @@ -1,34 +0,0 @@ -{% load i18n %} -{% load cove_ocds %} - - - - - - - - - - {% for type, values in additional_checks.items %} - {% if type == 'empty_field' %} - - - - - {% endif %} - {% endfor %} - -
    {% trans 'Check Description' %}{% trans 'Location of first 3 errors' %}
    {% trans 'The data includes fields that are empty or contain only whitespaces. Fields that are not being used, or that have no value, should be excluded in their entirety (key and value) from the data' %} -
      - {% for value in values|dictsort:"json_location"|slice:":3" %} -
    • {{ value.json_location }}
    • - {% endfor %} - {% if values|length > 3 %} -
    • {% trans "see all" %}
    • - {% endif %} -
    -
    - -{% for type, values in additional_checks.items %} - {% cove_modal_errors className="additional-checks-"|concat:forloop.counter modalTitle="" errorList=values|dictsort:"json_location"|list_from_attribute:"json_location" file_type=file_type full_table=False %} -{% endfor %} diff --git a/cove_ocds/templates/cove_ocds/base.html b/cove_ocds/templates/cove_ocds/base.html deleted file mode 100644 index cbaa7827..00000000 --- a/cove_ocds/templates/cove_ocds/base.html +++ /dev/null @@ -1,155 +0,0 @@ -{% extends 'base.html' %} -{% load i18n %} -{% load static %} - -{% block after_head %} - - - - - {% include "cove_ocds/fathom.html" %} - {% include "cove_ocds/hotjar.html" %} -{% endblock %} - -{% block banner %} -{% endblock %} - -{% block page_header %} -{% endblock %} - -{% block full_width_header %} -{% include 'cove_ocds/ocds_svg.html' %} - -
    -
    - -
    -
    - -
    -
    -
    - {% block header_button %}{% endblock header_button %} -
    -
    -
    - -{% endblock %} - -{% block bootstrap_css %} - - -{% endblock %} - -{% block link %} -
  • {% trans "Open Contracting" %}
  • -
  • {% trans "Open Contracting Data Standard" %}
  • -
  • {% trans "Support" %}
  • -{% endblock %} - -{% block bottomcontent1 %} -
    -
    -
    -
    - -

    {% blocktrans %}About OCDS {%endblocktrans%}

    -

    {% blocktrans %}The Open Contracting Data Standard (OCDS) exists to formalize how contracting data and documents can be published in an accessible, structured and repeatable way.{%endblocktrans%}

    -

    {% blocktrans %}Governments around the world spend an estimated US$9.5 trillion through contracts every year. Yet, contracting information is often unavailable for public scrutiny. OCDS works to change that.{%endblocktrans%}

    -
    -
    -
    -
    -
    -
    - -

    {% blocktrans %}Check and Review{%endblocktrans%}

    -

    {% blocktrans %}This tool helps you to:{%endblocktrans%}

    -
      -
    • {% blocktrans %}Check that your OCDS data complies with the schema{%endblocktrans%}
    • -
    • {% blocktrans %}Inspect key contents of your data to review data quality{%endblocktrans%}
    • -
    • {% blocktrans %}Access your data in different formats (spreadsheet and JSON) to support further review.{%endblocktrans%}
    • -
    -
    -
    -
    -
    -
    -{% endblock %} - -{% block bottomcontent2 %} -{% url 'index' as index_url %} -
    -
    -
    -
    - -

    {% blocktrans %}Using the data review tool{%endblocktrans%}

    -

    {% blocktrans %}You can upload, paste or provide a link to data published using the Open Contracting Data Standard. This can be:{%endblocktrans%}

    - -
      -
    • {% blocktrans %} JSON - following the OCDS schema; {%endblocktrans%}
    • -
    • {% blocktrans %} A CSV file or Excel Spreadsheet - using the flattened serialization of OCDS; {%endblocktrans%}
    • -
    -

    {% blocktrans %}Supported encodings are UTF-8 for JSON and UTF-8, Windows-1252 and ISO-8859-1 for CSV.{% endblocktrans%}

    -

    {% blocktrans %}The application works with both 'release' and 'record' OCDS documents that conform to the Open Data Contracting Standard {%endblocktrans%}

    -

    {% blocktrans %}If your data passes basic structural checks, the tool will then present a report on data quality, and information about the contents of your file. It will also offer alternative copies of the data for download. {%endblocktrans%}

    -

    {% blocktrans %}Data is stored for {{ delete_files_after_days }} days at a randomly generated URL. You can share this link with others to support discussion of data quality. {%endblocktrans%}

    -

    {% blocktrans %}To preview how the data review tool works, try loading: https://raw.githubusercontent.com/open-contracting/sample-data/main/fictional-example/1.1/ocds-213czf-000-00001-02-tender.json{% endblocktrans%}

    -
    -
    -
    -
    - -{% endblock %} - -{% block about %} -
  • {% trans "Built by" %} {% trans "Open Data Services" %}
  • -
  • {% trans "The code for this site is available on" %}
    {% trans "GitHub" %}: cove-ocds
    {% trans "Licence" %}: {% trans "AGPLv3" %}
    {% trans "Report/View issues" %}: {% trans "cove-ocds issues" %} -
  • -{% endblock %} - -{% block version_link %} -{% endblock %} diff --git a/cove_ocds/templates/cove_ocds/deprecated_fields_table.html b/cove_ocds/templates/cove_ocds/deprecated_fields_table.html deleted file mode 100644 index 93ad9c48..00000000 --- a/cove_ocds/templates/cove_ocds/deprecated_fields_table.html +++ /dev/null @@ -1,31 +0,0 @@ -{% load i18n %} -{% load cove_ocds %} - - - - - - - - - - - - {% get_current_language as LANGUAGE_CODE %} - - - - {% for field, details in deprecated_fields.items %} - - - {% blocktrans with version=details.explanation.0 description=details.explanation.1 %} - - {% endblocktrans %} - - - - {% endfor %} - -
    {% trans "Field" %}{% trans "Details" %}{% trans "Path to Field" %}{% trans "Usage Count" %}
    - {% trans "Learn more about deprecated fields" %} -
    {{field}}Deprecated in {{version}}: {{description}}{% for path in details.paths %}

    {{path}}

    {% endfor %}
    {{details.paths|length}}
    diff --git a/cove_ocds/templates/cove_ocds/fathom.html b/cove_ocds/templates/cove_ocds/fathom.html deleted file mode 100644 index f192266c..00000000 --- a/cove_ocds/templates/cove_ocds/fathom.html +++ /dev/null @@ -1,3 +0,0 @@ -{% if fathom.id %} - -{% endif %} diff --git a/cove_ocds/templates/cove_ocds/hotjar.html b/cove_ocds/templates/cove_ocds/hotjar.html deleted file mode 100644 index 364f67e0..00000000 --- a/cove_ocds/templates/cove_ocds/hotjar.html +++ /dev/null @@ -1,12 +0,0 @@ -{% if hotjar.id %} - -{% endif %} diff --git a/cove_ocds/templates/cove_ocds/input.html b/cove_ocds/templates/cove_ocds/input.html deleted file mode 100644 index fcf376ab..00000000 --- a/cove_ocds/templates/cove_ocds/input.html +++ /dev/null @@ -1,96 +0,0 @@ -{% extends 'input.html' %} -{% load bootstrap3 %} -{% load i18n %} - -{% block content %} - -
    - {% if 'url' in input_methods %} -
    - -
    -
    -
    {% csrf_token %} - {% bootstrap_form forms.url_form %} - {% buttons %} - - {% endbuttons %} -
    -
    -
    -
    - {% endif %} - {% if 'upload' in input_methods %} -
    - -
    -
    -
    {% csrf_token %} - {% bootstrap_form forms.upload_form %} - {% buttons %} - - {% endbuttons %} -
    -
    -
    -
    - {% endif %} - {% if 'text' in input_methods %} -
    - -
    -
    -
    {% csrf_token %} - {% bootstrap_form forms.text_form %} - {% buttons %} - - {% endbuttons %} -
    -
    -
    - {% endif %} -
    -
    -{% endblock %} - -{% block extrafooterscript %} - -{% endblock %} diff --git a/cove_ocds/templates/cove_ocds/ocds_missing_ids_table.html b/cove_ocds/templates/cove_ocds/ocds_missing_ids_table.html deleted file mode 100644 index 4f4c8435..00000000 --- a/cove_ocds/templates/cove_ocds/ocds_missing_ids_table.html +++ /dev/null @@ -1,17 +0,0 @@ -{% load i18n %} -{% load cove_ocds %} -

    {% blocktrans count n_missing=structure_warnings.missing_ids|length %} We found {{n_missing}} object within an array in your data without an id property. - {% plural %}We found {{n_missing}} objects within arrays in your data without an id property.{% endblocktrans %} - {% blocktrans %} This may affect the creation of OCDS records, and conversion of data into other formats. We recommend that all objects within an array should have an id set.{% endblocktrans %} - -

    -
    - - - -{% for path in structure_warnings.missing_ids %} - -{% endfor %} - -
    {% trans "Path to missing ID" %}
    {{path}}
    -
    diff --git a/cove_ocds/templates/cove_ocds/ocds_svg.html b/cove_ocds/templates/cove_ocds/ocds_svg.html deleted file mode 100644 index 9c2b832f..00000000 --- a/cove_ocds/templates/cove_ocds/ocds_svg.html +++ /dev/null @@ -1,3 +0,0 @@ -
    - -
    diff --git a/cove_ocds/templates/cove_ocds/ocid_prefixes_table.html b/cove_ocds/templates/cove_ocds/ocid_prefixes_table.html deleted file mode 100644 index 4432566b..00000000 --- a/cove_ocds/templates/cove_ocds/ocid_prefixes_table.html +++ /dev/null @@ -1,17 +0,0 @@ -{% load i18n %} -{% load cove_ocds %} -

    - {% blocktrans count n_prefixes=conformance_errors.ocds_prefixes_bad_format|length %}{{n_prefixes}} of your ocid fields has a problem: {% plural %}{{n_prefixes}} of your ocid fields have a problem: {% endblocktrans %}{% trans "there is no prefix or the prefix format is not recognised." %} - -

    -
    - - - -{% for ocid, path in conformance_errors.ocds_prefixes_bad_format %} - -{% endfor %} - -
    {% trans "ocid" %}{% trans "Path" %}
    {{ocid}}{{path}}
    -
    -

    {% blocktrans with description=conformance_errors.ocid_description %} What is the ocid field? {{description}} {% endblocktrans %}
    {% trans "For more information see" %} {% trans "Open Contracting Identifier guidance" %}

    diff --git a/cove_ocds/templates/error.html b/cove_ocds/templates/error.html new file mode 100644 index 00000000..d606cfd3 --- /dev/null +++ b/cove_ocds/templates/error.html @@ -0,0 +1,20 @@ +{% extends "base.html" %} +{% load i18n %} + +{% block content %} +
    +
    + + {{ heading }} +
    +
    + {{ message | linebreaks }} + +

    {% blocktrans %}If you think this is a bug, you can file an issue publicly on GitHub or {% endblocktrans %}{% trans "get in touch via email" %}{% if request.sentry.id %}, {% blocktrans %}referencing this error as {% endblocktrans %}{{ request.sentry.id }}{% endif %}. +

    +
    + + +{% endblock %} diff --git a/cove_ocds/templates/cove_ocds/explore_base.html b/cove_ocds/templates/explore.html similarity index 72% rename from cove_ocds/templates/cove_ocds/explore_base.html rename to cove_ocds/templates/explore.html index 3a2c18e4..afde0c8b 100644 --- a/cove_ocds/templates/cove_ocds/explore_base.html +++ b/cove_ocds/templates/explore.html @@ -1,12 +1,12 @@ -{% extends 'explore.html' %} +{% extends "base.html" %} {% load i18n %} -{% load cove_tags %}{# subtract #} {% load cove_ocds %} + {% block header_button %} {% trans 'Load New File' %} {% endblock %} -{% block explore_content %} +{% block content %}
    @@ -81,19 +81,19 @@

    {% trans 'Headlines' %}

    {% if json_data.publisher %}
  • - {% blocktrans %}The publisher named in the file is {{json_data.publisher.name}}.{% endblocktrans %} + {% blocktrans with value=json_data.publisher.name %}The publisher named in the file is {{value}}.{% endblocktrans %}
  • {% endif %} {% if json_data.license %}
  • - {% blocktrans %}The license is {{json_data.license}}.{% endblocktrans %} + {% blocktrans with value=json_data.license %}The license is {{value}}.{% endblocktrans %}
  • {% endif %} {% if json_data.publicationPolicy %}
  • - {% blocktrans %}Publication policy is {{json_data.publicationPolicy}}.{% endblocktrans %} + {% blocktrans with value=json_data.publicationPolicy %}Publication policy is {{value}}.{% endblocktrans %}
  • {% endif %} @@ -125,9 +125,9 @@

    {% trans 'Headlines' %}

  • {% if source_url %} - {% blocktrans with url=original_file.url size=original_file.size|filesizeformat %}Data downloaded ({{size}} cached) from {{ source_url }} on {{ created_datetime }}.{% endblocktrans %} + {% blocktrans with size=original_file_size|filesizeformat %}Data downloaded ({{size}} cached) from {{ source_url }} on {{ created_datetime }}.{% endblocktrans %} {% else %} - {% blocktrans with url=original_file.url size=original_file.size|filesizeformat %}Data uploaded ({{size}} cached) on {{ created_datetime }}.{% endblocktrans %} + {% blocktrans with size=original_file_size|filesizeformat %}Data uploaded ({{size}} cached) on {{ created_datetime }}.{% endblocktrans %} {% endif %}
  • @@ -153,7 +153,7 @@

  • {{ ext_details.name }} {% if ext_details.schema_url %}  ({% trans "release schema" %}) - {% endif %} + {% endif %}   

    {{ ext_details.description }}

    {% if ext_details.failed_codelists %}

      @@ -232,7 +232,7 @@

  • {% blocktrans %}Some or all of your data is missing fields which are required by the OCDS schema.{% endblocktrans %} - {% include "cove_ocds/validation_table.html" %} + {% include "validation_table.html" %}
    @@ -256,7 +256,7 @@

    {% blocktrans %}Some or all of your data includes fields which are incorrectly formatted.{% endblocktrans %} - {% include "cove_ocds/validation_table.html" %} + {% include "validation_table.html" %}
    @@ -280,7 +280,7 @@

    {% blocktrans %}Some or all of your data has validation errors.{% endblocktrans %} - {% include "cove_ocds/validation_table.html" %} + {% include "validation_table.html" %}
    @@ -301,7 +301,23 @@


    {% with structure_warnings=structure_warnings %} {% if structure_warnings.missing_ids %} - {% include "cove_ocds/ocds_missing_ids_table.html" %} + +

    {% blocktrans count n_missing=structure_warnings.missing_ids|length %} We found {{n_missing}} object within an array in your data without an id property. + {% plural %}We found {{n_missing}} objects within arrays in your data without an id property.{% endblocktrans %} + {% blocktrans %} This may affect the creation of OCDS records, and conversion of data into other formats. We recommend that all objects within an array should have an id set.{% endblocktrans %} + +

    +
    + + + + {% for path in structure_warnings.missing_ids %} + + {% endfor %} + +
    {% trans "Path to missing ID" %}
    {{path}}
    +
    + {% endif %} {% endwith %}

    @@ -323,7 +339,23 @@


    {% with conformance_errors=conformance_errors %} {% if conformance_errors.ocds_prefixes_bad_format %} - {% include "cove_ocds/ocid_prefixes_table.html" %} + +

    + {% blocktrans count n_prefixes=conformance_errors.ocds_prefixes_bad_format|length %}{{n_prefixes}} of your ocid fields has a problem: {% plural %}{{n_prefixes}} of your ocid fields have a problem: {% endblocktrans %}{% trans "there is no prefix or the prefix format is not recognised." %} + +

    +
    + + + + {% for ocid, path in conformance_errors.ocds_prefixes_bad_format %} + + {% endfor %} + +
    {% trans "ocid" %}{% trans "Path" %}
    {{ocid}}{{path}}
    +
    +

    {% blocktrans with description=conformance_errors.ocid_description %} What is the ocid field? {{description}} {% endblocktrans %}
    {% trans "For more information see" %} {% trans "Open Contracting Identifier guidance" %}

    + {% endif %} {% endwith %}

    @@ -362,7 +394,84 @@

    {% blocktrans %}This data includes the following fields which are not part of the OCDS schema. You should check whether the data in these fields could be provided by using a field in the OCDS schema or by using an existing extension to the schema.{% endblocktrans %}

    - {% include "additional_fields_table_all.html" %} + + + + + + + + + + + + + {% for full_path, info in additional_fields.items %} + {% if info.root_additional_field %} + + + + + + + + {% endif %} + {% endfor %} + +
    {% trans 'Field' %} {% trans 'Path to Field' %} {% trans 'Usage Count' %} {% trans 'Examples (first 3)' %} {% trans 'Child Fields' %}
    {{info.field_name}}{{info.path}}{{info.count}} + {% for example in info.examples %} + {{example}}
    + {% endfor %} +
    + {% if info.additional_field_descendance %} + {{info.additional_field_descendance|length}} + {% trans "(See child fields)" %} + {% endif %} +
    + + + {% for parent_full_path, parent_info in additional_fields.items %} + {% if parent_info.root_additional_field and parent_info.additional_field_descendance %} + + {% endif %} + {% endfor %} +
    @@ -398,7 +507,39 @@

    - {% include "cove_ocds/additional_checks_table.html" %} + + + + + + + + + + {% for type, values in additional_checks.items %} + {% if type == 'empty_field' %} + + + + + {% endif %} + {% endfor %} + +
    {% trans 'Check Description' %}{% trans 'Location of first 3 errors' %}
    {% trans 'The data includes fields that are empty or contain only whitespaces. Fields that are not being used, or that have no value, should be excluded in their entirety (key and value) from the data' %} +
      + {% for value in values|dictsort:"json_location"|slice:":3" %} +
    • {{ value.json_location }}
    • + {% endfor %} + {% if values|length > 3 %} +
    • {% trans "see all" %}
    • + {% endif %} +
    +
    + + {% for type, values in additional_checks.items %} + {% cove_modal_errors className="additional-checks-"|concat:forloop.counter modalTitle="" errorList=values|dictsort:"json_location"|list_from_attribute:"json_location" file_type=file_type full_table=False %} + {% endfor %} +
    {% endif %} @@ -412,10 +553,39 @@

    - {% include "cove_ocds/deprecated_fields_table.html" %} + + + + + + + + + + + + {% get_current_language as LANGUAGE_CODE %} + + + + {% for field, details in deprecated_fields.items %} + + + {% blocktrans with version=details.explanation.0 description=details.explanation.1 %} + + {% endblocktrans %} + + + + {% endfor %} + +
    {% trans "Field" %}{% trans "Details" %}{% trans "Path to Field" %}{% trans "Usage Count" %}
    + {% trans "Learn more about deprecated fields" %} +
    {{field}}Deprecated in {{version}}: {{description}}{% for path in details.paths %}

    {{path}}

    {% endfor %}
    {{details.paths|length}}
    +
    - + {% endif %} @@ -429,21 +599,13 @@

    {% trans "Save or Share these results" %}

    {{ current_url }}
    - {% comment %}Translators: Paragraph that describes the application{% endcomment %}

    {% blocktrans %}These results will be available for {{ delete_files_after_days }} days from the day the data was first uploaded. You can revisit these results until then.{% endblocktrans %}

    {% blocktrans %}After {{ delete_files_after_days }} days all uploaded data is deleted from our servers, and the results will no longer be available. Anyone using the link to this page after that will be shown a message that tells them the file has been removed.{% endblocktrans %}

    - -{% endblock explore_content %} - -{% block bottomcontent1 %} -{% endblock %} -{% block bottomcontent2 %} -{% endblock %} - +{% endblock content %} {% block extrafooterscript %} - {{ block.super }} + {{ block.super }} +{% endblock %} diff --git a/cove_ocds/templates/modal_errors.html b/cove_ocds/templates/modal_errors.html new file mode 100644 index 00000000..4ea8a41e --- /dev/null +++ b/cove_ocds/templates/modal_errors.html @@ -0,0 +1,68 @@ +{% load i18n %} +{% load cove_ocds %} + diff --git a/cove_ocds/templates/cove_ocds/validation_table.html b/cove_ocds/templates/validation_table.html similarity index 100% rename from cove_ocds/templates/cove_ocds/validation_table.html rename to cove_ocds/templates/validation_table.html diff --git a/cove_ocds/templatetags/cove_ocds.py b/cove_ocds/templatetags/cove_ocds.py index cb6daf09..c0140f09 100644 --- a/cove_ocds/templatetags/cove_ocds.py +++ b/cove_ocds/templatetags/cove_ocds.py @@ -1,8 +1,14 @@ -from cove.html_error_msg import html_error_msg, json_repr -from cove.templatetags.cove_tags import register # as such, `load cove_ocds` implicitly calls `load cove_tags` +import json + +from django import template +from django.conf import settings from django.utils.html import mark_safe from django.utils.translation import gettext as _ +from cove_ocds.html_error_msg import html_error_msg, json_repr + +register = template.Library() + @register.filter(name="html_error_msg") def html_error_msg_ocds(error): @@ -32,3 +38,37 @@ def html_error_msg_ocds(error): ) return html_error_msg(error) + + +# https://github.com/OpenDataServices/lib-cove-web/blob/main/cove/templatetags/cove_tags.py + + +@register.inclusion_tag("modal_errors.html") +def cove_modal_errors(**context): + context["validation_error_locations_length"] = settings.VALIDATION_ERROR_LOCATIONS_LENGTH + return context + + +@register.filter +def json_decode(error_json): + return json.loads(error_json) + + +@register.filter +def concat(arg1, arg2): + return str(arg1) + str(arg2) + + +@register.filter +def subtract(value, arg): + return value - arg + + +@register.filter +def take_or_sample(population, k): + return population[:k] + + +@register.filter +def list_from_attribute(list_of_dicts, key_name): + return [value[key_name] for value in list_of_dicts] diff --git a/cove_ocds/util.py b/cove_ocds/util.py index b5b1794a..5190f5ad 100644 --- a/cove_ocds/util.py +++ b/cove_ocds/util.py @@ -1,100 +1,17 @@ import json from decimal import Decimal -from django.utils.html import format_html, mark_safe -from django.utils.translation import gettext as _ -from libcove.lib.exceptions import CoveInputDataError from libcoveocds.schema import SchemaOCDS -def read_json(path): - # Read as text, because the json module can read binary UTF-16 and UTF-32. - with open(path, encoding="utf-8") as f: - try: - data = json.load(f) - except UnicodeError as err: - raise CoveInputDataError( - context={ - "sub_title": _("Sorry, we can't process that data"), - "error": format(err), - "link": "index", - "link_text": _("Try Again"), - "msg": format_html( - _( - "The file that you uploaded doesn't appear to be well formed JSON. OCDS JSON follows the " - "I-JSON format, which requires UTF-8 encoding. Ensure that your file uses UTF-8 encoding, " - "then try uploading again.\n\n" - ' ' - "Error message: {}" - ), - err, - ), - } - ) from None - except ValueError as err: - raise CoveInputDataError( - context={ - "sub_title": _("Sorry, we can't process that data"), - "error": format(err), - "link": "index", - "link_text": _("Try Again"), - "msg": format_html( - _( - "We think you tried to upload a JSON file, but it is not well formed JSON.\n\n" - ' ' - "Error message: {}" - ), - err, - ), - } - ) from None - - if not isinstance(data, dict): - raise CoveInputDataError( - context={ - "sub_title": _("Sorry, we can't process that data"), - "link": "index", - "link_text": _("Try Again"), - "msg": _("OCDS JSON should have an object as the top level, the JSON you supplied does not."), - } - ) - - return data - - def get_schema(lib_cove_ocds_config, package_data): - schema_ocds = SchemaOCDS( + return SchemaOCDS( select_version=lib_cove_ocds_config.config["schema_version"], package_data=package_data, lib_cove_ocds_config=lib_cove_ocds_config, record_pkg="records" in package_data, ) - if schema_ocds.missing_package: - raise CoveInputDataError( - context={ - "sub_title": _("Missing OCDS package"), - "error": _("Missing OCDS package"), - "link": "index", - "link_text": _("Try Again"), - "msg": mark_safe( - _( - "We could not detect a package structure at the top-level of your data. OCDS releases and " - 'records should be published within a release package or record package to provide important meta-data. ' - 'For more information, please refer to the Releases and Records section in the OCDS ' - "documentation.\n\n" - ' ' - "Error message: Missing OCDS package" - ) - ), - } - ) - - return schema_ocds - def default(obj): if isinstance(obj, Decimal): diff --git a/cove_ocds/views.py b/cove_ocds/views.py index da50d540..37bf45e5 100644 --- a/cove_ocds/views.py +++ b/cove_ocds/views.py @@ -3,32 +3,160 @@ import re import warnings from collections import defaultdict +from http import HTTPStatus -from cove.views import cove_web_input_error, explore_data_context +import requests from django.conf import settings -from django.shortcuts import render +from django.core.exceptions import ValidationError +from django.core.files.base import ContentFile +from django.shortcuts import redirect, render from django.utils import translation -from django.utils.html import format_html +from django.utils.html import format_html, mark_safe from django.utils.translation import gettext as _ +from django.views.decorators.csrf import csrf_protect from flattentool.exceptions import FlattenToolValueError, FlattenToolWarning from libcove.lib.common import get_spreadsheet_meta_data from libcove.lib.converters import convert_spreadsheet -from libcove.lib.exceptions import CoveInputDataError +from libcove.lib.exceptions import UnrecognisedFileType +from libcove.lib.tools import get_file_type from libcoveocds.common_checks import common_checks_ocds from libcoveocds.config import LibCoveOCDSConfig from libcoveocds.schema import SchemaOCDS -from cove_ocds import util +from cove_ocds import forms, models, util +from cove_ocds.exceptions import InputError logger = logging.getLogger(__name__) -MAXIMUM_RELEASES_OR_RECORDS = 100 -@cove_web_input_error +default_form_classes = { + "upload_form": forms.UploadForm, + "url_form": forms.UrlForm, + "text_form": forms.TextForm, +} + + +@csrf_protect +def data_input(request, form_classes=default_form_classes, text_file_name="test.json"): + forms = {form_name: form_class() for form_name, form_class in form_classes.items()} + request_data = None + if "source_url" in request.GET and settings.COVE_CONFIG.get("allow_direct_web_fetch", False): + request_data = request.GET + if request.POST: + request_data = request.POST + if request_data: + if "source_url" in request_data: + form_name = "url_form" + elif "paste" in request_data: + form_name = "text_form" + else: + form_name = "upload_form" + form = form_classes[form_name](request_data, request.FILES) + forms[form_name] = form + if form.is_valid(): + data = models.SuppliedData() if form_name == "text_form" else form.save(commit=False) + data.form_name = form_name + + try: + # We don't want to store large chunks of pasted data that might be in the request data. + if "paste" not in request_data: + data.parameters = json.dumps(request_data) + except TypeError: + pass + + data.save() + if form_name == "url_form": + try: + data.download() + except requests.exceptions.InvalidURL as err: + raise InputError( + status=HTTPStatus.UNPROCESSABLE_ENTITY, + heading=_("The provided URL is invalid"), + message=str(err), + ) from None + except requests.Timeout as err: + raise InputError( + status=HTTPStatus.GATEWAY_TIMEOUT, + heading=_("The provided URL timed out after %(timeout)s seconds") % settings.REQUESTS_TIMEOUT, + message=str(err), + ) from None + except requests.ConnectionError as err: + raise InputError( + status=HTTPStatus.GATEWAY_TIMEOUT, + heading=_("The provided URL did not respond"), + message=f"{err}\n\n" + + _( + "Check that your URL is accepting web requests: that is, it is not on localhost, is not " + "in an intranet, does not have SSL/TLS errors, and does not block user agents." + ), + ) from None + except requests.HTTPError as err: + raise InputError( + status=HTTPStatus.BAD_GATEWAY, + heading=_("The provided URL responded with an error"), + message=f"{err}\n\n" + + _( + "Check that your URL is responding to web requests: that is, it does not require " + "authentication, and does not block user agents." + ), + ) from None + elif form_name == "text_form": + data.original_file.save(text_file_name, ContentFile(form["paste"].value())) + return redirect(data.get_absolute_url()) + + return render(request, "input.html", {"forms": forms}) + + def explore_ocds(request, pk): - context, supplied_data, error = explore_data_context(request, pk) - if error: - return error + try: + supplied_data = models.SuppliedData.objects.get(pk=pk) + except ( + models.SuppliedData.DoesNotExist, + ValidationError, + ): # Catches primary key does not exist and badly formed UUID + raise InputError( + status=HTTPStatus.NOT_FOUND, + heading=_("Sorry, the page you are looking for is not available"), + message=_("We don't seem to be able to find the data you requested."), + ) from None + + try: + if supplied_data.original_file.path.endswith("validation_errors-3.json"): + raise InputError( + status=HTTPStatus.UNPROCESSABLE_ENTITY, + heading=_("You are not allowed to upload a file with this name."), + message=_("Rename the file or change the URL and try again."), + ) from None + + try: + file_type = get_file_type(supplied_data.original_file) + except UnrecognisedFileType: + raise InputError( + status=HTTPStatus.UNPROCESSABLE_ENTITY, + heading=_("Sorry, we can't process that data"), + message=_("We did not recognise the file type.\n\nWe can only process json, csv, ods and xlsx files."), + ) from None + + context = { + "original_file_url": supplied_data.original_file.url, + "original_file_size": supplied_data.original_file.size, + "file_type": file_type, + "current_url": request.build_absolute_uri(), + "source_url": supplied_data.source_url, + "created_datetime": supplied_data.created.strftime("%A, %d %B %Y %I:%M%p %Z"), + "support_email": settings.SUPPORT_EMAIL, + } + except FileNotFoundError: + raise InputError( + status=HTTPStatus.NOT_FOUND, + heading=_("Sorry, the page you are looking for is not available"), + message=_( + "The data you were hoping to explore no longer exists.\n\nThis is because all " + "data supplied to this website is automatically deleted after %s days, and therefore " + "the analysis of that data is no longer available." + ) + % getattr(settings, "DELETE_FILES_AFTER_DAYS", 7), + ) from None # Initialize the CoVE configuration. @@ -43,23 +171,71 @@ def explore_ocds(request, pk): # Read the supplied data. if context["file_type"] == "json": - package_data = util.read_json(supplied_data.original_file.path) + # Read as text, because the json module can read binary UTF-16 and UTF-32. + with open(supplied_data.original_file.path, encoding="utf-8") as f: + try: + package_data = json.load(f) + except UnicodeError as err: + raise InputError( + status=HTTPStatus.UNPROCESSABLE_ENTITY, + heading=_("Sorry, we can't process that data"), + message=format_html( + _( + "The file that you uploaded doesn't appear to be well formed JSON. OCDS JSON follows the " + "I-JSON format, which requires UTF-8 encoding. Ensure that your file uses UTF-8 encoding, " + "then try uploading again.\n\n" + ' ' + "Error message: {}" + ), + err, + ), + ) from None + except ValueError as err: + raise InputError( + status=HTTPStatus.UNPROCESSABLE_ENTITY, + heading=_("Sorry, we can't process that data"), + message=format_html( + _( + "We think you tried to upload a JSON file, but it is not well formed JSON.\n\n" + ' ' + "Error message: {}" + ), + err, + ), + ) from None + + if not isinstance(package_data, dict): + raise InputError( + status=HTTPStatus.UNPROCESSABLE_ENTITY, + heading=_("Sorry, we can't process that data"), + message=_("OCDS JSON should have an object as the top level, the JSON you supplied does not."), + ) from None schema_ocds = util.get_schema(lib_cove_ocds_config, package_data) else: with warnings.catch_warnings(): warnings.filterwarnings("ignore", category=FlattenToolWarning) - meta_data = get_spreadsheet_meta_data( - supplied_data.upload_dir(), - supplied_data.original_file.path, - SchemaOCDS(select_version="1.1", lib_cove_ocds_config=lib_cove_ocds_config).pkg_schema_url, - context["file_type"], - ) + try: + meta_data = get_spreadsheet_meta_data( + supplied_data.upload_dir(), + supplied_data.original_file.path, + SchemaOCDS(select_version="1.1", lib_cove_ocds_config=lib_cove_ocds_config).pkg_schema_url, + context["file_type"], + ) + except Exception as err: + logger.exception("", extra={"request": request}) + raise InputError( + status=HTTPStatus.UNPROCESSABLE_ENTITY, + heading=_("Sorry, we can't process that data"), + message=_( + "We think you tried to supply a spreadsheet, but we failed to convert it." + "\n\nError message: %(error)r" + ) + % {"error": err}, + ) from None meta_data.setdefault("version", "1.1") - # Make "missing_package" pass. - meta_data["releases"] = {} schema_ocds = util.get_schema(lib_cove_ocds_config, meta_data) @@ -92,54 +268,73 @@ def explore_ocds(request, pk): ) ) except FlattenToolValueError as err: - raise CoveInputDataError( - context={ - "sub_title": _("Sorry, we can't process that data"), - "link": "index", - "link_text": _("Try Again"), - "error": format(err), - "msg": format_html( - _( - "The table isn't structured correctly. For example, a JSON Pointer (tender" - ") can't be both a value (tender), a path to an object (" - "tender/id) and a path to an array (tender/0/title).\n\n" - ' ' - "Error message: {}", - ), - err, + raise InputError( + status=HTTPStatus.UNPROCESSABLE_ENTITY, + heading=_("Sorry, we can't process that data"), + message=format_html( + _( + "The table isn't structured correctly. For example, a JSON Pointer (tender" + ") can't be both a value (tender), a path to an object (" + "tender/id) and a path to an array (tender/0/title).\n\n" + ' ' + "Error message: {}", ), - } + err, + ), ) from None except Exception as err: logger.exception("", extra={"request": request}) - raise CoveInputDataError(wrapped_err=err) from None + raise InputError( + status=HTTPStatus.UNPROCESSABLE_ENTITY, + heading=_("Sorry, we can't process that data"), + message=_( + "We think you tried to supply a spreadsheet, but we failed to convert it." + "\n\nError message: %(error)r" + ) + % {"error": err}, + ) from None with open(context["converted_path"], "rb") as f: package_data = json.load(f) + if "releases" not in package_data and "records" not in package_data: + raise InputError( + status=HTTPStatus.UNPROCESSABLE_ENTITY, + heading=_("Missing OCDS package"), + message=mark_safe( + _( + "We could not detect a package structure at the top-level of your data. OCDS releases and " + 'records should be published within a release package or record package to provide important meta-data. ' + 'For more information, please refer to the Releases and Records section in the OCDS ' + "documentation.\n\n" + ' ' + "Error message: Missing OCDS package" + ) + ), + ) from None + # Perform the validation. context = common_checks_ocds(context, supplied_data.upload_dir(), package_data, schema_ocds) # Set by SchemaOCDS.get_schema_obj(deref=True), which, at the latest, is called indirectly by common_checks_ocds(). if schema_ocds.json_deref_error: - raise CoveInputDataError( - context={ - "sub_title": _("JSON reference error"), - "link": "index", - "link_text": _("Try Again"), - "msg": _( - format_html( - "We have detected a JSON reference error in the schema. This may be " - " due to some extension trying to resolve non-existing references. " - '\n\n Error message: {}", - schema_ocds.json_deref_error, - ) - ), - "error": _("%(error)s") % {"error": schema_ocds.json_deref_error}, - } - ) + raise InputError( + status=HTTPStatus.UNPROCESSABLE_ENTITY, + heading=_("JSON reference error"), + message=_( + format_html( + "We have detected a JSON reference error in the schema. This may be " + " due to some extension trying to resolve non-existing references. " + '\n\n Error message: {}", + schema_ocds.json_deref_error, + ) + ), + ) from None # Update the row in the database. @@ -180,4 +375,4 @@ def explore_ocds(request, pk): context["has_records"] = "records" in package_data - return render(request, "cove_ocds/explore_base.html", context) + return render(request, "explore.html", context) diff --git a/docs/architecture.rst b/docs/architecture.rst index bf279378..c31be5fc 100644 --- a/docs/architecture.rst +++ b/docs/architecture.rst @@ -28,24 +28,21 @@ External libraries The OCDS Data Review Tool is just one manifestation of software historically known as 'CoVE' (Convert, Validate, Explore). Instances of CoVE exist for other standards as well as OCDS. We modularize and reuse code where possible, so as a result the DRT has dependencies on external libraries related to CoVE: * lib-cove (`opendataservices/lib-cove `_): contains functions and helpers that may be useful for data validation and review, regardless of the particular data standard. -* lib-cove-web (`opendataservices/lib-cove-web `_): provides a barebones Django configuration, and baseline CSS, JS and templates that are common for all CoVE instances. It is also a place for common functions relating to presentation or display of data or output. Any templates edited here typically affect all CoVE instances. Sometimes this is useful, but for OCDS-only changes, templates can be overridden in cove-ocds. This and cove-ocds are the only places where frontend output and translatable strings should be. Configuration ------------- Some configuration variables are set in ``COVE_CONFIG``, found in ``core/settings.py``. -* ``app_name``, ``app_verbose_name``, ``app_strapline``, ``support_email``: set human readable strings for the DRT that can be reused in templates etc. -* ``app_base_template``, ``input_template``, ``input_methods``: set the templates for the landing page. * ``schema_version_choices`` (``version: (display, url, tag)``), ``schema_codelists``: point to JSON schema files that the DRT uses for validating data. Since there is more than one version of the Open Contracting Data Standard, this lets the user choose which version of the scheme they are validating against. Path through the code --------------------- -1. The input form on the landing page can be found in the ``input`` template (``cove_ocds/templates``). The OCDS DRT overrides the default input template from lib-cove-web so it can be customized compared to other instances of CoVE. This override is set using the ``input_template`` setting in ``COVE_CONFIG`` (see above). +1. The input form on the landing page can be found in the ``input`` template (``cove_ocds/templates``). 2. Submitting the form calls the `explore_ocds` function (``cove_ocds/views.py``). - * This checks for basic problems with the input file, and adds metadata, using ``explore_data_context`` from lib-cove-web. + * This checks for basic problems with the input file, and adds metadata. * It then performs OCDS specific JSON checks, if the input data is JSON. * And then schema-specific OCDS checks, depending on the version specified, using ``SchemaOCDS`` and ``common_checks`` from lib-cove-ocds. Functions from lib-cove-ocds also takes care of handling any extension data included in the input. lib-cove-ocds calls on lib-cove to perform schema validation that is not specific to OCDS, using JSON Schema and JSONRef, as well as common things like checking for duplicate identifiers. * lib-cove-ocds runs additional checks, which are basic data quality checks outside of the OCDS schema. diff --git a/docs/how-to-add-a-validation-check.rst b/docs/how-to-add-a-validation-check.rst index f2c6c9f1..84fdbab4 100644 --- a/docs/how-to-add-a-validation-check.rst +++ b/docs/how-to-add-a-validation-check.rst @@ -25,7 +25,7 @@ Add tests for the new function in ``tests/test_additional_checks.py`` and any fi Changes to ``cove-ocds`` ------------------------ -The templates need updating to display the results of your additional checks. It's likely that the only file you need to modify is ``templates/cove_ocds/additional_checks_table.html``. +The templates need updating to display the results of your additional checks. It's likely that the only file you need to modify is ``templates/validation_table.html``. Add a clause for your new check using ``{% if type == 'sample_check' %}`` (where ``sample_check`` is the ``type`` you set in the output) and then display the results how you see fit. You can integrate them into the existing additional checks table, or output them some other way if that makes more sense. Iterate through the output you set, eg: diff --git a/docs/how-to-config-frontend.rst b/docs/how-to-config-frontend.rst deleted file mode 100644 index 6c73f0eb..00000000 --- a/docs/how-to-config-frontend.rst +++ /dev/null @@ -1,29 +0,0 @@ -How to replace frontend hardcoding with a configurable variable -=============================================================== - -Pick a name for the environment variable you want to configure cove with. In this example we use `MY_ENV_VAR`. - -Edit `core/settings.py`, and add a setting. The setting's name typically matches the environment variable's name. Set a default value, if appropriate. For example: - -.. code:: python - - MY_ENV_VAR = os.getenv("MY_ENV_VAR", "default value") - - -Edit `core/context_processors.py`, and add a mapping between the setting name, and what name you want use in the template: we've picked `my_var`. - -.. code:: python - - def from_settings(request): - return { - 'hotjar': settings.HOTJAR, - ... - 'my_var': settings.MY_ENV_VAR, - } - -Edit a template, and use the variable, e.g.: - -.. code:: django - - My var is: {{ my_var }} - {% if my_var > 5 %}Big{% endif %} diff --git a/docs/how-to-edit-stylesheet.rst b/docs/how-to-edit-stylesheet.rst deleted file mode 100644 index 56f6e19b..00000000 --- a/docs/how-to-edit-stylesheet.rst +++ /dev/null @@ -1,17 +0,0 @@ -How to edit the stylesheet -========================== - -First: Run the setup from :ref:`run_locally`. - -Edit a file in the ``cove_ocds/sass`` directory: - -* ``_bootstrap-variables-ocds.sass`` to change variables used by bootstrap (e.g. colors) -* ``_custom-ocds.sass`` to add extra CSS blocks. - -Then, run the build command to generate the CSS files: - -.. code-block:: bash - - pysassc -t compressed -I bootstrap cove_ocds/sass/styles-ocds.sass cove_ocds/static/dataexplore/css/bootstrap-ocds.css - -Finally, check the changes with runserver, as per usual. diff --git a/docs/index.rst b/docs/index.rst index 498e7a3f..f9e3435c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -3,7 +3,6 @@ OCDS Data Review Tool .. include:: ../README.rst - This documentation is for people who wish to contribute to or modify the Data Review Tool (DRT). The `CoVE `__ documentation might also be relevant. @@ -13,44 +12,65 @@ The `CoVE `__ documentation might also b :caption: Contents: architecture - template-structure - translations how-to-add-a-validation-check - how-to-edit-stylesheet - how-to-config-frontend - tests There are `drafts `__ of another couple how-tos for adding headlines and modifying validation error messages. .. _run_locally: -Running it locally ------------------- +Run server +---------- -* Clone the repository -* Change into the cloned repository -* Create a virtual environment (note this application uses python3) -* Activate the virtual environment -* Install dependencies -* Set up the database (sqlite3) -* Compile the translations -* Run the development server +Install dependencies: .. code:: bash - git clone https://github.com/open-contracting/cove-ocds.git - cd cove-ocds - python3 -m venv .ve - source .ve/bin/activate pip install -r requirements_dev.txt + +Set up the database (sqlite3): + +.. code:: bash + python manage.py migrate + +Compile translations: + +.. code:: bash + python manage.py compilemessages + +Run the development server: + +.. code:: bash + python manage.py runserver -This will make the test site available on the local machine only. If you are running in some kind of container, or on a remote development machine you will need to run: +Edit stylesheets +---------------- + +Edit a file in the ``cove_ocds/sass`` directory: + +* ``_bootstrap-variables-ocds.sass`` to change variables used by bootstrap (e.g. colors) +* ``_custom-ocds.sass`` to add extra CSS blocks. + +Generate the CSS files: + +.. code-block:: bash + + pysassc -t compressed -I bootstrap cove_ocds/sass/styles-ocds.sass cove_ocds/static/css/bootstrap-ocds.css + +Run tests +--------- .. code:: bash - ALLOWED_HOSTS='XXX.XXX.XXX.XXX' python manage.py runserver 0.0.0.0:8000 + coverage run --source=cove_ocds,core -m pytest + +See ``tests/fixtures`` for good and bad JSON and XML files for testing the DRT. + +Tests are found in the following files: -where XXX.XXX.XXX.XXX is the IP address that you'll be using to access the running service. +* Input tests (``test_input.py``): Test the input form and responses. +* Functional tests (``tests_functional.py``): Do roundtrip testing of the whole DRT using `Selenium `_. Some of these tests involve hardcoded frontend text, so if you change any of the templates you might need to update a test here. +* `Hypothesis `_ tests (``test_hypothesis.py``): Generate JSON for some unit and some functional tests. +* The rest of the tests (``test.py``): Are unit tests for the various validation functions. Some of these test code in lib-cove-ocds. diff --git a/docs/template-structure.rst b/docs/template-structure.rst deleted file mode 100644 index aef7c663..00000000 --- a/docs/template-structure.rst +++ /dev/null @@ -1,17 +0,0 @@ -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. diff --git a/docs/tests.rst b/docs/tests.rst deleted file mode 100644 index f3d69958..00000000 --- a/docs/tests.rst +++ /dev/null @@ -1,17 +0,0 @@ -Tests -===== - -Run the tests with: - -.. code:: bash - - coverage run --source=cove_ocds,core -m pytest - -See ``tests/fixtures`` for good and bad JSON and XML files for testing the DRT. - -Tests are found in the following files: - -* Input tests (``test_input.py``): Test the input form and responses. -* Functional tests (``tests_functional.py``): Do roundtrip testing of the whole DRT using `Selenium `_. Some of these tests involve hardcoded frontend text, so if you change any of the templates you might need to update a test here. -* `Hypothesis `_ tests (``test_hypothesis.py``): Generate JSON for some unit and some functional tests. -* The rest of the tests (``test.py``): Are unit tests for the various validation functions. Some of these test code in lib-cove-ocds. diff --git a/docs/translations.rst b/docs/translations.rst deleted file mode 100644 index 0bb3b9a5..00000000 --- a/docs/translations.rst +++ /dev/null @@ -1,35 +0,0 @@ -Translations -============ - -The OCDS DRT uses `Django's translation framework `_. This means you should wrap text in templates in ``{% trans 'Text to translate' %}`` tags and human readable strings embedded in code should be wrapped with ``_('text to translate')``. - -When new strings are added or existing ones edited, extract them and push them to Transifex for translation: - -.. code:: bash - - python manage.py makemessages -l en --ignore "docs" - tx push -s - -In order to fetch translated strings from Transifex: - -.. code:: bash - - tx pull -a - -In order to compile them: - -.. code:: bash - - python manage.py compilemessages - -Keep the makemessages and pull messages steps in their own commits separate from the text changes. - -To check that all new text is written so that it is able to be translated you could install and run ``django-template-i18n-lint`` - -.. code:: bash - - pip install django-template-i18n-lint - django-template-i18n-lint cove - -Translatable strings may also be found in lib-cove-web. If a new language is added for the OCDS DRT, the strings in lib-cove-web will also need to be translated. - diff --git a/requirements.in b/requirements.in index 43f06fe0..8cd94c20 100644 --- a/requirements.in +++ b/requirements.in @@ -4,5 +4,4 @@ flattentool gunicorn[setproctitle] libcove libcoveocds[perf,web] -libcoveweb sentry-sdk diff --git a/requirements.txt b/requirements.txt index 151272a9..c2818481 100644 --- a/requirements.txt +++ b/requirements.txt @@ -35,18 +35,14 @@ django==4.2.16 # -r requirements.in # django-bootstrap3 # libcoveocds - # libcoveweb django-bootstrap3==24.2 - # via - # -r requirements.in - # libcoveweb + # via -r requirements.in et-xmlfile==1.1.0 # via openpyxl flattentool==0.26.0 # via # -r requirements.in # libcove - # libcoveweb gunicorn==23.0.0 # via -r requirements.in idna==3.7 @@ -71,17 +67,12 @@ libcove==0.32.1 # via # -r requirements.in # libcoveocds - # libcoveweb libcoveocds==0.17.0 # via -r requirements.in -libcoveweb==0.31.0 - # via -r requirements.in lxml==4.9.1 # via flattentool markdown-it-py==2.2.0 # via libcoveocds -markupsafe==2.1.2 - # via werkzeug mdurl==0.1.2 # via markdown-it-py ocdsextensionregistry==0.4.0 @@ -114,7 +105,6 @@ requests==2.32.3 # via # libcove # libcoveocds - # libcoveweb # ocdsextensionregistry # requests-cache requests-cache==1.1.0 @@ -157,8 +147,6 @@ urllib3==2.2.2 # sentry-sdk webencodings==0.5.1 # via bleach -werkzeug==3.0.3 - # via libcoveweb xmltodict==0.12.0 # via flattentool zc-lockfile==2.0 diff --git a/requirements_dev.txt b/requirements_dev.txt index 4a92cc8f..cdc065d1 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -62,11 +62,8 @@ django==4.2.16 # via # -r requirements.txt # django-bootstrap3 - # libcoveweb django-bootstrap3==24.2 - # via - # -r requirements.txt - # libcoveweb + # via -r requirements.txt et-xmlfile==1.1.0 # via # -r requirements.txt @@ -78,7 +75,6 @@ flattentool==0.26.0 # -r requirements.txt # -r requirements_dev.in # libcove - # libcoveweb gunicorn==23.0.0 # via -r requirements.txt h11==0.14.0 @@ -120,11 +116,8 @@ libcove==0.32.1 # via # -r requirements.txt # libcoveocds - # libcoveweb libcoveocds==0.17.0 # via -r requirements.txt -libcoveweb==0.31.0 - # via -r requirements.txt libsass==0.20.1 # via -r requirements_dev.in lxml==4.9.1 @@ -134,9 +127,7 @@ lxml==4.9.1 markdown-it-py==2.2.0 # via -r requirements.txt markupsafe==2.1.2 - # via - # -r requirements.txt - # werkzeug + # via werkzeug mdurl==0.1.2 # via # -r requirements.txt @@ -204,7 +195,6 @@ requests==2.32.3 # -r requirements_dev.in # libcove # libcoveocds - # libcoveweb # ocdsextensionregistry # requests-cache requests-cache==1.1.0 @@ -284,10 +274,7 @@ webencodings==0.5.1 # -r requirements.txt # bleach werkzeug==3.0.3 - # via - # -r requirements.txt - # libcoveweb - # pytest-localserver + # via pytest-localserver wsproto==1.2.0 # via trio-websocket xmltodict==0.12.0 diff --git a/tests/conftest.py b/tests/conftest.py index b5e7a4b1..0813ffea 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -10,12 +10,6 @@ BROWSER = os.getenv("BROWSER", "ChromeHeadless") -@pytest.fixture(autouse="CUSTOM_SERVER_URL" in os.environ) -def slow(): - yield - time.sleep(1) - - @pytest.fixture(scope="module") def browser(): if BROWSER == "ChromeHeadless": @@ -73,24 +67,3 @@ def skip_if_remote(): # can't make assumptions about what environment variables will be set if "CUSTOM_SERVER_URL" in os.environ: pytest.skip() - - -@pytest.fixture -def settings_releases_table_10(settings): - # This needs to be in a fixture, to make sure its loaded before - # url_input_browser - settings.RELEASES_OR_RECORDS_TABLE_LENGTH = 10 - - -@pytest.fixture -def settings_records_table_10(settings): - # This needs to be in a fixture, to make sure its loaded before - # url_input_browser - settings.RELEASES_OR_RECORDS_TABLE_LENGTH = 10 - - -@pytest.fixture -def settings_error_locations_sample(settings): - # This needs to be in a fixture, to make sure its loaded before - # url_input_browser - settings.VALIDATION_ERROR_LOCATIONS_SAMPLE = True diff --git a/tests/test_functional.py b/tests/test_functional.py index 5f2ae4fb..029bcbd7 100644 --- a/tests/test_functional.py +++ b/tests/test_functional.py @@ -93,12 +93,6 @@ def test_common_index_elements(server_url, browser): assert "360 Giving" not in browser.find_element(By.TAG_NAME, "body").text -def test_terms_page(server_url, browser): - browser.get(f"{server_url}/terms/") - - assert "Open Contracting Partnership" in browser.find_element(By.TAG_NAME, "body").text - - def test_accordion(server_url, browser): browser.get(server_url) @@ -129,18 +123,6 @@ def buttons(): assert buttons() == [False, False, True] -def test_500_error(server_url, browser): - browser.get(f"{server_url}/test/500") - # Check that our nice error message is there - assert "Something went wrong" in browser.find_element(By.TAG_NAME, "body").text - # Check for the exclamation icon - # This helps to check that the theme including the css has been loaded - # properly - icon_span = browser.find_element(By.CLASS_NAME, "panel-danger").find_element(By.TAG_NAME, "span") - assert "Glyphicons Halflings" in icon_span.value_of_css_property("font-family") - assert icon_span.value_of_css_property("color") == "rgba(255, 255, 255, 1)" - - @pytest.mark.parametrize( ("source_filename", "expected_text", "not_expected_text", "conversion_successful"), [ @@ -907,7 +889,7 @@ def test_error_list_999_lines(skip_if_remote, url_input_browser): @override_settings(VALIDATION_ERROR_LOCATIONS_LENGTH=1000) -def test_error_list_1000_lines_sample(skip_if_remote, settings_error_locations_sample, url_input_browser): +def test_error_list_1000_lines_sample(skip_if_remote, url_input_browser): """ Check that when there are more than 1000 error locations, only 1001 are shown in the table, and there is a message. @@ -917,13 +899,13 @@ def test_error_list_1000_lines_sample(skip_if_remote, settings_error_locations_s assert "1001" in browser.find_element(By.TAG_NAME, "body").text browser.find_element(By.LINK_TEXT, "1001").click() modal_body = browser.find_element(By.CSS_SELECTOR, ".modal-body") - assert "random 1000 locations for this error" in modal_body.text + assert "first 1000 locations for this error" in modal_body.text table_rows = modal_body.find_elements(By.CSS_SELECTOR, "table tbody tr") assert len(table_rows) == 1000 @override_settings(VALIDATION_ERROR_LOCATIONS_LENGTH=1000) -def test_error_list_999_lines_sample(skip_if_remote, settings_error_locations_sample, url_input_browser): +def test_error_list_999_lines_sample(skip_if_remote, url_input_browser): """ Check that when there are less than 1000 error locations, they are all shown in the table, and there is no message. diff --git a/tests/test_general.py b/tests/test_general.py index 6f2edfb4..52e57fdd 100644 --- a/tests/test_general.py +++ b/tests/test_general.py @@ -4,7 +4,6 @@ import libcove.lib.common as cove_common import pytest -from cove.input.models import SuppliedData from django.conf import settings from django.core.files.base import ContentFile from django.core.files.uploadedfile import UploadedFile @@ -12,6 +11,8 @@ from libcoveocds.exceptions import OCDSVersionError from libcoveocds.schema import SchemaOCDS +from cove_ocds.models import SuppliedData + schema_version = list(settings.COVE_CONFIG["schema_version_choices"])[-1] OCDS_DEFAULT_SCHEMA_VERSION = schema_version DEFAULT_OCDS_VERSION = schema_version @@ -121,68 +122,71 @@ def test_get_schema_deprecated_paths(): @pytest.mark.django_db @pytest.mark.parametrize( - "json_data", + ("json_data", "status_code"), [ - # A selection of JSON strings we expect to give a 200 status code, even - # though some of them aren't valid OCDS - "true", - "null", - "1", - "{}", - "[]", - "[[]]", - '{"releases":{}}', - '{"releases" : 1.0}', - '{"releases" : 2}', - '{"releases" : true}', - '{"releases" : "test"}', - '{"releases" : null}', - '{"releases" : {"a":"b"}}', - '{"releases" : [["test"]]}', - '{"records":{}}', - '{"records" : 1.0}', - '{"records" : 2}', - '{"records" : true}', - '{"records" : "test"}', - '{"records" : null}', - '{"records" : {"a":"b"}}', - '{"records" : [["test"]]}', - '{"version": "1.1", "releases" : 1.0}', - '{"version": "1.1", "releases" : 2}', - '{"version": "1.1", "releases" : true}', - '{"version": "1.1", "releases" : "test"}', - '{"version": "1.1", "releases" : null}', - '{"version": "1.1", "releases" : {"version": "1.1", "a":"b"}}', - '{"version": "1.1", "records" : 1.0}', - '{"version": "1.1", "records" : 2}', - '{"version": "1.1", "records" : true}', - '{"version": "1.1", "records" : "test"}', - '{"version": "1.1", "records" : {"version": "1.1", "a":"b"}}', - '{"version": "1.1", "releases":{"buyer":{"additionalIdentifiers":[]}}}', - '{"version": "1.1", "releases":{"parties":{"roles":[["a","b"]]}}}', # test an array in a codelist position - """{ - "extensions": [ - "https://raw.githubusercontent.com/open-contracting-extensions/ocds_bid_extension/v1.1.1/extension.jso" - ], - "releases": [] - }""", - '{"extensions":[{}], "releases":[]}' - """{ - "extensions": [ - "https://raw.githubusercontent.com/open-contracting-extensions/ocds_bid_extension/v1.1.1/extension.jso" - ], - "releases": [], - "version": "1.1" - }""", - '{"extensions":[{}], "releases":[], "version": "1.1"}', + ("true", 422), + ("null", 422), + ("1", 422), + ("{}", 422), + ("[]", 422), + ("[[]]", 422), + ('{"releases":{}}', 200), + ('{"releases" : 1.0}', 200), + ('{"releases" : 2}', 200), + ('{"releases" : true}', 200), + ('{"releases" : "test"}', 200), + ('{"releases" : null}', 200), + ('{"releases" : {"a":"b"}}', 200), + ('{"releases" : [["test"]]}', 200), + ('{"records":{}}', 200), + ('{"records" : 1.0}', 200), + ('{"records" : 2}', 200), + ('{"records" : true}', 200), + ('{"records" : "test"}', 200), + ('{"records" : null}', 200), + ('{"records" : {"a":"b"}}', 200), + ('{"records" : [["test"]]}', 200), + ('{"version": "1.1", "releases" : 1.0}', 200), + ('{"version": "1.1", "releases" : 2}', 200), + ('{"version": "1.1", "releases" : true}', 200), + ('{"version": "1.1", "releases" : "test"}', 200), + ('{"version": "1.1", "releases" : null}', 200), + ('{"version": "1.1", "releases" : {"version": "1.1", "a":"b"}}', 200), + ('{"version": "1.1", "records" : 1.0}', 200), + ('{"version": "1.1", "records" : 2}', 200), + ('{"version": "1.1", "records" : true}', 200), + ('{"version": "1.1", "records" : "test"}', 200), + ('{"version": "1.1", "records" : {"version": "1.1", "a":"b"}}', 200), + ('{"version": "1.1", "releases":{"buyer":{"additionalIdentifiers":[]}}}', 200), + ('{"version": "1.1", "releases":{"parties":{"roles":[["a","b"]]}}}', 200), # an array in a codelist position + ('{"extensions":[{}], "releases":[], "version": "1.1"}', 200), + ('{"extensions":[{}], "releases":[]}', 200), + ( + """{ + "extensions": [ + "https://raw.githubusercontent.com/open-contracting-extensions/ocds_bid_extension/v1.1.1/extension.json" + ], + "releases": [] + }""", + 422, # #/definitions/RequirementResponse JSON reference error + ), + ( + """{ + "extensions": [ + "https://raw.githubusercontent.com/open-contracting-extensions/ocds_bid_extension/v1.1.1/extension.json" + ], + "releases": [], + "version": "1.1" + }""", + 422, # #/definitions/RequirementResponse JSON reference error + ), ], ) -def test_explore_page(client, json_data): +def test_explore_page(client, json_data, status_code): data = SuppliedData.objects.create() data.original_file.save("test.json", ContentFile(json_data)) - data.current_app = "cove_ocds" resp = client.get(data.get_absolute_url()) - assert resp.status_code == 200 + assert resp.status_code == status_code @pytest.mark.django_db @@ -201,7 +205,7 @@ def test_explore_not_json(client): with open(os.path.join("tests", "fixtures", "tenders_releases_2_releases_not_json.json")) as fp: data.original_file.save("test.json", UploadedFile(fp)) resp = client.get(data.get_absolute_url()) - assert resp.status_code == 200 + assert resp.status_code == 422 assert b"not well formed JSON" in resp.content @@ -211,7 +215,7 @@ def test_explore_unconvertable_spreadsheet(client): with open(os.path.join("tests", "fixtures", "bad.xlsx"), "rb") as fp: data.original_file.save("basic.xlsx", UploadedFile(fp)) resp = client.get(data.get_absolute_url()) - assert resp.status_code == 200 + assert resp.status_code == 422 assert b"We think you tried to supply a spreadsheet, but we failed to convert it." in resp.content @@ -219,7 +223,6 @@ def test_explore_unconvertable_spreadsheet(client): def test_explore_page_null_tag(client): data = SuppliedData.objects.create() data.original_file.save("test.json", ContentFile('{"releases":[{"tag":null}]}')) - data.current_app = "cove_ocds" resp = client.get(data.get_absolute_url()) assert resp.status_code == 200 @@ -228,7 +231,6 @@ def test_explore_page_null_tag(client): def test_explore_page_null_version(client): data = SuppliedData.objects.create() data.original_file.save("test.json", ContentFile('{"version":null,"releases":[{}]}')) - data.current_app = "cove_ocds" resp = client.get(data.get_absolute_url()) assert resp.status_code == 200 assert b"null which is not recognised" in resp.content @@ -238,7 +240,6 @@ def test_explore_page_null_version(client): def test_explore_page_expired_file(client): data = SuppliedData.objects.create() data.original_file.save("test.json", ContentFile('{"releases":[{}]}')) - data.current_app = "cove_ocds" shutil.rmtree(data.upload_dir()) resp = client.get(data.get_absolute_url()) assert resp.status_code == 404 @@ -257,7 +258,6 @@ def test_explore_page_expired_file(client): def test_explore_schema_version(client, json_data): data = SuppliedData.objects.create() data.original_file.save("test.json", ContentFile(json_data)) - data.current_app = "cove_ocds" resp = client.get(data.get_absolute_url()) assert resp.status_code == 200 @@ -275,7 +275,6 @@ def test_explore_schema_version(client, json_data): def test_wrong_schema_version_in_data(client): data = SuppliedData.objects.create() data.original_file.save("test.json", ContentFile('{"version": "1.bad", "releases": [{"ocid": "xx"}]}')) - data.current_app = "cove_ocds" resp = client.get(data.get_absolute_url()) assert resp.status_code == 200 assert resp.context["version_used"] == OCDS_DEFAULT_SCHEMA_VERSION @@ -286,7 +285,6 @@ def test_data_supplied_schema_version(client): data = SuppliedData.objects.create() with open(os.path.join("tests", "fixtures", "tenders_releases_2_releases.xlsx"), "rb") as fp: data.original_file.save("test.xlsx", UploadedFile(fp)) - data.current_app = "cove_ocds" assert data.schema_version == "" @@ -450,7 +448,6 @@ def test_codelist_url_ocds_codelists(client): user_data = fp.read() data = SuppliedData.objects.create() data.original_file.save("test.json", ContentFile(user_data)) - data.current_app = "cove_ocds" resp = client.get(data.get_absolute_url()) assert resp.status_code == 200 @@ -477,7 +474,6 @@ def test_codelist_url_extension_codelists(client): user_data = fp.read() data = SuppliedData.objects.create() data.original_file.save("test.json", ContentFile(user_data)) - data.current_app = "cove_ocds" resp = client.get(data.get_absolute_url()) assert resp.status_code == 200 diff --git a/tests/test_hypothesis.py b/tests/test_hypothesis.py index b83e6e75..7b8e9103 100644 --- a/tests/test_hypothesis.py +++ b/tests/test_hypothesis.py @@ -1,11 +1,12 @@ import json import pytest -from cove.input.models import SuppliedData from django.core.files.base import ContentFile from hypothesis import HealthCheck, example, given, settings from hypothesis import strategies as st +from cove_ocds.models import SuppliedData + """ ## Suggested testing patterns (from CamPUG talk) * simple fuzzing @@ -22,27 +23,23 @@ @pytest.mark.xfail @pytest.mark.django_db -@pytest.mark.parametrize("current_app", ["cove-ocds"]) @given( general_json | st.fixed_dictionaries({"releases": general_json}) | st.fixed_dictionaries({"records": general_json}) ) -def test_explore_page(client, current_app, json_data): +def test_explore_page(client, json_data): data = SuppliedData.objects.create() data.original_file.save("test.json", ContentFile(json.dumps(json_data))) - data.current_app = current_app resp = client.get(data.get_absolute_url()) assert resp.status_code == 200 @pytest.mark.django_db -@pytest.mark.parametrize("current_app", ["cove-ocds"]) @given(general_json) @example(1) @settings(max_examples=50, deadline=None, suppress_health_check=[HealthCheck.function_scoped_fixture]) -def test_explore_page_duplicate_ids(client, current_app, json_data): +def test_explore_page_duplicate_ids(client, json_data): duplicate_id_releases = {"releases": [{"id": json_data}, {"id": json_data}]} data = SuppliedData.objects.create() data.original_file.save("test.json", ContentFile(json.dumps(duplicate_id_releases))) - data.current_app = current_app resp = client.get(data.get_absolute_url()) assert resp.status_code == 200 diff --git a/tests/test_input.py b/tests/test_input.py index e2d09491..e468b4b4 100644 --- a/tests/test_input.py +++ b/tests/test_input.py @@ -1,13 +1,8 @@ import os import pytest -from cove.input.models import SuppliedData - -def fake_cove_middleware(request): - request.current_app = "cove_ocds" - request.current_app_base_template = "cove_ocds/base.html" - return request +from cove_ocds.models import SuppliedData @pytest.mark.django_db From af76d4bf1b267bb76ac183e9ae7d9ac694236025 Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Sun, 20 Oct 2024 14:55:59 -0400 Subject: [PATCH 12/37] fix: Make source_url required (regression from making it blank but non-null) --- cove_ocds/forms.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cove_ocds/forms.py b/cove_ocds/forms.py index f710e9d3..dc49b809 100644 --- a/cove_ocds/forms.py +++ b/cove_ocds/forms.py @@ -12,10 +12,11 @@ class Meta: class UrlForm(forms.ModelForm): + source_url = forms.URLField(required=True, label=_("Supply a URL")) + class Meta: model = models.SuppliedData fields = ["source_url"] - labels = {"source_url": _("Supply a URL")} class TextForm(forms.Form): From da62f3229da72b1c7064cc2dd26d56d3e70d0284 Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Sun, 20 Oct 2024 15:00:16 -0400 Subject: [PATCH 13/37] fix: Don't show publisher name if name not present --- cove_ocds/templates/explore.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cove_ocds/templates/explore.html b/cove_ocds/templates/explore.html index afde0c8b..57c0b583 100644 --- a/cove_ocds/templates/explore.html +++ b/cove_ocds/templates/explore.html @@ -79,7 +79,7 @@

    {% trans 'Headlines' %}

    {% endif %} - {% if json_data.publisher %} + {% if json_data.publisher.name %}
  • {% blocktrans with value=json_data.publisher.name %}The publisher named in the file is {{value}}.{% endblocktrans %}
  • From 9ad2e168fe30acefee49a4dd8179d83180d36031 Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Sun, 20 Oct 2024 15:02:24 -0400 Subject: [PATCH 14/37] feat: Remove unneeded model fields and methods --- ...emove_supplieddata_current_app_and_more.py | 40 +++++++++ cove_ocds/models.py | 90 ++++++------------- cove_ocds/templates/explore.html | 4 +- cove_ocds/templatetags/cove_ocds.py | 7 +- cove_ocds/views.py | 24 +---- tests/test_general.py | 37 +++----- tests/test_hypothesis.py | 5 +- 7 files changed, 95 insertions(+), 112 deletions(-) create mode 100644 cove_ocds/migrations/0003_remove_supplieddata_current_app_and_more.py diff --git a/cove_ocds/migrations/0003_remove_supplieddata_current_app_and_more.py b/cove_ocds/migrations/0003_remove_supplieddata_current_app_and_more.py new file mode 100644 index 00000000..e21aa284 --- /dev/null +++ b/cove_ocds/migrations/0003_remove_supplieddata_current_app_and_more.py @@ -0,0 +1,40 @@ +# Generated by Django 4.2.16 on 2024-10-20 18:57 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ("cove_ocds", "0002_alter_supplieddata_current_app_and_more"), + ] + + operations = [ + migrations.RemoveField( + model_name="supplieddata", + name="current_app", + ), + migrations.RemoveField( + model_name="supplieddata", + name="data_schema_version", + ), + migrations.RemoveField( + model_name="supplieddata", + name="form_name", + ), + migrations.RemoveField( + model_name="supplieddata", + name="modified", + ), + migrations.RemoveField( + model_name="supplieddata", + name="parameters", + ), + migrations.RemoveField( + model_name="supplieddata", + name="rendered", + ), + migrations.RemoveField( + model_name="supplieddata", + name="schema_version", + ), + ] diff --git a/cove_ocds/models.py b/cove_ocds/models.py index a97e10ed..b4277381 100644 --- a/cove_ocds/models.py +++ b/cove_ocds/models.py @@ -10,7 +10,6 @@ from django.conf import settings from django.core.files.base import ContentFile from django.db import models -from django.urls import reverse from werkzeug.http import parse_options_header CONTENT_TYPE_MAP = { @@ -22,11 +21,11 @@ "text/xml": "xml", } +ALPHABET = f"{string.ascii_letters}{string.digits}" + def upload_to(instance, filename=""): - alphabet = string.ascii_letters + string.digits - random_string = "".join(secrets.choice(alphabet) for i in range(16)) - return os.path.join(str(instance.pk), random_string, filename) + return os.path.join(str(instance.pk), "".join(secrets.choice(ALPHABET) for i in range(16)), filename) class SuppliedData(models.Model): @@ -35,29 +34,7 @@ class SuppliedData(models.Model): # https://docs.djangoproject.com/en/5.1/ref/validators/#django.core.validators.URLValidator.schemes source_url = models.URLField(blank=True, max_length=2000) original_file = models.FileField(upload_to=upload_to, max_length=256) - current_app = models.CharField(max_length=20, default="cove_ocds") - created = models.DateTimeField(auto_now_add=True, null=True) - modified = models.DateTimeField(auto_now=True, null=True) - rendered = models.BooleanField(default=False) - - # Last schema version applied to the stored data - schema_version = models.CharField(max_length=10, default="") - # Schema version in uploaded/linked file - data_schema_version = models.CharField(max_length=10, default="") - - # Parameters that were passed for this supplied data - parameters = models.TextField(blank=True) - - form_name = models.CharField( - max_length=20, - choices=[ - ("upload_form", "File upload"), - ("url_form", "Downloaded from URL"), - ("text_form", "Pasted into textarea"), - ], - blank=True, - ) class Meta: db_table = "input_supplieddata" @@ -65,46 +42,35 @@ class Meta: def __str__(self): return f"" - def get_absolute_url(self): - return reverse("explore", args=(self.pk,)) - def upload_dir(self): return os.path.join(settings.MEDIA_ROOT, str(self.pk), "") def upload_url(self): return os.path.join(settings.MEDIA_URL, str(self.pk), "") - def is_google_doc(self): - return self.source_url.startswith("https://docs.google.com/") - def download(self): - if self.source_url: - r = requests.get( - self.source_url, - headers={"User-Agent": settings.USER_AGENT}, - timeout=settings.REQUESTS_TIMEOUT, - ) - r.raise_for_status() - content_type = r.headers.get("content-type", "").split(";")[0].lower() - file_extension = CONTENT_TYPE_MAP.get(content_type) - - if not file_extension: - _, options = parse_options_header(r.headers.get("content-disposition")) - if "filename*" in options: - filename = options["filename*"] - elif "filename" in options: - filename = options["filename"] - else: - filename = urlsplit(r.url).path.rstrip("/").rsplit("/")[-1] - possible_extension = filename.rsplit(".")[-1] - if possible_extension in CONTENT_TYPE_MAP.values(): - file_extension = possible_extension - - file_name = r.url.split("/")[-1].split("?")[0][:100] - if file_name == "": - file_name = "file" - if file_extension and not file_name.endswith(file_extension): - file_name = file_name + "." + file_extension - self.original_file.save(file_name, ContentFile(r.content)) - else: - raise ValueError("No source_url specified.") # noqa: TRY003 + response = requests.get( + self.source_url, + headers={"User-Agent": settings.USER_AGENT}, + timeout=settings.REQUESTS_TIMEOUT, + ) + response.raise_for_status() + + file_extension = CONTENT_TYPE_MAP.get(response.headers.get("content-type", "").split(";", 1)[0].lower()) + if not file_extension: + _, options = parse_options_header(response.headers.get("content-disposition")) + if "filename*" in options: + filename = options["filename*"] + elif "filename" in options: + filename = options["filename"] + else: + filename = urlsplit(response.url).path.rstrip("/").rsplit("/", 1)[-1] + possible_extension = filename.rsplit(".", 1)[-1] + if possible_extension in CONTENT_TYPE_MAP.values(): + file_extension = possible_extension + + file_name = response.url.split("/", -1)[-1].split("?", 1)[0][:100] or "file" + if file_extension and not file_name.endswith(file_extension): + file_name = f"{file_name}.{file_extension}" + + self.original_file.save(file_name, ContentFile(response.content)) diff --git a/cove_ocds/templates/explore.html b/cove_ocds/templates/explore.html index 57c0b583..27afa635 100644 --- a/cove_ocds/templates/explore.html +++ b/cove_ocds/templates/explore.html @@ -73,9 +73,9 @@

    {% trans 'Headlines' %}

    {% endif %} - {% if data_schema_version %} + {% if 'version' in json_data %}
  • - {% blocktrans %}The schema version specified in the file is {{data_schema_version}}.{% endblocktrans %} + {% blocktrans with value=json_data.version|json %}The schema version specified in the file is {{value}}.{% endblocktrans %}
  • {% endif %} diff --git a/cove_ocds/templatetags/cove_ocds.py b/cove_ocds/templatetags/cove_ocds.py index c0140f09..203fbde0 100644 --- a/cove_ocds/templatetags/cove_ocds.py +++ b/cove_ocds/templatetags/cove_ocds.py @@ -40,6 +40,11 @@ def html_error_msg_ocds(error): return html_error_msg(error) +@register.filter(name="json") +def json_dumps(data): + return json.dumps(data) + + # https://github.com/OpenDataServices/lib-cove-web/blob/main/cove/templatetags/cove_tags.py @@ -56,7 +61,7 @@ def json_decode(error_json): @register.filter def concat(arg1, arg2): - return str(arg1) + str(arg2) + return f"{arg1}{arg2}" @register.filter diff --git a/cove_ocds/views.py b/cove_ocds/views.py index 37bf45e5..d428d7d1 100644 --- a/cove_ocds/views.py +++ b/cove_ocds/views.py @@ -10,6 +10,7 @@ from django.core.exceptions import ValidationError from django.core.files.base import ContentFile from django.shortcuts import redirect, render +from django.urls import reverse from django.utils import translation from django.utils.html import format_html, mark_safe from django.utils.translation import gettext as _ @@ -55,14 +56,6 @@ def data_input(request, form_classes=default_form_classes, text_file_name="test. forms[form_name] = form if form.is_valid(): data = models.SuppliedData() if form_name == "text_form" else form.save(commit=False) - data.form_name = form_name - - try: - # We don't want to store large chunks of pasted data that might be in the request data. - if "paste" not in request_data: - data.parameters = json.dumps(request_data) - except TypeError: - pass data.save() if form_name == "url_form": @@ -102,7 +95,7 @@ def data_input(request, form_classes=default_form_classes, text_file_name="test. ) from None elif form_name == "text_form": data.original_file.save(text_file_name, ContentFile(form["paste"].value())) - return redirect(data.get_absolute_url()) + return redirect(reverse("explore", args=(data.pk,))) return render(request, "input.html", {"forms": forms}) @@ -336,14 +329,6 @@ def explore_ocds(request, pk): ), ) from None - # Update the row in the database. - - # The data_schema_version column is NOT NULL. - supplied_data.data_schema_version = package_data.get("version") or "" - supplied_data.schema_version = schema_ocds.version - supplied_data.rendered = True # not relevant to CoVE OCDS - supplied_data.save() - # Finalize the context. validation_errors_grouped = defaultdict(list) @@ -357,15 +342,14 @@ def explore_ocds(request, pk): key = "other" validation_errors_grouped[key].append((error_json, values)) - context["data_schema_version"] = json.dumps(package_data.get("version")) context["validation_errors_grouped"] = validation_errors_grouped for key in ("additional_closed_codelist_values", "additional_open_codelist_values"): for additional_codelist_values in context[key].values(): if additional_codelist_values["codelist_url"].startswith(schema_ocds.codelists): additional_codelist_values["codelist_url"] = ( - f"https://standard.open-contracting.org/{supplied_data.data_schema_version}/en/schema/codelists/#" - + re.sub(r"([A-Z])", r"-\1", additional_codelist_values["codelist"].split(".")[0]).lower() + f"https://standard.open-contracting.org/{schema_ocds.version}/en/schema/codelists/#" + + re.sub(r"([A-Z])", r"-\1", additional_codelist_values["codelist"].split(".", 1)[0]).lower() ) if "version" in package_data: diff --git a/tests/test_general.py b/tests/test_general.py index 52e57fdd..3af29e37 100644 --- a/tests/test_general.py +++ b/tests/test_general.py @@ -7,6 +7,7 @@ from django.conf import settings from django.core.files.base import ContentFile from django.core.files.uploadedfile import UploadedFile +from django.urls import reverse from libcoveocds.api import ocds_json_output from libcoveocds.exceptions import OCDSVersionError from libcoveocds.schema import SchemaOCDS @@ -185,7 +186,7 @@ def test_get_schema_deprecated_paths(): def test_explore_page(client, json_data, status_code): data = SuppliedData.objects.create() data.original_file.save("test.json", ContentFile(json_data)) - resp = client.get(data.get_absolute_url()) + resp = client.get(reverse("explore", args=(data.pk,))) assert resp.status_code == status_code @@ -193,7 +194,7 @@ def test_explore_page(client, json_data, status_code): def test_explore_page_csv(client): data = SuppliedData.objects.create() data.original_file.save("test.csv", ContentFile("a,b")) - resp = client.get(data.get_absolute_url()) + resp = client.get(reverse("explore", args=(data.pk,))) assert resp.status_code == 200 assert resp.context["conversion"] == "unflatten" assert resp.context["converted_file_size"] == 22 @@ -204,7 +205,7 @@ def test_explore_not_json(client): data = SuppliedData.objects.create() with open(os.path.join("tests", "fixtures", "tenders_releases_2_releases_not_json.json")) as fp: data.original_file.save("test.json", UploadedFile(fp)) - resp = client.get(data.get_absolute_url()) + resp = client.get(reverse("explore", args=(data.pk,))) assert resp.status_code == 422 assert b"not well formed JSON" in resp.content @@ -214,7 +215,7 @@ def test_explore_unconvertable_spreadsheet(client): data = SuppliedData.objects.create() with open(os.path.join("tests", "fixtures", "bad.xlsx"), "rb") as fp: data.original_file.save("basic.xlsx", UploadedFile(fp)) - resp = client.get(data.get_absolute_url()) + resp = client.get(reverse("explore", args=(data.pk,))) assert resp.status_code == 422 assert b"We think you tried to supply a spreadsheet, but we failed to convert it." in resp.content @@ -223,7 +224,7 @@ def test_explore_unconvertable_spreadsheet(client): def test_explore_page_null_tag(client): data = SuppliedData.objects.create() data.original_file.save("test.json", ContentFile('{"releases":[{"tag":null}]}')) - resp = client.get(data.get_absolute_url()) + resp = client.get(reverse("explore", args=(data.pk,))) assert resp.status_code == 200 @@ -231,7 +232,7 @@ def test_explore_page_null_tag(client): def test_explore_page_null_version(client): data = SuppliedData.objects.create() data.original_file.save("test.json", ContentFile('{"version":null,"releases":[{}]}')) - resp = client.get(data.get_absolute_url()) + resp = client.get(reverse("explore", args=(data.pk,))) assert resp.status_code == 200 assert b"null which is not recognised" in resp.content @@ -241,7 +242,7 @@ def test_explore_page_expired_file(client): data = SuppliedData.objects.create() data.original_file.save("test.json", ContentFile('{"releases":[{}]}')) shutil.rmtree(data.upload_dir()) - resp = client.get(data.get_absolute_url()) + resp = client.get(reverse("explore", args=(data.pk,))) assert resp.status_code == 404 assert b"automatically deleted after" in resp.content @@ -259,7 +260,7 @@ def test_explore_schema_version(client, json_data): data = SuppliedData.objects.create() data.original_file.save("test.json", ContentFile(json_data)) - resp = client.get(data.get_absolute_url()) + resp = client.get(reverse("explore", args=(data.pk,))) assert resp.status_code == 200 if "version" not in json_data: assert "/1.1/" in resp.context["schema_url"] @@ -275,25 +276,11 @@ def test_explore_schema_version(client, json_data): def test_wrong_schema_version_in_data(client): data = SuppliedData.objects.create() data.original_file.save("test.json", ContentFile('{"version": "1.bad", "releases": [{"ocid": "xx"}]}')) - resp = client.get(data.get_absolute_url()) + resp = client.get(reverse("explore", args=(data.pk,))) assert resp.status_code == 200 assert resp.context["version_used"] == OCDS_DEFAULT_SCHEMA_VERSION -@pytest.mark.django_db -def test_data_supplied_schema_version(client): - data = SuppliedData.objects.create() - with open(os.path.join("tests", "fixtures", "tenders_releases_2_releases.xlsx"), "rb") as fp: - data.original_file.save("test.xlsx", UploadedFile(fp)) - - assert data.schema_version == "" - - resp = client.post(data.get_absolute_url()) - assert resp.status_code == 200 - assert resp.context["version_used"] == "1.1" - assert SuppliedData.objects.get(id=data.id).schema_version == "1.1" - - def test_get_additional_codelist_values(): with open(os.path.join("tests", "fixtures", "tenders_releases_2_releases_codelists.json")) as fp: json_data_w_additial_codelists = json.load(fp) @@ -448,7 +435,7 @@ def test_codelist_url_ocds_codelists(client): user_data = fp.read() data = SuppliedData.objects.create() data.original_file.save("test.json", ContentFile(user_data)) - resp = client.get(data.get_absolute_url()) + resp = client.get(reverse("explore", args=(data.pk,))) assert resp.status_code == 200 assert len(resp.context["additional_closed_codelist_values"]) == 1 @@ -474,7 +461,7 @@ def test_codelist_url_extension_codelists(client): user_data = fp.read() data = SuppliedData.objects.create() data.original_file.save("test.json", ContentFile(user_data)) - resp = client.get(data.get_absolute_url()) + resp = client.get(reverse("explore", args=(data.pk,))) assert resp.status_code == 200 assert len(resp.context["additional_closed_codelist_values"]) == 1 diff --git a/tests/test_hypothesis.py b/tests/test_hypothesis.py index 7b8e9103..0ac90f48 100644 --- a/tests/test_hypothesis.py +++ b/tests/test_hypothesis.py @@ -2,6 +2,7 @@ import pytest from django.core.files.base import ContentFile +from django.urls import reverse from hypothesis import HealthCheck, example, given, settings from hypothesis import strategies as st @@ -29,7 +30,7 @@ def test_explore_page(client, json_data): data = SuppliedData.objects.create() data.original_file.save("test.json", ContentFile(json.dumps(json_data))) - resp = client.get(data.get_absolute_url()) + resp = client.get(reverse("explore", args=(data.pk,))) assert resp.status_code == 200 @@ -41,5 +42,5 @@ def test_explore_page_duplicate_ids(client, json_data): duplicate_id_releases = {"releases": [{"id": json_data}, {"id": json_data}]} data = SuppliedData.objects.create() data.original_file.save("test.json", ContentFile(json.dumps(duplicate_id_releases))) - resp = client.get(data.get_absolute_url()) + resp = client.get(reverse("explore", args=(data.pk,))) assert resp.status_code == 200 From b7638f590df34293ee9efb40528a9b5d5d6ec1b1 Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Sun, 20 Oct 2024 15:07:59 -0400 Subject: [PATCH 15/37] test: Remove footer tests --- tests/test_functional.py | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/tests/test_functional.py b/tests/test_functional.py index 029bcbd7..2f837593 100644 --- a/tests/test_functional.py +++ b/tests/test_functional.py @@ -12,34 +12,6 @@ OCDS_SCHEMA_VERSIONS_DISPLAY = [display_url[0] for version, display_url in OCDS_SCHEMA_VERSIONS.items()] -@pytest.mark.parametrize( - ("link_text", "expected_text", "css_selector", "url"), - [ - ( - "Open Contracting", - "better serve people and protect our planet", - "h2", - "https://www.open-contracting.org/", - ), - ( - "Open Contracting Data Standard", - "Open Contracting Data Standard", - "#open-contracting-data-standard", - "https://standard.open-contracting.org/", - ), - ], -) -def test_footer_ocds(server_url, browser, link_text, expected_text, css_selector, url): - browser.get(server_url) - footer = browser.find_element(By.ID, "footer") - link = footer.find_element(By.LINK_TEXT, link_text) - href = link.get_attribute("href") - assert url in href - link.click() - time.sleep(0.5) - assert expected_text in browser.find_element(By.CSS_SELECTOR, css_selector).text - - def test_index_page_ocds(server_url, browser): browser.get(server_url) assert "Data Review Tool" in browser.find_element(By.TAG_NAME, "body").text @@ -86,13 +58,6 @@ def test_index_page_ocds_links(server_url, browser, css_id, link_text, url): assert url in href -def test_common_index_elements(server_url, browser): - browser.get(server_url) - assert "Terms & Conditions" in browser.find_element(By.TAG_NAME, "body").text - assert "Open Data Services" in browser.find_element(By.TAG_NAME, "body").text - assert "360 Giving" not in browser.find_element(By.TAG_NAME, "body").text - - def test_accordion(server_url, browser): browser.get(server_url) From 87566e0663a1014f57706e4edfd0139b73299255 Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Sun, 20 Oct 2024 15:09:41 -0400 Subject: [PATCH 16/37] fix: Don't delete the same files repetitively and forever --- cove_ocds/management/commands/expire_files.py | 15 ++++++++------- cove_ocds/models.py | 1 + 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/cove_ocds/management/commands/expire_files.py b/cove_ocds/management/commands/expire_files.py index dad89b2e..8483ec07 100644 --- a/cove_ocds/management/commands/expire_files.py +++ b/cove_ocds/management/commands/expire_files.py @@ -1,21 +1,22 @@ +import datetime import shutil -from datetime import timedelta from django.conf import settings from django.core.management.base import BaseCommand from django.utils import timezone -from cove_ocds.models import SuppliedData +from cove_ocds import models class Command(BaseCommand): - help = "Delete files that are older than 7 days" + help = "Delete files created DELETE_FILES_AFTER_DAYS ago" def handle(self, *args, **options): - old_data = SuppliedData.objects.filter( - created__lt=timezone.now() - timedelta(days=getattr(settings, "DELETE_FILES_AFTER_DAYS", 7)) - ) - for supplied_data in old_data: + for supplied_data in models.SuppliedData.objects.filter( + expired=False, created__lt=timezone.now() - datetime.timedelta(days=settings.DELETE_FILES_AFTER_DAYS) + ): + supplied_data.expired = datetime.datetime.now(tz=datetime.timezone.UTC) + supplied_data.save() try: shutil.rmtree(supplied_data.upload_dir()) except FileNotFoundError: diff --git a/cove_ocds/models.py b/cove_ocds/models.py index b4277381..10b9d54b 100644 --- a/cove_ocds/models.py +++ b/cove_ocds/models.py @@ -35,6 +35,7 @@ class SuppliedData(models.Model): source_url = models.URLField(blank=True, max_length=2000) original_file = models.FileField(upload_to=upload_to, max_length=256) created = models.DateTimeField(auto_now_add=True, null=True) + expired = models.BooleanField(default=False) class Meta: db_table = "input_supplieddata" From d915fb46d3f04a1fad372afdb80420d98cc57670 Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Sun, 20 Oct 2024 16:58:09 -0400 Subject: [PATCH 17/37] build: Add werkzeug --- requirements.in | 1 + requirements.txt | 4 ++++ requirements_dev.txt | 12 ++++++++---- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/requirements.in b/requirements.in index 8cd94c20..7412b83d 100644 --- a/requirements.in +++ b/requirements.in @@ -5,3 +5,4 @@ gunicorn[setproctitle] libcove libcoveocds[perf,web] sentry-sdk +werkzeug diff --git a/requirements.txt b/requirements.txt index c2818481..45880dae 100644 --- a/requirements.txt +++ b/requirements.txt @@ -73,6 +73,8 @@ lxml==4.9.1 # via flattentool markdown-it-py==2.2.0 # via libcoveocds +markupsafe==3.0.2 + # via werkzeug mdurl==0.1.2 # via markdown-it-py ocdsextensionregistry==0.4.0 @@ -147,6 +149,8 @@ urllib3==2.2.2 # sentry-sdk webencodings==0.5.1 # via bleach +werkzeug==3.0.4 + # via -r requirements.in xmltodict==0.12.0 # via flattentool zc-lockfile==2.0 diff --git a/requirements_dev.txt b/requirements_dev.txt index cdc065d1..3487c818 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -126,8 +126,10 @@ lxml==4.9.1 # flattentool markdown-it-py==2.2.0 # via -r requirements.txt -markupsafe==2.1.2 - # via werkzeug +markupsafe==3.0.2 + # via + # -r requirements.txt + # werkzeug mdurl==0.1.2 # via # -r requirements.txt @@ -273,8 +275,10 @@ webencodings==0.5.1 # via # -r requirements.txt # bleach -werkzeug==3.0.3 - # via pytest-localserver +werkzeug==3.0.4 + # via + # -r requirements.txt + # pytest-localserver wsproto==1.2.0 # via trio-websocket xmltodict==0.12.0 From 8b2423b8586dd0d8e487049a01eadf18a4d848a9 Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Sun, 20 Oct 2024 16:58:47 -0400 Subject: [PATCH 18/37] docs: Add Security comments (SSRF) --- cove_ocds/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cove_ocds/models.py b/cove_ocds/models.py index 10b9d54b..7edc27ef 100644 --- a/cove_ocds/models.py +++ b/cove_ocds/models.py @@ -14,10 +14,10 @@ CONTENT_TYPE_MAP = { "application/json": "json", - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "xlsx", - "text/csv": "csv", "application/vnd.oasis.opendocument.spreadsheet": "ods", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "xlsx", "application/xml": "xml", + "text/csv": "csv", "text/xml": "xml", } @@ -51,7 +51,7 @@ def upload_url(self): def download(self): response = requests.get( - self.source_url, + self.source_url, # Security: Potential SSRF via user-provided URL headers={"User-Agent": settings.USER_AGENT}, timeout=settings.REQUESTS_TIMEOUT, ) From 8c8da155552291b90af46d3cadb8a70838284408 Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Sun, 20 Oct 2024 22:03:56 -0400 Subject: [PATCH 19/37] build: Add requests. Add migration. --- .../migrations/0004_supplieddata_expired.py | 17 +++++++++++++++++ requirements.in | 1 + requirements.txt | 1 + requirements_dev.in | 1 - requirements_dev.txt | 1 - 5 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 cove_ocds/migrations/0004_supplieddata_expired.py diff --git a/cove_ocds/migrations/0004_supplieddata_expired.py b/cove_ocds/migrations/0004_supplieddata_expired.py new file mode 100644 index 00000000..5e4616f5 --- /dev/null +++ b/cove_ocds/migrations/0004_supplieddata_expired.py @@ -0,0 +1,17 @@ +# Generated by Django 4.2.16 on 2024-10-21 02:02 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("cove_ocds", "0003_remove_supplieddata_current_app_and_more"), + ] + + operations = [ + migrations.AddField( + model_name="supplieddata", + name="expired", + field=models.BooleanField(default=False), + ), + ] diff --git a/requirements.in b/requirements.in index 7412b83d..b6476e12 100644 --- a/requirements.in +++ b/requirements.in @@ -4,5 +4,6 @@ flattentool gunicorn[setproctitle] libcove libcoveocds[perf,web] +requests sentry-sdk werkzeug diff --git a/requirements.txt b/requirements.txt index 45880dae..801192c3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -105,6 +105,7 @@ referencing==0.29.1 # libcoveocds requests==2.32.3 # via + # -r requirements.in # libcove # libcoveocds # ocdsextensionregistry diff --git a/requirements_dev.in b/requirements_dev.in index 83e78982..ae7fb3fa 100644 --- a/requirements_dev.in +++ b/requirements_dev.in @@ -6,5 +6,4 @@ libsass pytest pytest-django pytest-localserver -requests selenium diff --git a/requirements_dev.txt b/requirements_dev.txt index 3487c818..ce4b8ee7 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -194,7 +194,6 @@ referencing==0.29.1 requests==2.32.3 # via # -r requirements.txt - # -r requirements_dev.in # libcove # libcoveocds # ocdsextensionregistry From 41a1f4fb4f6ea187b25d3b1a1755306a7e40528c Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Mon, 21 Oct 2024 01:21:30 -0400 Subject: [PATCH 20/37] build: Upgrade ocdsextensionregistry --- requirements.txt | 2 +- requirements_dev.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 801192c3..26c99c91 100644 --- a/requirements.txt +++ b/requirements.txt @@ -77,7 +77,7 @@ markupsafe==3.0.2 # via werkzeug mdurl==0.1.2 # via markdown-it-py -ocdsextensionregistry==0.4.0 +ocdsextensionregistry==0.5.0 # via libcoveocds odfpy==1.4.1 # via flattentool diff --git a/requirements_dev.txt b/requirements_dev.txt index ce4b8ee7..a5e79bff 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -134,7 +134,7 @@ mdurl==0.1.2 # via # -r requirements.txt # markdown-it-py -ocdsextensionregistry==0.4.0 +ocdsextensionregistry==0.5.0 # via # -r requirements.txt # libcoveocds From f884750ab51b245143d81bff97cc139081020ce2 Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Mon, 21 Oct 2024 01:21:49 -0400 Subject: [PATCH 21/37] fix: Fix conditions for tabular files. Remove unnecessary filters, allow_direct_web_fetch and VALIDATION_ERROR_LOCATIONS_LENGTH. --- core/settings.py | 1 - cove_ocds/html_error_msg.py | 29 +- cove_ocds/templates/explore.html | 10 +- cove_ocds/templates/modal_errors.html | 16 +- cove_ocds/templates/validation_table.html | 4 +- cove_ocds/templatetags/cove_ocds.py | 54 +- cove_ocds/views.py | 43 +- docs/architecture.rst | 2 +- tests/fixtures/1001_empty_releases.json | 900 ---------------------- tests/fixtures/999_empty_releases.json | 900 ---------------------- tests/test_functional.py | 53 +- 11 files changed, 91 insertions(+), 1921 deletions(-) diff --git a/core/settings.py b/core/settings.py index 03d74f66..7aa1bdb9 100644 --- a/core/settings.py +++ b/core/settings.py @@ -249,7 +249,6 @@ DELETE_FILES_AFTER_DAYS = int(os.getenv("DELETE_FILES_AFTER_DAYS", "90")) REQUESTS_TIMEOUT = int(os.getenv("REQUESTS_TIMEOUT", "10")) SUPPORT_EMAIL = "data@open-contracting.org" -VALIDATION_ERROR_LOCATIONS_LENGTH = int(os.getenv("VALIDATION_ERROR_LOCATIONS_LENGTH", "100")) USER_AGENT = os.getenv( "USER_AGENT", "DataReviewTool/1.0 (+https://review.standard.open-contracting.org; data@open-contracting.org)" ) diff --git a/cove_ocds/html_error_msg.py b/cove_ocds/html_error_msg.py index 428050df..283715f9 100644 --- a/cove_ocds/html_error_msg.py +++ b/cove_ocds/html_error_msg.py @@ -2,7 +2,7 @@ import json -from django.utils.html import escape, format_html +from django.utils.html import escape, format_html, mark_safe from django.utils.translation import gettext_lazy as _ from django.utils.translation import ngettext from libcove.lib.tools import decimal_default @@ -38,6 +38,33 @@ def json_repr(s): def html_error_msg(error): + if error["error_id"] == "releases_both_embedded_and_linked": + return _( + "This array should contain either entirely embedded releases or " + "linked releases. Embedded releases contain an 'id' whereas linked " + "releases do not. Your releases contain a mixture." + ) + + if error["error_id"] == "oneOf_any": + return _("%s is not valid under any of the given schemas") % (json_repr(error["instance"]),) + + if error["error_id"] == "oneOf_each": + return _("%(instance)s is valid under each of %(reprs)s") % { + "instance": json_repr(error["instance"]), + "reprs": error.get("reprs"), + } + + if error["message_type"] == "date-time": + return mark_safe( + _( + # https://github.com/open-contracting/lib-cove-ocds/blob/main/libcoveocds/common_checks.py + "Incorrect date format. Dates should use the form YYYY-MM-DDT00:00:00Z. Learn more about " + 'dates in OCDS.' + ) + ) + + # https://github.com/OpenDataServices/lib-cove-web/blob/main/cove/html_error_msg.py + # This should not happen for json schema validation, but may happen for # other forms of validation, e.g. XML for IATI if "validator" not in error: diff --git a/cove_ocds/templates/explore.html b/cove_ocds/templates/explore.html index 27afa635..17750c6b 100644 --- a/cove_ocds/templates/explore.html +++ b/cove_ocds/templates/explore.html @@ -202,7 +202,7 @@

    - {% if file_type == 'xlsx' or file_type == 'csv' %} + {% if file_type != 'json' %}

    {% blocktrans %}In order to check your data we need to convert it. During that conversion we found the following issues:{% endblocktrans %}

    {% endif %}
      @@ -219,7 +219,7 @@

      {% if validation_errors %} {% for error_json, values in validation_errors %} {% with error=error_json|json_decode %} - {% cove_modal_errors className="validation-errors-"|concat:error_prefix|concat:forloop.counter modalTitle=error.message errorList=values file_type=file_type full_table=True %} + {% include "modal_errors.html" with className="validation-errors-"|concat:error_prefix|concat:forloop.counter modalTitle=error.message errorList=values file_type=file_type full_table=True %} {% endwith %} {% endfor %} @@ -243,7 +243,7 @@

      {% if validation_errors %} {% for error_json, values in validation_errors %} {% with error=error_json|json_decode %} - {% cove_modal_errors className="validation-errors-"|concat:error_prefix|concat:forloop.counter modalTitle=error.message errorList=values file_type=file_type full_table=True %} + {% include "modal_errors.html" with className="validation-errors-"|concat:error_prefix|concat:forloop.counter modalTitle=error.message errorList=values file_type=file_type full_table=True %} {% endwith %} {% endfor %} @@ -267,7 +267,7 @@

      {% if validation_errors %} {% for error_json, values in validation_errors %} {% with error=error_json|json_decode %} - {% cove_modal_errors className="validation-errors-"|concat:error_prefix|concat:forloop.counter modalTitle=error.message errorList=values file_type=file_type full_table=True %} + {% include "modal_errors.html" with className="validation-errors-"|concat:error_prefix|concat:forloop.counter modalTitle=error.message errorList=values file_type=file_type full_table=True %} {% endwith %} {% endfor %} @@ -537,7 +537,7 @@

      {% for type, values in additional_checks.items %} - {% cove_modal_errors className="additional-checks-"|concat:forloop.counter modalTitle="" errorList=values|dictsort:"json_location"|list_from_attribute:"json_location" file_type=file_type full_table=False %} + {% include "modal_errors.html" with className="additional-checks-"|concat:forloop.counter modalTitle="" errorList=values|dictsort:"json_location"|list_from_attribute:"json_location" file_type=file_type full_table=False %} {% endfor %}

    diff --git a/cove_ocds/templates/modal_errors.html b/cove_ocds/templates/modal_errors.html index 4ea8a41e..f5565192 100644 --- a/cove_ocds/templates/modal_errors.html +++ b/cove_ocds/templates/modal_errors.html @@ -1,5 +1,7 @@ {% load i18n %} {% load cove_ocds %} +{# To change the sample size, change all occurrences of 100 in this file only. #} + {% endblock %} diff --git a/cove_ocds/templates/error.html b/cove_ocds/templates/error.html index 0e2d2961..d0280c26 100644 --- a/cove_ocds/templates/error.html +++ b/cove_ocds/templates/error.html @@ -11,7 +11,7 @@ {{ message | linebreaks }}

    - {% blocktrans sentry=request.sentry.id %}If you think this is a bug, you can file an issue publicly on GitHub or get in touch via email, referencing this error as {{ sentry }}.{% endblocktrans %} + {% blocktrans with sentry=request.sentry.id %}If you think this is a bug, you can file an issue publicly on GitHub or get in touch via email, referencing this error as {{ sentry }}.{% endblocktrans %}

    From 693a5739ed480a6c56c605a7f77dd2cf5c274948 Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Mon, 21 Oct 2024 10:20:35 -0400 Subject: [PATCH 26/37] i18n: Fix translated strings that are broken sentences --- cove_ocds/locale/en/LC_MESSAGES/django.po | 152 ++++++++++---------- cove_ocds/locale/es/LC_MESSAGES/django.po | 165 +++++++++++----------- cove_ocds/templates/base.html | 4 +- cove_ocds/templates/explore.html | 8 +- 4 files changed, 170 insertions(+), 159 deletions(-) diff --git a/cove_ocds/locale/en/LC_MESSAGES/django.po b/cove_ocds/locale/en/LC_MESSAGES/django.po index d7abf472..13fe8e35 100644 --- a/cove_ocds/locale/en/LC_MESSAGES/django.po +++ b/cove_ocds/locale/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-21 05:36+0000\n" +"POT-Creation-Date: 2024-10-21 14:17+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -252,14 +252,14 @@ msgid "" msgstr "" #: cove_ocds/templates/additional_codelist_values.html:7 -#: cove_ocds/templates/explore.html:401 cove_ocds/templates/explore.html:447 -#: cove_ocds/templates/explore.html:560 +#: cove_ocds/templates/explore.html:407 cove_ocds/templates/explore.html:453 +#: cove_ocds/templates/explore.html:566 msgid "Field" msgstr "" #: cove_ocds/templates/additional_codelist_values.html:8 -#: cove_ocds/templates/explore.html:402 cove_ocds/templates/explore.html:448 -#: cove_ocds/templates/explore.html:562 +#: cove_ocds/templates/explore.html:408 cove_ocds/templates/explore.html:454 +#: cove_ocds/templates/explore.html:568 msgid "Path to Field" msgstr "" @@ -272,7 +272,7 @@ msgid "Additional Values Used" msgstr "" #: cove_ocds/templates/base.html:31 -msgid " Data Review Tool" +msgid "Data Review Tool" msgstr "" #: cove_ocds/templates/base.html:53 @@ -464,89 +464,91 @@ msgstr "" msgid "Schema Extensions" msgstr "" -#: cove_ocds/templates/explore.html:149 -msgid "Your data contains the following schema extensions" +#: cove_ocds/templates/explore.html:151 +msgid "Your data contains the following schema extensions:" msgstr "" -#: cove_ocds/templates/explore.html:149 -msgid ", but it wasn't possible to fetch them" +#: cove_ocds/templates/explore.html:153 +msgid "" +"Your data contains the following schema extensions, but it wasn't possible " +"to fetch them:" msgstr "" -#: cove_ocds/templates/explore.html:155 +#: cove_ocds/templates/explore.html:161 msgid "release schema" msgstr "" -#: cove_ocds/templates/explore.html:172 +#: cove_ocds/templates/explore.html:178 msgid "The following extensions failed:" msgstr "" -#: cove_ocds/templates/explore.html:182 +#: cove_ocds/templates/explore.html:188 msgid "" "Only those extensions successfully fetched were applied to extend the schema." msgstr "" -#: cove_ocds/templates/explore.html:184 +#: cove_ocds/templates/explore.html:190 msgid "All the extensions above were applied to extend the schema." msgstr "" -#: cove_ocds/templates/explore.html:186 +#: cove_ocds/templates/explore.html:192 msgid "Get a copy of the schema with extension patches applied" msgstr "" -#: cove_ocds/templates/explore.html:188 +#: cove_ocds/templates/explore.html:194 msgid "" "None of the extensions above could be applied. Your data has been checked " "against a schema with no extensions." msgstr "" -#: cove_ocds/templates/explore.html:201 +#: cove_ocds/templates/explore.html:207 msgid "Conversion Errors" msgstr "" -#: cove_ocds/templates/explore.html:206 +#: cove_ocds/templates/explore.html:212 msgid "" "In order to check your data we need to convert it. During that conversion we " "found the following issues:" msgstr "" -#: cove_ocds/templates/explore.html:230 +#: cove_ocds/templates/explore.html:236 msgid "Structural Errors - Required Fields" msgstr "" -#: cove_ocds/templates/explore.html:234 +#: cove_ocds/templates/explore.html:240 msgid "" "Some or all of your data is missing fields which are required by the OCDS " "schema." msgstr "" -#: cove_ocds/templates/explore.html:254 +#: cove_ocds/templates/explore.html:260 msgid "Structural Errors - Format" msgstr "" -#: cove_ocds/templates/explore.html:258 +#: cove_ocds/templates/explore.html:264 msgid "" "Some or all of your data includes fields which are incorrectly formatted." msgstr "" -#: cove_ocds/templates/explore.html:278 +#: cove_ocds/templates/explore.html:284 msgid "Structural Errors - Other" msgstr "" -#: cove_ocds/templates/explore.html:282 +#: cove_ocds/templates/explore.html:288 msgid "Some or all of your data has validation errors." msgstr "" -#: cove_ocds/templates/explore.html:295 cove_ocds/templates/explore.html:627 -#: cove_ocds/templates/explore.html:630 +#: cove_ocds/templates/explore.html:301 cove_ocds/templates/explore.html:633 +#: cove_ocds/templates/explore.html:636 msgid "Structure Warnings" msgstr "" -#: cove_ocds/templates/explore.html:300 cove_ocds/templates/explore.html:338 +#: cove_ocds/templates/explore.html:306 cove_ocds/templates/explore.html:344 msgid "" "Fixing the following issues will improve the interoperability of your data." msgstr "" -#: cove_ocds/templates/explore.html:306 +#: cove_ocds/templates/explore.html:312 #, python-format msgid "" "We found %(n_missing)s object within an array in your data " @@ -557,28 +559,28 @@ msgid_plural "" msgstr[0] "" msgstr[1] "" -#: cove_ocds/templates/explore.html:307 +#: cove_ocds/templates/explore.html:313 msgid "" "This may affect the creation of OCDS records, and conversion of data into " "other formats. We recommend that all objects within an array should have an " "id set." msgstr "" -#: cove_ocds/templates/explore.html:308 cove_ocds/templates/explore.html:345 -#: cove_ocds/templates/explore.html:633 +#: cove_ocds/templates/explore.html:314 cove_ocds/templates/explore.html:351 +#: cove_ocds/templates/explore.html:639 msgid "View all errors ▼" msgstr "" -#: cove_ocds/templates/explore.html:312 +#: cove_ocds/templates/explore.html:318 msgid "Path to missing ID" msgstr "" -#: cove_ocds/templates/explore.html:333 cove_ocds/templates/explore.html:615 -#: cove_ocds/templates/explore.html:618 +#: cove_ocds/templates/explore.html:339 cove_ocds/templates/explore.html:621 +#: cove_ocds/templates/explore.html:624 msgid "Conformance (Rules)" msgstr "" -#: cove_ocds/templates/explore.html:344 +#: cove_ocds/templates/explore.html:350 #, python-format msgid "" "%(n_prefixes)s of your ocid fields has a " @@ -589,35 +591,35 @@ msgid_plural "" msgstr[0] "" msgstr[1] "" -#: cove_ocds/templates/explore.html:344 +#: cove_ocds/templates/explore.html:350 msgid "there is no prefix or the prefix format is not recognised." msgstr "" -#: cove_ocds/templates/explore.html:349 +#: cove_ocds/templates/explore.html:355 msgid "ocid" msgstr "" -#: cove_ocds/templates/explore.html:349 +#: cove_ocds/templates/explore.html:355 msgid "Path" msgstr "" -#: cove_ocds/templates/explore.html:357 +#: cove_ocds/templates/explore.html:363 #, python-format msgid " What is the ocid field? %(description)s " msgstr "" -#: cove_ocds/templates/explore.html:357 +#: cove_ocds/templates/explore.html:363 #, python-format msgid "" "For more information see Open Contracting Identifier " "guidance" msgstr "" -#: cove_ocds/templates/explore.html:371 +#: cove_ocds/templates/explore.html:377 msgid "Codelist Errors" msgstr "" -#: cove_ocds/templates/explore.html:376 +#: cove_ocds/templates/explore.html:382 msgid "" "The fields below use closed codelists. When using these fields, you " "must use one of the pre-defined codelist values. If you use a " @@ -627,7 +629,7 @@ msgid "" "extensions." msgstr "" -#: cove_ocds/templates/explore.html:380 +#: cove_ocds/templates/explore.html:386 msgid "" "You may need to create a mapping between your local codes and the OCDS " "closed codelists to address these errors. In most cases, there will be a " @@ -636,11 +638,11 @@ msgid "" "used in these closed codelist fields." msgstr "" -#: cove_ocds/templates/explore.html:391 +#: cove_ocds/templates/explore.html:397 msgid "Additional Fields" msgstr "" -#: cove_ocds/templates/explore.html:395 +#: cove_ocds/templates/explore.html:401 msgid "" "This data includes the following fields which are not part of the OCDS " "schema. You should check whether the data in these fields could be provided " @@ -649,33 +651,33 @@ msgid "" "\">extension to the schema." msgstr "" -#: cove_ocds/templates/explore.html:403 cove_ocds/templates/explore.html:449 -#: cove_ocds/templates/explore.html:563 +#: cove_ocds/templates/explore.html:409 cove_ocds/templates/explore.html:455 +#: cove_ocds/templates/explore.html:569 msgid "Usage Count" msgstr "" -#: cove_ocds/templates/explore.html:404 cove_ocds/templates/explore.html:450 +#: cove_ocds/templates/explore.html:410 cove_ocds/templates/explore.html:456 msgid "Examples (first 3)" msgstr "" -#: cove_ocds/templates/explore.html:405 +#: cove_ocds/templates/explore.html:411 msgid "Child Fields" msgstr "" -#: cove_ocds/templates/explore.html:423 +#: cove_ocds/templates/explore.html:429 msgid "(See child fields)" msgstr "" -#: cove_ocds/templates/explore.html:440 +#: cove_ocds/templates/explore.html:446 #, python-format msgid "Child fields of %(parent_full_path)s" msgstr "" -#: cove_ocds/templates/explore.html:486 +#: cove_ocds/templates/explore.html:492 msgid "Additional Codelist Values" msgstr "" -#: cove_ocds/templates/explore.html:490 +#: cove_ocds/templates/explore.html:496 msgid "" "Your data contains a number of fields that use an open codelist. You should " "use values from the codelist whenever possible, but if the codelist does not " @@ -686,7 +688,7 @@ msgid "" "(-) by one or more extensions." msgstr "" -#: cove_ocds/templates/explore.html:496 +#: cove_ocds/templates/explore.html:502 msgid "" "Make sure you list the definition of any additional codelist values you " "include within your OCDS issue tracker." msgstr "" -#: cove_ocds/templates/explore.html:506 +#: cove_ocds/templates/explore.html:512 msgid "Additional Checks" msgstr "" -#: cove_ocds/templates/explore.html:514 +#: cove_ocds/templates/explore.html:520 msgid "Check Description" msgstr "" -#: cove_ocds/templates/explore.html:515 +#: cove_ocds/templates/explore.html:521 #: cove_ocds/templates/validation_table.html:10 msgid "Location of first 3 errors" msgstr "" -#: cove_ocds/templates/explore.html:522 +#: cove_ocds/templates/explore.html:528 msgid "" "The data includes fields that are empty or contain only whitespaces. Fields " "that are not being used, or that have no value, should be excluded in their " "entirety (key and value) from the data" msgstr "" -#: cove_ocds/templates/explore.html:529 +#: cove_ocds/templates/explore.html:535 msgid "see all" msgstr "" -#: cove_ocds/templates/explore.html:552 cove_ocds/templates/explore.html:651 -#: cove_ocds/templates/explore.html:654 +#: cove_ocds/templates/explore.html:558 cove_ocds/templates/explore.html:657 +#: cove_ocds/templates/explore.html:660 msgid "Deprecated Fields" msgstr "" -#: cove_ocds/templates/explore.html:552 +#: cove_ocds/templates/explore.html:558 msgid "" "Fields flagged as 'deprecated' will be either replaced or removed in future " "versions of the schema." msgstr "" -#: cove_ocds/templates/explore.html:561 +#: cove_ocds/templates/explore.html:567 msgid "Details" msgstr "" -#: cove_ocds/templates/explore.html:569 +#: cove_ocds/templates/explore.html:575 msgid "Learn more about deprecated fields" msgstr "" -#: cove_ocds/templates/explore.html:576 +#: cove_ocds/templates/explore.html:582 #, python-format msgid "Deprecated in %(version)s:" msgstr "" -#: cove_ocds/templates/explore.html:595 +#: cove_ocds/templates/explore.html:601 msgid "Save or Share these results" msgstr "" -#: cove_ocds/templates/explore.html:596 +#: cove_ocds/templates/explore.html:602 msgid "Use the following url to share these results:" msgstr "" -#: cove_ocds/templates/explore.html:600 +#: cove_ocds/templates/explore.html:606 #, python-format msgid "" "These results will be available for %(delete_files_after_days)s days from " @@ -760,7 +762,7 @@ msgid "" "then." msgstr "" -#: cove_ocds/templates/explore.html:601 +#: cove_ocds/templates/explore.html:607 #, python-format msgid "" "After %(delete_files_after_days)s days all uploaded data is deleted from our " @@ -769,24 +771,24 @@ msgid "" "been removed." msgstr "" -#: cove_ocds/templates/explore.html:609 cove_ocds/templates/explore.html:612 +#: cove_ocds/templates/explore.html:615 cove_ocds/templates/explore.html:618 msgid "Structural Errors" msgstr "" -#: cove_ocds/templates/explore.html:621 +#: cove_ocds/templates/explore.html:627 msgid "view all errors ▼" msgstr "" -#: cove_ocds/templates/explore.html:624 cove_ocds/templates/explore.html:636 -#: cove_ocds/templates/explore.html:642 +#: cove_ocds/templates/explore.html:630 cove_ocds/templates/explore.html:642 +#: cove_ocds/templates/explore.html:648 msgid "View all errors ▲" msgstr "" -#: cove_ocds/templates/explore.html:639 +#: cove_ocds/templates/explore.html:645 msgid "Quality Warnings" msgstr "" -#: cove_ocds/templates/explore.html:645 cove_ocds/templates/explore.html:648 +#: cove_ocds/templates/explore.html:651 cove_ocds/templates/explore.html:654 msgid "Additional Fields (fields in data not in schema)" msgstr "" diff --git a/cove_ocds/locale/es/LC_MESSAGES/django.po b/cove_ocds/locale/es/LC_MESSAGES/django.po index 508128ff..af6619db 100644 --- a/cove_ocds/locale/es/LC_MESSAGES/django.po +++ b/cove_ocds/locale/es/LC_MESSAGES/django.po @@ -15,7 +15,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-21 05:37+0000\n" +"POT-Creation-Date: 2024-10-21 14:17+0000\n" "PO-Revision-Date: 2020-09-08 08:53+0000\n" "Last-Translator: James McKinney, 2024\n" "Language-Team: Spanish (https://app.transifex.com/open-contracting-" @@ -286,19 +286,18 @@ msgid "" msgstr "" "Nuestro equipo de desarrollo ha sido informado de este error de forma " "automática. Si usted póngase " -"en contacto,por favor haga referencia a este error como " -"%(sentry)s." +"subject=Data%%20Review%%20Tool%%20error%%20%(sentry)s\">póngase en contacto,por favor haga referencia a este error como %(sentry)s." #: cove_ocds/templates/additional_codelist_values.html:7 -#: cove_ocds/templates/explore.html:401 cove_ocds/templates/explore.html:447 -#: cove_ocds/templates/explore.html:560 +#: cove_ocds/templates/explore.html:407 cove_ocds/templates/explore.html:453 +#: cove_ocds/templates/explore.html:566 msgid "Field" msgstr "Campo" #: cove_ocds/templates/additional_codelist_values.html:8 -#: cove_ocds/templates/explore.html:402 cove_ocds/templates/explore.html:448 -#: cove_ocds/templates/explore.html:562 +#: cove_ocds/templates/explore.html:408 cove_ocds/templates/explore.html:454 +#: cove_ocds/templates/explore.html:568 msgid "Path to Field" msgstr "Ruta al Campo" @@ -311,8 +310,8 @@ msgid "Additional Values Used" msgstr "Valores Adicionales Usados" #: cove_ocds/templates/base.html:31 -msgid " Data Review Tool" -msgstr "Herramienta de revisión de datos" +msgid "Data Review Tool" +msgstr "Herramienta de revisión de datos" #: cove_ocds/templates/base.html:53 msgid "Go" @@ -541,38 +540,42 @@ msgstr "" msgid "Schema Extensions" msgstr "Extensiones del Esquema" -#: cove_ocds/templates/explore.html:149 -msgid "Your data contains the following schema extensions" -msgstr "Los datos contienen las siguientes extensiones de esquema" +#: cove_ocds/templates/explore.html:151 +msgid "Your data contains the following schema extensions:" +msgstr "Los datos contienen las siguientes extensiones de esquema:" -#: cove_ocds/templates/explore.html:149 -msgid ", but it wasn't possible to fetch them" -msgstr ", pero no fue posible recuperarlos " +#: cove_ocds/templates/explore.html:153 +msgid "" +"Your data contains the following schema extensions, but it wasn't possible " +"to fetch them:" +msgstr "" +"Los datos contienen las siguientes extensiones de esquema, pero no fue " +"posible recuperarlos:" -#: cove_ocds/templates/explore.html:155 +#: cove_ocds/templates/explore.html:161 msgid "release schema" msgstr "esquema de entrega" -#: cove_ocds/templates/explore.html:172 +#: cove_ocds/templates/explore.html:178 msgid "The following extensions failed:" msgstr "Las siguientes extensiones fallaron:" -#: cove_ocds/templates/explore.html:182 +#: cove_ocds/templates/explore.html:188 msgid "" "Only those extensions successfully fetched were applied to extend the schema." msgstr "" "Solo las extensiones obtenidas con éxito se aplicaron para ampliar el " "esquema." -#: cove_ocds/templates/explore.html:184 +#: cove_ocds/templates/explore.html:190 msgid "All the extensions above were applied to extend the schema." msgstr "Todas las extensiones anteriores se aplicaron para ampliar el esquema." -#: cove_ocds/templates/explore.html:186 +#: cove_ocds/templates/explore.html:192 msgid "Get a copy of the schema with extension patches applied" msgstr "Obtenga una copia del esquema con los parches de extensión aplicados" -#: cove_ocds/templates/explore.html:188 +#: cove_ocds/templates/explore.html:194 msgid "" "None of the extensions above could be applied. Your data has been checked " "against a schema with no extensions." @@ -580,11 +583,11 @@ msgstr "" "No se pudo aplicar ninguna de las extensiones anteriores. Sus datos han sido " "comparados con un esquema sin extensiones." -#: cove_ocds/templates/explore.html:201 +#: cove_ocds/templates/explore.html:207 msgid "Conversion Errors" msgstr "Errores de Conversión" -#: cove_ocds/templates/explore.html:206 +#: cove_ocds/templates/explore.html:212 msgid "" "In order to check your data we need to convert it. During that conversion we " "found the following issues:" @@ -592,49 +595,49 @@ msgstr "" "Para verificar sus datos, necesitamos convertirlos. Durante esta conversión, " "encontramos los siguientes problemas:" -#: cove_ocds/templates/explore.html:230 +#: cove_ocds/templates/explore.html:236 msgid "Structural Errors - Required Fields" msgstr "Errores Estructurales - Campos Requeridos" -#: cove_ocds/templates/explore.html:234 +#: cove_ocds/templates/explore.html:240 msgid "" "Some or all of your data is missing fields which are required by the OCDS " "schema." msgstr "" "En alguno o todos tus datos faltan campos requeridos por el esquema OCDS." -#: cove_ocds/templates/explore.html:254 +#: cove_ocds/templates/explore.html:260 msgid "Structural Errors - Format" msgstr "Errores Estructurales - Formato" -#: cove_ocds/templates/explore.html:258 +#: cove_ocds/templates/explore.html:264 msgid "" "Some or all of your data includes fields which are incorrectly formatted." msgstr "" "Alguno o todos tus datos incluyen campos que están formateados " "incorrectamente." -#: cove_ocds/templates/explore.html:278 +#: cove_ocds/templates/explore.html:284 msgid "Structural Errors - Other" msgstr "Errores Estructurales - Otro" -#: cove_ocds/templates/explore.html:282 +#: cove_ocds/templates/explore.html:288 msgid "Some or all of your data has validation errors." msgstr "Alguno o todos tus datos tienen errores de validación." -#: cove_ocds/templates/explore.html:295 cove_ocds/templates/explore.html:627 -#: cove_ocds/templates/explore.html:630 +#: cove_ocds/templates/explore.html:301 cove_ocds/templates/explore.html:633 +#: cove_ocds/templates/explore.html:636 msgid "Structure Warnings" msgstr "Advertencias de Estructura" -#: cove_ocds/templates/explore.html:300 cove_ocds/templates/explore.html:338 +#: cove_ocds/templates/explore.html:306 cove_ocds/templates/explore.html:344 msgid "" "Fixing the following issues will improve the interoperability of your data." msgstr "" "La resolución de los siguientes problemas mejorará la interoperabilidad de " "sus datos." -#: cove_ocds/templates/explore.html:306 +#: cove_ocds/templates/explore.html:312 #, python-format msgid "" "We found %(n_missing)s object within an array in your data " @@ -652,7 +655,7 @@ msgstr[2] "" "Encontramos %(n_missing)s objetos dentro de la lista de sus " "datos sin una propiedad id." -#: cove_ocds/templates/explore.html:307 +#: cove_ocds/templates/explore.html:313 msgid "" "This may affect the creation of OCDS records, and conversion of data into " "other formats. We recommend that all objects within an array should have an " @@ -662,21 +665,21 @@ msgstr "" "datos a otros formatos. Recomendamos que todos los objetos en un array " "tengan una id." -#: cove_ocds/templates/explore.html:308 cove_ocds/templates/explore.html:345 -#: cove_ocds/templates/explore.html:633 +#: cove_ocds/templates/explore.html:314 cove_ocds/templates/explore.html:351 +#: cove_ocds/templates/explore.html:639 msgid "View all errors ▼" msgstr "Vea todos los errores ▼" -#: cove_ocds/templates/explore.html:312 +#: cove_ocds/templates/explore.html:318 msgid "Path to missing ID" msgstr "Ruta a la ID ausente" -#: cove_ocds/templates/explore.html:333 cove_ocds/templates/explore.html:615 -#: cove_ocds/templates/explore.html:618 +#: cove_ocds/templates/explore.html:339 cove_ocds/templates/explore.html:621 +#: cove_ocds/templates/explore.html:624 msgid "Conformance (Rules)" msgstr "Conformidad (Reglas)" -#: cove_ocds/templates/explore.html:344 +#: cove_ocds/templates/explore.html:350 #, python-format msgid "" "%(n_prefixes)s of your ocid fields has a " @@ -694,24 +697,24 @@ msgstr[2] "" "%(n_prefixes)s de sus campos ocid tienen un " "problema:" -#: cove_ocds/templates/explore.html:344 +#: cove_ocds/templates/explore.html:350 msgid "there is no prefix or the prefix format is not recognised." msgstr "no hay prefijo o el formato de prefijo no es reconocido" -#: cove_ocds/templates/explore.html:349 +#: cove_ocds/templates/explore.html:355 msgid "ocid" msgstr "ocid" -#: cove_ocds/templates/explore.html:349 +#: cove_ocds/templates/explore.html:355 msgid "Path" msgstr "Ruta" -#: cove_ocds/templates/explore.html:357 +#: cove_ocds/templates/explore.html:363 #, python-format msgid " What is the ocid field? %(description)s " msgstr "Cuál es el campo de (ocid)? %(description)s" -#: cove_ocds/templates/explore.html:357 +#: cove_ocds/templates/explore.html:363 #, python-format msgid "" "For more information see Open Contracting Identifier " @@ -720,11 +723,11 @@ msgstr "" "Para mas información vea Guía para indentificadores de " "Contratos Abiertos" -#: cove_ocds/templates/explore.html:371 +#: cove_ocds/templates/explore.html:377 msgid "Codelist Errors" msgstr "Errores de la Lista de Códigos" -#: cove_ocds/templates/explore.html:376 +#: cove_ocds/templates/explore.html:382 msgid "" "The fields below use closed codelists. When using these fields, you " "must use one of the pre-defined codelist values. If you use a " @@ -740,7 +743,7 @@ msgstr "" "+ o - esto indica que la lista de códigos ha sido modificada con estas " "adiciones (+) o sustracciones (-) por una o más extensiones." -#: cove_ocds/templates/explore.html:380 +#: cove_ocds/templates/explore.html:386 msgid "" "You may need to create a mapping between your local codes and the OCDS " "closed codelists to address these errors. In most cases, there will be a " @@ -754,11 +757,11 @@ msgstr "" "códigos locales. Si ya ha completado un mapeo, favor revise la ortografía y " "las mayúsculas utilizadas en estos campos cerrados de la lista de códigos." -#: cove_ocds/templates/explore.html:391 +#: cove_ocds/templates/explore.html:397 msgid "Additional Fields" msgstr "Campos adicionales" -#: cove_ocds/templates/explore.html:395 +#: cove_ocds/templates/explore.html:401 msgid "" "This data includes the following fields which are not part of the OCDS " "schema. You should check whether the data in these fields could be provided " @@ -772,33 +775,33 @@ msgstr "" "standard.open-contracting.org/latest/en/extensions/\">extensión " "existente del esquema." -#: cove_ocds/templates/explore.html:403 cove_ocds/templates/explore.html:449 -#: cove_ocds/templates/explore.html:563 +#: cove_ocds/templates/explore.html:409 cove_ocds/templates/explore.html:455 +#: cove_ocds/templates/explore.html:569 msgid "Usage Count" msgstr "Número total de usos" -#: cove_ocds/templates/explore.html:404 cove_ocds/templates/explore.html:450 +#: cove_ocds/templates/explore.html:410 cove_ocds/templates/explore.html:456 msgid "Examples (first 3)" msgstr "Ejemplos (las primeras 3 ocurrencias)" -#: cove_ocds/templates/explore.html:405 +#: cove_ocds/templates/explore.html:411 msgid "Child Fields" msgstr "Campos hijos" -#: cove_ocds/templates/explore.html:423 +#: cove_ocds/templates/explore.html:429 msgid "(See child fields)" msgstr "(Vea todos los campos secundarios)" -#: cove_ocds/templates/explore.html:440 +#: cove_ocds/templates/explore.html:446 #, python-format msgid "Child fields of %(parent_full_path)s" msgstr "Campos hijos de %(parent_full_path)s" -#: cove_ocds/templates/explore.html:486 +#: cove_ocds/templates/explore.html:492 msgid "Additional Codelist Values" msgstr "Valores Adicionales de Listas de Códigos" -#: cove_ocds/templates/explore.html:490 +#: cove_ocds/templates/explore.html:496 msgid "" "Your data contains a number of fields that use an open codelist. You should " "use values from the codelist whenever possible, but if the codelist does not " @@ -817,7 +820,7 @@ msgstr "" "de códigos ha sido modificada con estas adiciones (+) o sustracciones (-) " "por una o más extensiones." -#: cove_ocds/templates/explore.html:496 +#: cove_ocds/templates/explore.html:502 msgid "" "Make sure you list the definition of any additional codelist values you " "include within your gestor de " "incidencias de OCDS ." -#: cove_ocds/templates/explore.html:506 +#: cove_ocds/templates/explore.html:512 msgid "Additional Checks" msgstr "Comprobaciones adicionales" -#: cove_ocds/templates/explore.html:514 +#: cove_ocds/templates/explore.html:520 msgid "Check Description" msgstr "Compruebe la Descripción" -#: cove_ocds/templates/explore.html:515 +#: cove_ocds/templates/explore.html:521 #: cove_ocds/templates/validation_table.html:10 msgid "Location of first 3 errors" msgstr "Ubicación de los 3 primeros errores" -#: cove_ocds/templates/explore.html:522 +#: cove_ocds/templates/explore.html:528 msgid "" "The data includes fields that are empty or contain only whitespaces. Fields " "that are not being used, or that have no value, should be excluded in their " @@ -857,16 +860,16 @@ msgstr "" "blanco. Los campos que no se usan, o que no tienen ningún valor, deben " "excluirse en su totalidad (clave y valor) de los datos" -#: cove_ocds/templates/explore.html:529 +#: cove_ocds/templates/explore.html:535 msgid "see all" msgstr "ver todos" -#: cove_ocds/templates/explore.html:552 cove_ocds/templates/explore.html:651 -#: cove_ocds/templates/explore.html:654 +#: cove_ocds/templates/explore.html:558 cove_ocds/templates/explore.html:657 +#: cove_ocds/templates/explore.html:660 msgid "Deprecated Fields" msgstr "Campos Obsoletos" -#: cove_ocds/templates/explore.html:552 +#: cove_ocds/templates/explore.html:558 msgid "" "Fields flagged as 'deprecated' will be either replaced or removed in future " "versions of the schema." @@ -874,28 +877,28 @@ msgstr "" "Campos marcados como 'obsoletos' serán reemplazados o eliminados en futuras " "versiones del esquema." -#: cove_ocds/templates/explore.html:561 +#: cove_ocds/templates/explore.html:567 msgid "Details" msgstr "Detalles" -#: cove_ocds/templates/explore.html:569 +#: cove_ocds/templates/explore.html:575 msgid "Learn more about deprecated fields" msgstr "Obtener más información acerca de los campos obsoletos " -#: cove_ocds/templates/explore.html:576 +#: cove_ocds/templates/explore.html:582 #, python-format msgid "Deprecated in %(version)s:" msgstr "Obsoleto en %(version)s:" -#: cove_ocds/templates/explore.html:595 +#: cove_ocds/templates/explore.html:601 msgid "Save or Share these results" msgstr "Guardar o Compartir estos resultados" -#: cove_ocds/templates/explore.html:596 +#: cove_ocds/templates/explore.html:602 msgid "Use the following url to share these results:" msgstr "Use la siguiente url para compartir estos resultados: " -#: cove_ocds/templates/explore.html:600 +#: cove_ocds/templates/explore.html:606 #, python-format msgid "" "These results will be available for %(delete_files_after_days)s days from " @@ -906,7 +909,7 @@ msgstr "" "días desde el día en que los datos fueron subidos. Puede revisar estos " "resultados hasta entonces." -#: cove_ocds/templates/explore.html:601 +#: cove_ocds/templates/explore.html:607 #, python-format msgid "" "After %(delete_files_after_days)s days all uploaded data is deleted from our " @@ -919,24 +922,24 @@ msgstr "" "Cualquiera que use el enlace a esta página después de ese periodo verá un " "mensaje informando de que el archivo ha sido borrado." -#: cove_ocds/templates/explore.html:609 cove_ocds/templates/explore.html:612 +#: cove_ocds/templates/explore.html:615 cove_ocds/templates/explore.html:618 msgid "Structural Errors" msgstr "Errores Estructurales" -#: cove_ocds/templates/explore.html:621 +#: cove_ocds/templates/explore.html:627 msgid "view all errors ▼" msgstr "ver todos los errores ▼" -#: cove_ocds/templates/explore.html:624 cove_ocds/templates/explore.html:636 -#: cove_ocds/templates/explore.html:642 +#: cove_ocds/templates/explore.html:630 cove_ocds/templates/explore.html:642 +#: cove_ocds/templates/explore.html:648 msgid "View all errors ▲" msgstr "Vea todos los errores ▲" -#: cove_ocds/templates/explore.html:639 +#: cove_ocds/templates/explore.html:645 msgid "Quality Warnings" msgstr "Advertencias de Calidad" -#: cove_ocds/templates/explore.html:645 cove_ocds/templates/explore.html:648 +#: cove_ocds/templates/explore.html:651 cove_ocds/templates/explore.html:654 msgid "Additional Fields (fields in data not in schema)" msgstr "Campos adicionales (campos en los datos que no están en el esquema)" diff --git a/cove_ocds/templates/base.html b/cove_ocds/templates/base.html index 9f1d8c04..19ef9538 100644 --- a/cove_ocds/templates/base.html +++ b/cove_ocds/templates/base.html @@ -27,8 +27,8 @@