diff --git a/cove_ocds/locale/en/LC_MESSAGES/django.po b/cove_ocds/locale/en/LC_MESSAGES/django.po index 97ed419..be5cb82 100644 --- a/cove_ocds/locale/en/LC_MESSAGES/django.po +++ b/cove_ocds/locale/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-19 05:34+0000\n" +"POT-Creation-Date: 2024-10-19 05:35+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -674,14 +674,10 @@ msgid "Is structurally correct?" msgstr "" #: cove_ocds/templates/cove_ocds/explore_record.html:105 -#: cove_ocds/templates/cove_ocds/explore_record.html:167 -#: cove_ocds/templates/cove_ocds/explore_record.html:168 msgid "No" msgstr "" #: cove_ocds/templates/cove_ocds/explore_record.html:105 -#: cove_ocds/templates/cove_ocds/explore_record.html:167 -#: cove_ocds/templates/cove_ocds/explore_record.html:168 msgid "Yes" msgstr "" @@ -693,19 +689,6 @@ msgstr "" msgid "Unique OCIDs" msgstr "" -#: cove_ocds/templates/cove_ocds/explore_record.html:144 -msgid "Records Table:" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:150 -#, python-format -msgid "Showing the first %(releases_or_records_table_length)s records." -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_record.html:157 -msgid "release count" -msgstr "" - #: cove_ocds/templates/cove_ocds/explore_release.html:22 msgid "OCDS release package schema version" msgstr "" @@ -974,70 +957,6 @@ msgstr "" msgid "Statistics cannot be produced as data is not structurally correct." msgstr "" -#: cove_ocds/templates/cove_ocds/explore_release.html:340 -msgid "Releases Table:" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:346 -#, python-format -msgid "" -"Showing the first %(releases_or_records_table_length)s releases. To explore " -"all your data in a tabular format, convert it to a spreadsheet using the " -"\"Convert\" section, above." -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:353 -msgid "Release Date" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:354 -msgid "Tags" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:355 -msgid "Descriptions" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:356 -msgid "Purchasers" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:368 -msgid "Tender Title:" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:371 -msgid "Tender Description:" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:375 -msgid "Tender Item Description:" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:380 -msgid "Award Title:" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:383 -msgid "Award Description:" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:388 -msgid "Contract Title:" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:391 -msgid "Contract Description:" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:399 -msgid "Buyer:" -msgstr "" - -#: cove_ocds/templates/cove_ocds/explore_release.html:405 -msgid "Procuring Entity:" -msgstr "" - #: cove_ocds/templates/cove_ocds/input.html:6 msgid "Loading" msgstr "" diff --git a/cove_ocds/locale/es/LC_MESSAGES/django.po b/cove_ocds/locale/es/LC_MESSAGES/django.po index 67c89bc..e70d6ba 100644 --- a/cove_ocds/locale/es/LC_MESSAGES/django.po +++ b/cove_ocds/locale/es/LC_MESSAGES/django.po @@ -15,7 +15,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-19 05:34+0000\n" +"POT-Creation-Date: 2024-10-19 05:35+0000\n" "PO-Revision-Date: 2020-09-08 08:53+0000\n" "Last-Translator: James McKinney, 2024\n" "Language-Team: Spanish (https://app.transifex.com/open-contracting-" @@ -814,14 +814,10 @@ msgid "Is structurally correct?" msgstr "¿Es estructuralmente correcto?" #: cove_ocds/templates/cove_ocds/explore_record.html:105 -#: cove_ocds/templates/cove_ocds/explore_record.html:167 -#: cove_ocds/templates/cove_ocds/explore_record.html:168 msgid "No" msgstr "No" #: cove_ocds/templates/cove_ocds/explore_record.html:105 -#: cove_ocds/templates/cove_ocds/explore_record.html:167 -#: cove_ocds/templates/cove_ocds/explore_record.html:168 msgid "Yes" msgstr "Si" @@ -833,19 +829,6 @@ msgstr "Número de registros" msgid "Unique OCIDs" msgstr "OCIDs únicas" -#: cove_ocds/templates/cove_ocds/explore_record.html:144 -msgid "Records Table:" -msgstr "Tabla de Registros:" - -#: cove_ocds/templates/cove_ocds/explore_record.html:150 -#, python-format -msgid "Showing the first %(releases_or_records_table_length)s records." -msgstr "Mostrando los primeros %(releases_or_records_table_length)s registros." - -#: cove_ocds/templates/cove_ocds/explore_record.html:157 -msgid "release count" -msgstr "cantidad de entregas" - #: cove_ocds/templates/cove_ocds/explore_release.html:22 msgid "OCDS release package schema version" msgstr "Versión del esquema del paquete de entrega de OCDS" @@ -1130,73 +1113,6 @@ msgstr "" "No se pueden producir estadísticas porque los datos no son estructuralmente " "correctos." -#: cove_ocds/templates/cove_ocds/explore_release.html:340 -msgid "Releases Table:" -msgstr "Tabla de Entregas:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:346 -#, python-format -msgid "" -"Showing the first %(releases_or_records_table_length)s releases. To explore " -"all your data in a tabular format, convert it to a spreadsheet using the " -"\"Convert\" section, above." -msgstr "" -"Mostrando los primeros %(releases_or_records_table_length)s lanzamientos. " -"Para explorar todos tus datos en formato tabular, conviértalos a una hoja de " -"cálculo usando la sección \"Convertir\", arriba." - -#: cove_ocds/templates/cove_ocds/explore_release.html:353 -msgid "Release Date" -msgstr "Fecha de Entrega" - -#: cove_ocds/templates/cove_ocds/explore_release.html:354 -msgid "Tags" -msgstr "Etiquetas" - -#: cove_ocds/templates/cove_ocds/explore_release.html:355 -msgid "Descriptions" -msgstr "Descripciones" - -#: cove_ocds/templates/cove_ocds/explore_release.html:356 -msgid "Purchasers" -msgstr "Compradores" - -#: cove_ocds/templates/cove_ocds/explore_release.html:368 -msgid "Tender Title:" -msgstr "Título de la Licitación:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:371 -msgid "Tender Description:" -msgstr "Descripción de la Licitación:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:375 -msgid "Tender Item Description:" -msgstr "Descripción del Artículo de la Licitación:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:380 -msgid "Award Title:" -msgstr "Título de la Adjudicación:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:383 -msgid "Award Description:" -msgstr "Descripción de la Adjudicación:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:388 -msgid "Contract Title:" -msgstr "Título del Contrato:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:391 -msgid "Contract Description:" -msgstr "Descripción del Contrato:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:399 -msgid "Buyer:" -msgstr "Comprador:" - -#: cove_ocds/templates/cove_ocds/explore_release.html:405 -msgid "Procuring Entity:" -msgstr "Entidad Contratante:" - #: cove_ocds/templates/cove_ocds/input.html:6 msgid "Loading" msgstr "Cargando" @@ -1711,6 +1627,69 @@ msgstr "Error de referencia en JSON" msgid "%(error)s" msgstr "%(error)s" +#~ msgid "Records Table:" +#~ msgstr "Tabla de Registros:" + +#, python-format +#~ msgid "Showing the first %(releases_or_records_table_length)s records." +#~ msgstr "" +#~ "Mostrando los primeros %(releases_or_records_table_length)s registros." + +#~ msgid "release count" +#~ msgstr "cantidad de entregas" + +#~ msgid "Releases Table:" +#~ msgstr "Tabla de Entregas:" + +#, python-format +#~ msgid "" +#~ "Showing the first %(releases_or_records_table_length)s releases. To " +#~ "explore all your data in a tabular format, convert it to a spreadsheet " +#~ "using the \"Convert\" section, above." +#~ msgstr "" +#~ "Mostrando los primeros %(releases_or_records_table_length)s lanzamientos. " +#~ "Para explorar todos tus datos en formato tabular, conviértalos a una hoja " +#~ "de cálculo usando la sección \"Convertir\", arriba." + +#~ msgid "Release Date" +#~ msgstr "Fecha de Entrega" + +#~ msgid "Tags" +#~ msgstr "Etiquetas" + +#~ msgid "Descriptions" +#~ msgstr "Descripciones" + +#~ msgid "Purchasers" +#~ msgstr "Compradores" + +#~ msgid "Tender Title:" +#~ msgstr "Título de la Licitación:" + +#~ msgid "Tender Description:" +#~ msgstr "Descripción de la Licitación:" + +#~ msgid "Tender Item Description:" +#~ msgstr "Descripción del Artículo de la Licitación:" + +#~ msgid "Award Title:" +#~ msgstr "Título de la Adjudicación:" + +#~ msgid "Award Description:" +#~ msgstr "Descripción de la Adjudicación:" + +#~ msgid "Contract Title:" +#~ msgstr "Título del Contrato:" + +#~ msgid "Contract Description:" +#~ msgstr "Descripción del Contrato:" + +#~ msgid "Buyer:" +#~ msgstr "Comprador:" + +#~ msgid "Procuring Entity:" +#~ msgstr "Entidad Contratante:" + #~ msgid "Explore your data:" #~ msgstr "Explora tus datos:" diff --git a/cove_ocds/templates/cove_ocds/explore_record.html b/cove_ocds/templates/cove_ocds/explore_record.html index 8ff4ddd..c071da6 100644 --- a/cove_ocds/templates/cove_ocds/explore_record.html +++ b/cove_ocds/templates/cove_ocds/explore_record.html @@ -136,43 +136,5 @@

