diff --git a/cove_ocds/locale/en/LC_MESSAGES/django.po b/cove_ocds/locale/en/LC_MESSAGES/django.po index aa7e5ca..cedaf46 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 38beb14..a2c2d57 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 ff10055..3a2c18e 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 %}:

    {% for ext_descriptor_url, ext_details in ext.items %} diff --git a/cove_ocds/templates/cove_ocds/explore_record.html b/cove_ocds/templates/cove_ocds/explore_record.html deleted file mode 100644 index 2af7dd5..0000000 --- a/cove_ocds/templates/cove_ocds/explore_record.html +++ /dev/null @@ -1,105 +0,0 @@ -{% extends 'cove_ocds/explore_base.html' %} -{% load i18n %} -{% load cove_tags %}{# subtract #} - -{% block key_facts %} -
    -
    -
    -

    {% trans 'Headlines' %}

    -
    -
    - {% if conversion_warning_messages %} -
    {% blocktrans %}Please read the conversion warnings below.{% endblocktrans %}
    - {% endif %} - -
    - {% if validation_errors or additional_closed_codelist_values %} - {% trans "Failed " %} - {% else %} - {% trans "Passed " %} - {% endif %} - {% 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 %} -
    • - {% 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 %} - - {% 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 %} - {% 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 %} - -
    • - {% if source_url %} - {% blocktrans %}Data downloaded from {{ source_url }} on {{ created_datetime }}.{% endblocktrans %} - {% else %} - {% blocktrans %}Data uploaded on {{ created_datetime }}.{% endblocktrans %} - {% endif %} -
    • -
    -
    -
    -
    -
    -{% endblock %} diff --git a/cove_ocds/templates/cove_ocds/explore_release.html b/cove_ocds/templates/cove_ocds/explore_release.html deleted file mode 100644 index 7066b0d..0000000 --- a/cove_ocds/templates/cove_ocds/explore_release.html +++ /dev/null @@ -1,105 +0,0 @@ -{% extends 'cove_ocds/explore_base.html' %} -{% load i18n %} -{% load cove_tags %}{# subtract #} - -{% block key_facts %} -
    -
    -
    -

    {% trans 'Headlines' %}

    -
    -
    - {% if conversion_warning_messages %} -
    {% blocktrans %}Please read the conversion warnings below.{% endblocktrans %}
    - {% endif %} - -
    - {% if validation_errors or additional_closed_codelist_values %} - {% trans "Failed " %} - {% else %} - {% trans "Passed " %} - {% endif %} - {% 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 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 %} -
    • - {% 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 %} - {% 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 %} - -
    • - {% if source_url %} - {% blocktrans %}Data downloaded from {{ source_url }} on {{ created_datetime }}.{% endblocktrans %} - {% else %} - {% blocktrans %}Data uploaded on {{ created_datetime }}.{% endblocktrans %} - {% endif %} -
    • -
    -
    -
    -
    -
    -{% endblock %} diff --git a/cove_ocds/util.py b/cove_ocds/util.py index 7365553..b5b1794 100644 --- a/cove_ocds/util.py +++ b/cove_ocds/util.py @@ -1,5 +1,4 @@ import json -import re from decimal import Decimal from django.utils.html import format_html, mark_safe @@ -63,13 +62,9 @@ def read_json(path): 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") - +def get_schema(lib_cove_ocds_config, package_data): 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, + 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, @@ -98,62 +93,7 @@ def get_schema(request, context, supplied_data, lib_cove_ocds_config, package_da } ) - 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 + return schema_ocds def default(obj): diff --git a/cove_ocds/views.py b/cove_ocds/views.py index 4311810..da50d54 100644 --- a/cove_ocds/views.py +++ b/cove_ocds/views.py @@ -1,6 +1,5 @@ import json import logging -import os import re import warnings from collections import defaultdict @@ -46,9 +45,7 @@ def explore_ocds(request, pk): if context["file_type"] == "json": package_data = util.read_json(supplied_data.original_file.path) - schema_ocds, schema_url, replace = util.get_schema( - request, context, supplied_data, lib_cove_ocds_config, package_data - ) + schema_ocds = util.get_schema(lib_cove_ocds_config, package_data) else: with warnings.catch_warnings(): warnings.filterwarnings("ignore", category=FlattenToolWarning) @@ -60,13 +57,15 @@ def explore_ocds(request, pk): context["file_type"], ) - meta_data.setdefault("version", "1.0") + meta_data.setdefault("version", "1.1") # Make "missing_package" pass. meta_data["releases"] = {} - schema_ocds, schema_url, replace = util.get_schema( - request, context, supplied_data, lib_cove_ocds_config, meta_data - ) + schema_ocds = util.get_schema(lib_cove_ocds_config, meta_data) + + # Used in conversions. + if schema_ocds.extensions: + schema_ocds.create_extended_schema_file(supplied_data.upload_dir(), supplied_data.upload_url()) with warnings.catch_warnings(): warnings.filterwarnings("ignore", category=FlattenToolWarning) @@ -87,9 +86,9 @@ def explore_ocds(request, pk): file_name=supplied_data.original_file.path, file_type=context["file_type"], lib_cove_config=lib_cove_ocds_config, - schema_url=schema_url, + # If the schema is not extended, extended_schema_file is None. + schema_url=schema_ocds.extended_schema_file or schema_ocds.schema_url, pkg_schema_url=schema_ocds.pkg_schema_url, - replace=replace, ) ) except FlattenToolValueError as err: @@ -120,10 +119,6 @@ def explore_ocds(request, pk): # 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) # Set by SchemaOCDS.get_schema_obj(deref=True), which, at the latest, is called indirectly by common_checks_ocds(). @@ -154,7 +149,7 @@ def explore_ocds(request, pk): supplied_data.rendered = True # not relevant to CoVE OCDS supplied_data.save() - # Finalize the context and select the template. + # Finalize the context. validation_errors_grouped = defaultdict(list) for error_json, values in context["validation_errors"]: @@ -167,12 +162,8 @@ def explore_ocds(request, pk): key = "other" validation_errors_grouped[key].append((error_json, values)) - context.update( - { - "data_schema_version": supplied_data.data_schema_version, - "validation_errors_grouped": validation_errors_grouped, - } - ) + 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(): @@ -182,12 +173,11 @@ def explore_ocds(request, pk): + re.sub(r"([A-Z])", r"-\1", additional_codelist_values["codelist"].split(".")[0]).lower() ) - has_records = "records" in package_data - if has_records: - template = "cove_ocds/explore_record.html" - context["release_or_record"] = "record" - else: - template = "cove_ocds/explore_release.html" - context["release_or_record"] = "release" + if "version" in package_data: + data_version = package_data["version"] + if not isinstance(data_version, str) or data_version not in schema_ocds.version_choices: + context["unrecognized_version_data"] = json.dumps(data_version) + + context["has_records"] = "records" in package_data - return render(request, template, context) + return render(request, "cove_ocds/explore_base.html", context) diff --git a/docs/template-structure.rst b/docs/template-structure.rst index e162fad..aef7c66 100644 --- a/docs/template-structure.rst +++ b/docs/template-structure.rst @@ -15,25 +15,3 @@ In cove-ocds (this repo) you will find specializations of these, either some blo * The base, input, and some of the result table templates customize text and appearance for the OCDS DRT. * ``explore_base``, ``explore_record`` and ``explore_release`` modify the base ``explore`` template depending on the data input. * Additional template partials which are included in other templates. - -Translating template strings ----------------------------- - -For more about translation in general, see :doc:`translations`. - -Some of the templates include variables for the translation of generic terms so that they can easily be reused. For example, in ``explore.html`` (lib-cove-web) you will find: - -.. code:: html - - {% trans 'Converted from Original' as converted %} - {% trans 'Original' as original %} - {% trans 'Excel Spreadsheet (.xlsx)' as xlsx %} - {% trans 'CSV Spreadsheet (.csv)' as csv %} - {% trans 'JSON' as JSON %} - {% trans 'XML' as XML %} - -Which means that in templates that override or are included in ``explore.html`` you can simply use, for example: - -.. code:: html - -

    {{ xlsx_titles }}

    \ No newline at end of file diff --git a/tests/fixtures/record_minimal_valid.json b/tests/fixtures/record_minimal_valid.json index 47d90b1..7efb166 100644 --- a/tests/fixtures/record_minimal_valid.json +++ b/tests/fixtures/record_minimal_valid.json @@ -1,5 +1,5 @@ { - "version": "1.0", + "version": "1.1", "uri": "http://example.org", "packages": ["http://example.org/1/"], "publishedDate": "2020-05-28T16:54:00+01:00", @@ -8,10 +8,10 @@ "uri": "http://example.org/" }, "records": [{ - "ocid": "", + "ocid": "ocds-example-1", "releases": [{ - "ocid": "", - "id": "", + "ocid": "ocds-example-1", + "id": "ocds-example-1-1", "tag": ["planning"], "initiationType": "tender", "date": "2020-05-28T16:54:00+01:00" diff --git a/tests/fixtures/tenders_releases_1_release_with_extension_broken_json_ref.json b/tests/fixtures/tenders_releases_1_release_with_extension_broken_json_ref.json index 9c9a1a0..58f345b 100644 --- a/tests/fixtures/tenders_releases_1_release_with_extension_broken_json_ref.json +++ b/tests/fixtures/tenders_releases_1_release_with_extension_broken_json_ref.json @@ -7,7 +7,7 @@ }, "publishedDate": "2017-08-08T09:44:30+00:00", "uri": "http://pptin.staging.yipl.com.np/bulk-download/2017", - "extensions":["https://raw.githubusercontent.com/open-contracting-extensions/ocds_requirements_extension/5670266ae7618ca571ae1842c3460f1fe8a4d347/extension.json"], + "extensions":["https://raw.githubusercontent.com/open-contracting/cove-ocds/main/tests/fixtures/referror_extension/extension.json"], "version": "1.0", "releases": [{ "ocid": "ocds-rw2stw-DTOK-3994\/CIP\/KPV\/W\/NCB-26", diff --git a/tests/test_functional.py b/tests/test_functional.py index 1014639..5f2ae4f 100644 --- a/tests/test_functional.py +++ b/tests/test_functional.py @@ -6,7 +6,6 @@ from django.conf import settings from django.test import override_settings from selenium.webdriver.common.by import By -from selenium.webdriver.support.ui import Select OCDS_DEFAULT_SCHEMA_VERSION = list(settings.COVE_CONFIG["schema_version_choices"])[-1] OCDS_SCHEMA_VERSIONS = settings.COVE_CONFIG["schema_version_choices"] @@ -148,9 +147,7 @@ def test_500_error(server_url, browser): ( "tenders_releases_2_releases.json", [ - "Submitted Files", - "Schema", - "OCDS release package schema version 1.0. You can", + "OCDS release package schema version 1.1.", *OCDS_SCHEMA_VERSIONS_DISPLAY, ], ["Schema Extensions"], @@ -165,7 +162,7 @@ def test_500_error(server_url, browser): "copy of the schema with extension", "Structural Errors", "name is missing but required within buyer", - "The schema version specified in the file is 1.1", + 'The schema version specified in the file is "1.1"', "Organization scale", ], ["/releases/parties/details", "fetching failed"], @@ -220,7 +217,7 @@ def test_500_error(server_url, browser): "records/compiledRelease/parties/details", "mooo", "/records/compiledRelease/tender/targets", - "The schema version specified in the file is 1.1", + 'The schema version specified in the file is "1.1"', "/records/releases/tender/targets", ], ["checked against a schema with no extensions"], @@ -266,7 +263,7 @@ def test_500_error(server_url, browser): ), ( "ocds_release_nulls.json", - ["Submitted Files", "Save or Share these results"], + ["Save or Share these results"], [], True, ), @@ -320,7 +317,6 @@ def test_500_error(server_url, browser): ( "tenders_releases_2_releases_invalid.json", [ - "Submitted Files", "Structural Errors", "id is missing but required", "Invalid 'uri' found", @@ -330,7 +326,7 @@ def test_500_error(server_url, browser): ), ("tenders_releases_2_releases_codelists.json", ["oh no", "GSINS"], [], True), # Test UTF-8 support - ("utf8.json", ["Submitted Files"], ["Ensure that your file uses UTF-8 encoding"], True), + ("utf8.json", [], ["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), @@ -343,7 +339,7 @@ def test_500_error(server_url, browser): ), ( "tenders_releases_2_releases.xlsx", - ["Submitted Files", "Schema", *OCDS_SCHEMA_VERSIONS_DISPLAY], + ["1.1"], ["Missing OCDS package"], True, ), @@ -363,8 +359,8 @@ def test_500_error(server_url, browser): ( "tenders_releases_1_release_with_unrecognized_version.json", [ - "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", + 'Your data specifies a version "123.123" which is not recognised', + f"structural checks against OCDS release package schema version {OCDS_DEFAULT_SCHEMA_VERSION}.", "checked against the current default version.", ], ["Additional Fields (fields in data not in schema)", "Error message"], @@ -373,8 +369,8 @@ def test_500_error(server_url, browser): ( "tenders_releases_1_release_with_wrong_version_type.json", [ - "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", + "Your data specifies a version 1000 which is not recognised", + f"structural checks against OCDS release package schema version {OCDS_DEFAULT_SCHEMA_VERSION}.", ], ["Additional Fields (fields in data not in schema)", "Error message"], False, @@ -382,11 +378,10 @@ 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', - "Error message", + 'Your data specifies a version "100.100.0" which is not recognised', + f"structural checks against OCDS release package schema version {OCDS_DEFAULT_SCHEMA_VERSION}.", ], - [], + ["Error message"], False, ), ( @@ -400,7 +395,7 @@ def test_500_error(server_url, browser): [ "JSON reference error", "Unresolvable JSON pointer:", - "/definitions/OrganizationReference", + "/definitions/Broken", ], [], False, @@ -497,26 +492,9 @@ def check_url_input_result_page( assert "Data Review Tool" in browser.find_element(By.TAG_NAME, "body").text 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" - ) - converted_file = browser.find_element( - By.PARTIAL_LINK_TEXT, "JSON (Converted from Original using schema version" - ).get_attribute("href") - assert "unflattened.json" in converted_file - elif source_filename.endswith(".csv"): - assert "(.csv) (Original)" in body_text - original_file = browser.find_element(By.LINK_TEXT, "CSV Spreadsheet (.csv) (Original)").get_attribute( - "href" - ) - converted_file = browser.find_element( - By.PARTIAL_LINK_TEXT, "JSON (Converted from Original using schema version" - ).get_attribute("href") - assert "unflattened.json" in browser.find_element( - By.PARTIAL_LINK_TEXT, "JSON (Converted from Original using schema version" - ).get_attribute("href") + original_file = browser.find_element(By.PARTIAL_LINK_TEXT, "cached").get_attribute("href") + converted_file = browser.find_element(By.PARTIAL_LINK_TEXT, "download").get_attribute("href") + assert "unflattened.json" in converted_file assert source_filename in original_file assert "0 bytes" not in body_text @@ -698,7 +676,7 @@ def test_url_invalid_dataset_request(server_url, browser, data_url): ), ( "tenders_releases_1_release_with_invalid_extensions.json", - "structural checks against OCDS release package schema version 1.0", + "structural checks against OCDS release package schema version 1.1", "version is missing but required", "methodRationale", "✅", # skip this assertion @@ -740,76 +718,6 @@ def test_url_input_with_version( assert not_expected_additional_field not in additional_field_box -@pytest.mark.parametrize( - ( - "source_filename", - "select_version", - "expected", - "not_expected", - "expected_additional_field", - "not_expected_additional_field", - ), - [ - ( - "tenders_releases_1_release_with_extensions_1_1.json", - "1.0", - "structural checks against OCDS release package schema version 1.0", - "version is missing but required", - "version", - "publisher", - ), - ( - "tenders_releases_1_release_with_invalid_extensions.json", - "1.1", - "", # skip this assertion - "structural checks against OCDS release package schema version 1.0", - "methodRationale", - "version", - ), - ( - "tenders_releases_2_releases_with_metatab_version_1_1_extensions.xlsx", - "1.0", - "structural checks against OCDS release package schema version 1.0", - "version is missing but required", - "version", - "publisher", - ), - ], -) -def test_url_input_with_version_change( - server_url, - url_input_browser, - httpserver, - select_version, - source_filename, - expected, - not_expected, - expected_additional_field, - not_expected_additional_field, -): - browser = url_input_browser(source_filename) - select = Select(browser.find_element(By.NAME, "version")) - select.select_by_value(select_version) - browser.find_element(By.CSS_SELECTOR, ".btn-primary[value='Go']").click() - time.sleep(0.5) - - body_text = browser.find_element(By.TAG_NAME, "body").text - additional_field_box = browser.find_element(By.ID, "additionalFieldTable").text - - assert expected in body_text - assert not_expected not in body_text - assert expected_additional_field in additional_field_box - assert not_expected_additional_field not in additional_field_box - - # Refresh page to check if tests still work after caching the data - browser.get(browser.current_url) - - assert expected in body_text - assert not_expected not in body_text - assert expected_additional_field in additional_field_box - assert not_expected_additional_field not in additional_field_box - - @pytest.mark.parametrize( ("source_filename", "expected", "not_expected"), [ @@ -823,7 +731,6 @@ def test_url_input_with_version_change( ], [ "The following extensions failed", - "extensions were not introduced in the schema until version 1.1.", ], ), ( @@ -833,7 +740,6 @@ def test_url_input_with_version_change( "The metrics extension supports publication of forecasts", "Get a copy of the schema with extension patches applied", "The following extensions failed", - "extensions were not introduced in the schema until version 1.1.", ], ["checked against a schema with no extensions"], ), @@ -841,7 +747,6 @@ def test_url_input_with_version_change( "tenders_releases_1_release_with_all_invalid_extensions.json", [ "None of the extensions above could be applied", - "extensions were not introduced in the schema until version 1.1.", ], ["Organization scale", "Get a copy of the schema with extension patches applied"], ), @@ -855,7 +760,6 @@ def test_url_input_with_version_change( ], [ "The following extensions failed", - "extensions were not introduced in the schema until version 1.1.", ], ), ], diff --git a/tests/test_general.py b/tests/test_general.py index 8a8f6f0..6f2edfb 100644 --- a/tests/test_general.py +++ b/tests/test_general.py @@ -1,8 +1,6 @@ -import io import json import os import shutil -from unittest.mock import patch import libcove.lib.common as cove_common import pytest @@ -10,7 +8,6 @@ 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_spreadsheet from libcoveocds.api import ocds_json_output from libcoveocds.exceptions import OCDSVersionError from libcoveocds.schema import SchemaOCDS @@ -234,7 +231,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 + assert b"null which is not recognised" in resp.content @pytest.mark.django_db @@ -268,19 +265,10 @@ def test_explore_schema_version(client, json_data): assert "/1.1/" in resp.context["schema_url"] assert resp.context["version_used"] == "1.1" assert resp.context["version_used_display"] == "1.1" - resp = client.post(data.get_absolute_url(), {"version": "1.0"}) - assert resp.status_code == 200 - assert "/1.0/" in resp.context["schema_url"] - assert resp.context["version_used"] == "1.0" else: assert "/1.1/" in resp.context["schema_url"] assert resp.context["version_used"] == "1.1" assert resp.context["version_used_display"] == "1.1" - resp = client.post(data.get_absolute_url(), {"version": "1.0"}) - assert resp.status_code == 200 - assert "/1.0/" in resp.context["schema_url"] - assert resp.context["version_used"] == "1.0" - assert resp.context["version_used_display"] == "1.0" @pytest.mark.django_db @@ -293,43 +281,6 @@ def test_wrong_schema_version_in_data(client): assert resp.context["version_used"] == OCDS_DEFAULT_SCHEMA_VERSION -@pytest.mark.django_db -@pytest.mark.parametrize( - ("file_type", "converter", "replace_after_post"), - [("xlsx", convert_spreadsheet, True)], -) -def test_explore_schema_version_change(client, file_type, converter, replace_after_post): - data = SuppliedData.objects.create() - with open( - os.path.join("tests", "fixtures", f"tenders_releases_2_releases.{file_type}"), - "rb", - ) as fp: - data.original_file.save(f"test.{file_type}", UploadedFile(fp)) - data.current_app = "cove_ocds" - - with patch( - f"cove_ocds.views.{converter.__name__}", - side_effect=converter, - autospec=True, - ) as mock_object: - resp = client.get(data.get_absolute_url()) - args, kwargs = mock_object.call_args - assert resp.status_code == 200 - assert resp.context["version_used"] == "1.0" - assert mock_object.called - 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 resp.context["version_used"] == "1.1" - assert mock_object.called - assert "/1.1/" in kwargs["schema_url"] - assert kwargs["replace"] is replace_after_post - - @pytest.mark.django_db def test_data_supplied_schema_version(client): data = SuppliedData.objects.create() @@ -339,12 +290,7 @@ def test_data_supplied_schema_version(client): assert data.schema_version == "" - resp = client.get(data.get_absolute_url()) - assert resp.status_code == 200 - assert resp.context["version_used"] == "1.0" - assert SuppliedData.objects.get(id=data.id).schema_version == "1.0" - - resp = client.post(data.get_absolute_url(), {"version": "1.1"}) + 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" @@ -415,85 +361,6 @@ def test_schema_ocds_extended_schema_file(): assert not schema.extended_schema_url -@pytest.mark.django_db -def test_schema_after_version_change(client): - data = SuppliedData.objects.create() - with open( - os.path.join( - "tests", - "fixtures", - "tenders_releases_1_release_with_invalid_extensions.json", - ) - ) as fp: - data.original_file.save("test.json", UploadedFile(fp)) - - resp = client.post(data.get_absolute_url(), {"version": "1.1"}) - assert resp.status_code == 200 - - with open(os.path.join(data.upload_dir(), "extended_schema.json")) as extended_release_fp: - assert "mainProcurementCategory" in json.load(extended_release_fp)["definitions"]["Tender"]["properties"] - - # test link is still there. - resp = client.get(data.get_absolute_url()) - assert resp.status_code == 200 - assert "extended_schema.json" in resp.content.decode() - - with open(os.path.join(data.upload_dir(), "extended_schema.json")) as extended_release_fp: - assert "mainProcurementCategory" in json.load(extended_release_fp)["definitions"]["Tender"]["properties"] - - resp = client.post(data.get_absolute_url(), {"version": "1.0"}) - assert resp.status_code == 200 - - with open(os.path.join(data.upload_dir(), "extended_schema.json")) as extended_release_fp: - assert "mainProcurementCategory" not in json.load(extended_release_fp)["definitions"]["Tender"]["properties"] - - -@pytest.mark.django_db -def test_schema_after_version_change_record(client): - data = SuppliedData.objects.create() - with open( - os.path.join( - "tests", - "fixtures", - "tenders_records_1_record_with_invalid_extensions.json", - ) - ) as fp: - new_json = json.load(fp) - # Test without version field - new_json.pop("version") - new_json_file = io.StringIO(json.dumps(new_json)) - data.original_file.save("test.json", UploadedFile(new_json_file)) - - resp = client.post(data.get_absolute_url(), {"version": "1.1"}) - assert resp.status_code == 200 - - with open(os.path.join(data.upload_dir(), "extended_schema.json")) as extended_release_fp: - assert "mainProcurementCategory" in json.load(extended_release_fp)["definitions"]["Tender"]["properties"] - - with open(os.path.join(data.upload_dir(), "validation_errors-3.json")) as validation_errors_fp: - assert "'version' is missing but required" in validation_errors_fp.read() - - # test link is still there. - resp = client.get(data.get_absolute_url()) - assert resp.status_code == 200 - assert "extended_schema.json" in resp.content.decode() - - with open(os.path.join(data.upload_dir(), "extended_schema.json")) as extended_release_fp: - assert "mainProcurementCategory" in json.load(extended_release_fp)["definitions"]["Tender"]["properties"] - - with open(os.path.join(data.upload_dir(), "validation_errors-3.json")) as validation_errors_fp: - assert "'version' is missing but required" in validation_errors_fp.read() - - resp = client.post(data.get_absolute_url(), {"version": "1.0"}) - assert resp.status_code == 200 - - with open(os.path.join(data.upload_dir(), "extended_schema.json")) as extended_release_fp: - assert "mainProcurementCategory" not in json.load(extended_release_fp)["definitions"]["Tender"]["properties"] - - with open(os.path.join(data.upload_dir(), "validation_errors-3.json")) as validation_errors_fp: - assert "'version' is missing but required" not in validation_errors_fp.read() - - @pytest.mark.parametrize( "json_data", [