Skip to content

Commit 3e55fd8

Browse files
committed
feat: Remove Key Field Information
1 parent eb21e2e commit 3e55fd8

23 files changed

+260
-1654
lines changed

cove_ocds/locale/en/LC_MESSAGES/django.po

Lines changed: 83 additions & 343 deletions
Large diffs are not rendered by default.

cove_ocds/locale/es/LC_MESSAGES/django.po

Lines changed: 105 additions & 484 deletions
Large diffs are not rendered by default.
Lines changed: 43 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,140 +1,105 @@
11
{% extends 'cove_ocds/explore_base.html' %}
22
{% load i18n %}
3-
3+
{% load cove_tags %}{# subtract #}
44

55
{% block key_facts %}
6-
{% with releases_aggregates as ra %}
7-
8-
9-
<div class="col-md-6">
6+
<div class="col-md-12">
107
<div class="panel panel-primary {% if validation_errors or additional_closed_codelist_values or extensions and extensions.invalid_extension %}panel-danger{% endif %}">
118
<div class="panel-heading">
129
<h4 class="panel-title">{% trans 'Headlines' %}</h4>
1310
</div>
1411
<div class="panel-body">
15-
1612
{% if conversion_warning_messages or conversion_warning_messages_titles %}
1713
<div class="conversion message"><span class="glyphicon glyphicon-flag" aria-hidden="true"></span>{% blocktrans %}Please read the <a href="#conversion-warning">conversion warnings</a> below.{% endblocktrans %}</div>
18-
{% endif %}
19-
<div class="validation message">
14+
{% endif %}
15+
16+
<div class="validation message">
2017
{% if validation_errors or additional_closed_codelist_values %}
2118
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span><b>{% trans "Failed " %}</b>
22-
{% else %}
23-
<span class="glyphicon glyphicon-ok" aria-hidden="true"></span>{% trans "Passed " %}
19+
{% else %}
20+
<span class="glyphicon glyphicon-ok" aria-hidden="true"></span>{% trans "Passed " %}
2421
{% endif %}
25-
{% blocktrans %}structural checks against {% endblocktrans %}<a href="{{ schema_url }}">{% blocktrans %}OCDS record package schema version{% endblocktrans %} {{ version_used_display }}</a>.
22+
{% blocktrans %}structural checks against <a href="{{ schema_url }}">OCDS record package schema version {{ version_used_display }}</a>.{% endblocktrans %}
2623
{% if validation_errors %}<br/>{% blocktrans %}See <a href="#validation-errors">Structural Errors</a> below.{% endblocktrans %}{% endif %}
2724
</div>
2825

29-
<div class="key-facts message">
26+
{% if extensions and extensions.invalid_extension %}
27+
<div class="message">
28+
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>{% blocktrans count count=extensions.invalid_extension.keys|length %}<strong>Failed</strong> to apply {{count}} extension to the schema.{% plural %}<strong>Failed</strong> to apply {{count}} extensions to the schema.{% endblocktrans %}<br/>
29+
{% blocktrans %}See <a href="#schema-extensions">Extensions</a> below.{% endblocktrans %}
30+
</div>
31+
{% endif %}
32+
33+
<div class="key-facts message">
3034
<strong>{% trans "At a glance" %}</strong>
3135
<ul>
36+
{% if count %}
3237
<li><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
33-
{% if records_aggregates.count %}
34-
{% blocktrans count count=records_aggregates.count %}This file contains <strong>{{count}} record.</strong>{% plural %}This file contains <strong>{{count}} records.</strong>{% endblocktrans %}
35-
{% endif %}
38+
{% blocktrans count count=count %}This file contains <strong>{{count}} record</strong>{% plural %}This file contains <strong>{{count}} records</strong>{% endblocktrans %}
39+
{% blocktrans count count=unique_ocids_count %} describing <strong>{{count}} contracting process</strong>{% plural %} describing <strong>{{count}} contracting processes.</strong>{% endblocktrans %}
3640
</li>
41+
{% endif %}
42+
3743
{% if data_schema_version %}
3844
<li><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
3945
{% trans "The schema version specified in the file is" %} <strong>{{data_schema_version}}</strong>.
4046
</li>
4147
{% endif %}
42-
<li><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
43-
{% blocktrans count count=records_aggregates.unique_ocids|length %}There is <strong>{{count}} unique OCID.</strong>{% plural %}There are <strong>{{count}} unique OCIDs.</strong>{% endblocktrans %}
44-
</li>
48+
4549
{% if json_data.publisher %}
4650
<li><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
4751
{% trans "The publisher named in the file is" %} <strong>{{json_data.publisher.name}}</strong>.
4852
</li>
4953
{% endif %}
54+
5055
{% if json_data.license %}
5156
<li><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
5257
{% trans "The license is" %} <a href="{{json_data.license}}">{{json_data.license}}</a>.
5358
</li>
5459
{% endif %}
60+
5561
{% if json_data.publicationPolicy %}
5662
<li><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
5763
{% trans "Publication policy is" %} <a href="{{json_data.publicationPolicy}}">{{json_data.publicationPolicy}}</a>.
5864
</li>
5965
{% endif %}
60-
61-
{% if ra.duplicate_release_ids %}
62-
<li><span class="glyphicon glyphicon-flag" aria-hidden="true"></span>
63-
{% blocktrans count count=ra.duplicate_release_ids|length %}There is {{ count }} <a href="#key-field-info">duplicate release ID</a> in this package.{% plural %}There are {{ count }} <a href="#key-field-info">duplicate release IDs</a> in this package.{% endblocktrans %}
66+
67+
{% if extensions and extensions.is_extended_schema %}
68+
<li><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
69+
{% with n_invalid=extensions.invalid_extension.keys|length %}
70+
{% blocktrans count count=extensions.extensions.keys|length|subtract:n_invalid %}This file applies {{count}} valid <a href="#schema-extensions">extension</a> to the schema.{% plural %}This file applies {{count}} valid <a href="#schema-extensions">extensions</a> to the schema.{% endblocktrans %}
71+
{% endwith %}
6472
</li>
6573
{% endif %}
66-
74+
6775
{% if data_only %}
6876
<li><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
6977
{% blocktrans count count=data_only|length %}This file uses {{count}} <a href="#additional-fields">additional field</a> not used in the standard.{% plural %}This file uses {{count}} <a href="#additional-fields">additional fields</a> not used in the standard.{% endblocktrans %}
7078
</li>
7179
{% endif %}
80+
7281
{% if csv_encoding and csv_encoding != "utf-8-sig" %}
7382
<li><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
74-
{% trans "This file is not 'utf-8' encoded (it is" %} <strong>{{csv_encoding}}</strong> {% trans "encoded)." %}
83+
{% blocktrans %}This file is not 'utf-8' encoded (it is <strong>{{csv_encoding}}</strong> encoded).{% endblocktrans %}
7584
</li>
7685
{% endif %}
86+
87+
{% if deprecated_fields %}
88+
<li><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
89+
{% blocktrans count count=deprecated_fields|length %}This file uses {{count}} <a href="#deprecated-fields">deprecated field</a>.{% plural %} This file uses {{count}} <a href="#deprecated-fields">deprecated fields</a>.{% endblocktrans %}
90+
</li>
91+
{% endif %}
92+
7793
<li><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
78-
{% trans "Data " %}
7994
{% if source_url %}
80-
{% trans "downloaded from " %} {{source_url}}
95+
{% blocktrans %}Data downloaded from {{ source_url }} on {{ created_datetime }}.{% endblocktrans %}
8196
{% else %}
82-
{% trans "uploaded " %}
97+
{% blocktrans %}Data uploaded on {{ created_datetime }}.{% endblocktrans %}
8398
{% endif %}
84-
{% trans "on " %} {{created_datetime}}
8599
</li>
86100
</ul>
87-
</div>
88-
</div>
89-
</div>
90-
</div>
91-
92-
{% endwith %}
93-
{% endblock %}
94-
95-
{% block explore_additional_content %}
96-
<div class="row">
97-
{% if schema_url %}
98-
99-
<div class="col-md-3">
100-
<div class="panel panel-default">
101-
<div class="panel-heading">
102-
<h4 class="panel-title">{% trans 'Is structurally correct?' %}</h4>
103-
</div>
104-
<div class="panel-body">
105-
{% if validation_errors %}{% trans "No" %}{% else %}{% trans "Yes" %}{% endif %}
106-
107-
</div>
108-
</div>
109-
</div>
110-
111-
{% endif %}
112-
<div class="col-md-3">
113-
<div class="panel panel-default">
114-
<div class="panel-heading">
115-
<h4 class="panel-title">{% trans 'Number of records' %}</h4>
116-
</div>
117-
<div class="panel-body">
118-
{{records_aggregates.count}}
119-
</div>
120-
</div>
121-
</div>
122-
<div class="col-md-3">
123-
<div class="panel panel-default">
124-
<div class="panel-heading">
125-
<h4 class="panel-title">
126-
{% blocktrans %}Unique OCIDs{% endblocktrans %} ({{records_aggregates.unique_ocids|length}})
127-
</h4>
128-
</div>
129-
<div class="panel-body">
130-
<ul>
131-
{% for ocid in records_aggregates.unique_ocids %}
132-
<li>{{ocid}}</li>
133-
{% endfor %}
134-
</ul>
101+
</div>
135102
</div>
136103
</div>
137104
</div>
138-
</div><!--End Row -->
139-
140105
{% endblock %}

0 commit comments

Comments
 (0)