-
-
-
-
-

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

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

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

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

{% trans 'Documents' %}

{% endwith %} - -
-
-
-
-

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

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

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

- {% endif %} - - - - - - - - - - - - {% for release in releases|slice:releases_or_records_table_slice %} - - - - - - - - {% endfor %} - -
OCID{%blocktrans%}Release Date{%endblocktrans%}{%blocktrans%}Tags{%endblocktrans%}{%blocktrans%}Descriptions{%endblocktrans%}{%blocktrans%}Purchasers{%endblocktrans%}
{{ release.ocid }}{{ release.date|to_datetime|date:"j M Y, H:i (e)" }}{% if release.tag %}{{ release.tag|join:", " }}{% endif %} -
    - {% if release.tender.title %} -
  • {%blocktrans%}Tender Title:{%endblocktrans%} {{ release.tender.title }}
  • - {% endif %} - {% if release.tender.description %} -
  • {%blocktrans%}Tender Description:{%endblocktrans%} {{ release.tender.description }}
  • - {% endif %} - {% for item in release.tender.items %} - {% if item.description %} -
  • {%blocktrans%}Tender Item Description:{%endblocktrans%} {{ item.description }}
  • - {% endif %} - {% endfor %} - {% for award in release.awards %} - {% if award.title %} -
  • {%blocktrans%}Award Title:{%endblocktrans%} {{ award.title }}
  • - {% endif %} - {% if award.description %} -
  • {%blocktrans%}Award Description:{%endblocktrans%} {{ award.description }}
  • - {% endif %} - {% endfor %} - {% for contract in release.contracts %} - {% if contract.description %} -
  • {%blocktrans%}Contract Title:{%endblocktrans%} {{ contract.title }}
  • - {% endif %} - {% if contract.description %} -
  • {%blocktrans%}Contract Description:{%endblocktrans%} {{ contract.description }}
  • - {% endif %} - {% endfor %} -
