|
1 | 1 | {% extends 'cove_ocds/explore_base.html' %} |
2 | 2 | {% load i18n %} |
3 | | - |
| 3 | +{% load cove_tags %}{# subtract #} |
4 | 4 |
|
5 | 5 | {% block key_facts %} |
6 | | -{% with releases_aggregates as ra %} |
7 | | - |
8 | | - |
9 | | - <div class="col-md-6"> |
| 6 | + <div class="col-md-12"> |
10 | 7 | <div class="panel panel-primary {% if validation_errors or additional_closed_codelist_values or extensions and extensions.invalid_extension %}panel-danger{% endif %}"> |
11 | 8 | <div class="panel-heading"> |
12 | 9 | <h4 class="panel-title">{% trans 'Headlines' %}</h4> |
13 | 10 | </div> |
14 | 11 | <div class="panel-body"> |
15 | | - |
16 | 12 | {% if conversion_warning_messages or conversion_warning_messages_titles %} |
17 | 13 | <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"> |
20 | 17 | {% if validation_errors or additional_closed_codelist_values %} |
21 | 18 | <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 " %} |
24 | 21 | {% 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 %} |
26 | 23 | {% if validation_errors %}<br/>{% blocktrans %}See <a href="#validation-errors">Structural Errors</a> below.{% endblocktrans %}{% endif %} |
27 | 24 | </div> |
28 | 25 |
|
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"> |
30 | 34 | <strong>{% trans "At a glance" %}</strong> |
31 | 35 | <ul> |
| 36 | + {% if count %} |
32 | 37 | <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 %} |
36 | 40 | </li> |
| 41 | + {% endif %} |
| 42 | + |
37 | 43 | {% if data_schema_version %} |
38 | 44 | <li><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> |
39 | 45 | {% trans "The schema version specified in the file is" %} <strong>{{data_schema_version}}</strong>. |
40 | 46 | </li> |
41 | 47 | {% 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 | + |
45 | 49 | {% if json_data.publisher %} |
46 | 50 | <li><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> |
47 | 51 | {% trans "The publisher named in the file is" %} <strong>{{json_data.publisher.name}}</strong>. |
48 | 52 | </li> |
49 | 53 | {% endif %} |
| 54 | + |
50 | 55 | {% if json_data.license %} |
51 | 56 | <li><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> |
52 | 57 | {% trans "The license is" %} <a href="{{json_data.license}}">{{json_data.license}}</a>. |
53 | 58 | </li> |
54 | 59 | {% endif %} |
| 60 | + |
55 | 61 | {% if json_data.publicationPolicy %} |
56 | 62 | <li><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> |
57 | 63 | {% trans "Publication policy is" %} <a href="{{json_data.publicationPolicy}}">{{json_data.publicationPolicy}}</a>. |
58 | 64 | </li> |
59 | 65 | {% 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 %} |
64 | 72 | </li> |
65 | 73 | {% endif %} |
66 | | - |
| 74 | + |
67 | 75 | {% if data_only %} |
68 | 76 | <li><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> |
69 | 77 | {% 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 %} |
70 | 78 | </li> |
71 | 79 | {% endif %} |
| 80 | + |
72 | 81 | {% if csv_encoding and csv_encoding != "utf-8-sig" %} |
73 | 82 | <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 %} |
75 | 84 | </li> |
76 | 85 | {% 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 | + |
77 | 93 | <li><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> |
78 | | - {% trans "Data " %} |
79 | 94 | {% if source_url %} |
80 | | - {% trans "downloaded from " %} {{source_url}} |
| 95 | + {% blocktrans %}Data downloaded from {{ source_url }} on {{ created_datetime }}.{% endblocktrans %} |
81 | 96 | {% else %} |
82 | | - {% trans "uploaded " %} |
| 97 | + {% blocktrans %}Data uploaded on {{ created_datetime }}.{% endblocktrans %} |
83 | 98 | {% endif %} |
84 | | - {% trans "on " %} {{created_datetime}} |
85 | 99 | </li> |
86 | 100 | </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> |
135 | 102 | </div> |
136 | 103 | </div> |
137 | 104 | </div> |
138 | | -</div><!--End Row --> |
139 | | - |
140 | 105 | {% endblock %} |
0 commit comments