-
-
    - {% if release.buyer.name or release.buyer.identifier.id %} -
  • {%blocktrans%}Buyer:{%endblocktrans%} - {% if release.buyer.name %} {{release.buyer.name}} {%endif%} - {% if release.buyer.identifier.id %} ({{ release.buyer.identifier.id }}) {%endif%} -
  • - {% endif %} - {% if release.tender.procuringEntity.name or release.tender.procuringEntity.identifier.id %} -
  • {%blocktrans%}Procuring Entity:{%endblocktrans%} - {% if release.tender.procuringEntity.name %} {{release.tender.procuringEntity.name}} {%endif%} - {% if release.tender.procuringEntity.identifier.id %} ({{ release.tender.procuringEntity.identifier.id }}) {%endif%} -
  • - {% endif %} -
-
-
-
-
-
- {% endblock %} diff --git a/cove_ocds/views.py b/cove_ocds/views.py index ce978f8..5f9c020 100644 --- a/cove_ocds/views.py +++ b/cove_ocds/views.py @@ -199,16 +199,8 @@ def explore_ocds(request, pk): if has_records: template = "cove_ocds/explore_record.html" context["release_or_record"] = "record" - key = "records" else: template = "cove_ocds/explore_release.html" context["release_or_record"] = "release" - key = "releases" - - if isinstance(package_data, dict) and isinstance(package_data.get(key), list): - # This is for the "Releases Table" and "Records Table" features. - context[key] = package_data[key] - else: - context[key] = [] return render(request, template, context) diff --git a/tests/test_functional.py b/tests/test_functional.py index f3929f3..59977a4 100644 --- a/tests/test_functional.py +++ b/tests/test_functional.py @@ -994,120 +994,6 @@ def test_additional_checks_error_modal(server_url, url_input_browser, httpserver browser.find_element(By.CSS_SELECTOR, "div.modal.additional-checks-1 button.close").click() -def test_releases_table_25_rows(skip_if_remote, url_input_browser): - """ - Check that when there are more than 25 releases, only 25 are shown in the - table, and there is a message. - """ - - browser = url_input_browser("30_releases.json") - assert "This file contains 30 releases" in browser.find_element(By.TAG_NAME, "body").text - panel = browser.find_element(By.CSS_SELECTOR, "#releases-table-panel") - assert "first 25 releases" in panel.text - table_rows = browser.find_elements(By.CSS_SELECTOR, "#releases-table-panel table tbody tr") - assert len(table_rows) == 25 - - -def test_releases_table_7_rows(skip_if_remote, url_input_browser): - """ - Check that when there are less than 25 releases, they are all shown in the - table, and there is no message. - """ - - browser = url_input_browser("tenders_releases_7_releases_check_ocids.json") - assert "This file contains 7 releases" in browser.find_element(By.TAG_NAME, "body").text - panel = browser.find_element(By.CSS_SELECTOR, "#releases-table-panel") - assert "first 25 releases" not in panel.text - table_rows = browser.find_elements(By.CSS_SELECTOR, "#releases-table-panel table tbody tr") - assert len(table_rows) == 7 - - -def test_releases_table_10_rows_env_var(skip_if_remote, settings_releases_table_10, url_input_browser): - """ - Check that when the appropriate setting is set, and there are more than 10 - releases, only 10 are shown in the table, and there is a message. - """ - - browser = url_input_browser("30_releases.json") - assert "This file contains 30 releases" in browser.find_element(By.TAG_NAME, "body").text - panel = browser.find_element(By.CSS_SELECTOR, "#releases-table-panel") - assert "first 10 releases" in panel.text - table_rows = browser.find_elements(By.CSS_SELECTOR, "#releases-table-panel table tbody tr") - assert len(table_rows) == 10 - - -def test_releases_table_7_rows_env_var(skip_if_remote, settings_releases_table_10, url_input_browser): - """ - Check that when the appropriate setting is set, and there are less than 10 - releases, they are all shown in the table, and there is no message. - """ - - browser = url_input_browser("tenders_releases_7_releases_check_ocids.json") - assert "This file contains 7 releases" in browser.find_element(By.TAG_NAME, "body").text - panel = browser.find_element(By.CSS_SELECTOR, "#releases-table-panel") - assert "first 25 releases" not in panel.text - assert "first 10 releases" not in panel.text - table_rows = browser.find_elements(By.CSS_SELECTOR, "#releases-table-panel table tbody tr") - assert len(table_rows) == 7 - - -def test_records_table_25_rows(skip_if_remote, url_input_browser): - """ - Check that when there are more than 25 records, only 25 are shown in the - table, and there is a message. - """ - - browser = url_input_browser("30_records.json") - assert "This file contains 30 records" in browser.find_element(By.TAG_NAME, "body").text - panel = browser.find_element(By.CSS_SELECTOR, "#records-table-panel") - assert "first 25 records" in panel.text - table_rows = browser.find_elements(By.CSS_SELECTOR, "#records-table-panel table tbody tr") - assert len(table_rows) == 25 - - -def test_records_table_7_rows(skip_if_remote, url_input_browser): - """ - Check that when there are less than 25 records, they are all shown in the - table, and there is no message. - """ - - browser = url_input_browser("7_records.json") - assert "This file contains 7 records" in browser.find_element(By.TAG_NAME, "body").text - panel = browser.find_element(By.CSS_SELECTOR, "#records-table-panel") - assert "first 25 records" not in panel.text - table_rows = browser.find_elements(By.CSS_SELECTOR, "#records-table-panel table tbody tr") - assert len(table_rows) == 7 - - -def test_records_table_10_rows_env_var(skip_if_remote, settings_records_table_10, url_input_browser): - """ - Check that when the appropriate setting is set, and there are more than 10 - records, only 10 are shown in the table, and there is a message. - """ - - browser = url_input_browser("30_records.json") - assert "This file contains 30 records" in browser.find_element(By.TAG_NAME, "body").text - panel = browser.find_element(By.CSS_SELECTOR, "#records-table-panel") - assert "first 10 records" in panel.text - table_rows = browser.find_elements(By.CSS_SELECTOR, "#records-table-panel table tbody tr") - assert len(table_rows) == 10 - - -def test_records_table_7_rows_env_var(skip_if_remote, settings_records_table_10, url_input_browser): - """ - Check that when the appropriate setting is set, and there are less than 10 - records, they are all shown in the table, and there is no message. - """ - - browser = url_input_browser("7_records.json") - assert "This file contains 7 records" in browser.find_element(By.TAG_NAME, "body").text - panel = browser.find_element(By.CSS_SELECTOR, "#records-table-panel") - assert "first 25 records" not in panel.text - assert "first 10 records" not in panel.text - table_rows = browser.find_elements(By.CSS_SELECTOR, "#records-table-panel table tbody tr") - assert len(table_rows) == 7 - - @override_settings(VALIDATION_ERROR_LOCATIONS_LENGTH=1000) def test_error_list_1000_lines(skip_if_remote, url_input_browser): """ @@ -1178,17 +1064,6 @@ def test_error_list_999_lines_sample(skip_if_remote, settings_error_locations_sa assert len(table_rows) == 999 -def test_records_table_releases_count(skip_if_remote, url_input_browser): - """ - Check that the correct releases count is shown in the records table. - """ - - browser = url_input_browser("30_records.json") - assert "release" in browser.find_elements(By.CSS_SELECTOR, "#records-table-panel table thead th")[1].text - table_rows = browser.find_elements(By.CSS_SELECTOR, "#records-table-panel table tbody tr") - assert table_rows[0].find_elements(By.CSS_SELECTOR, "td")[1].text == "5" - - @pytest.mark.parametrize( ("source_filename", "expected"), [