Skip to content

Commit

Permalink
Table for resources is now displayed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikola Lekich committed Jan 22, 2020
1 parent 72d129f commit be4fa76
Showing 1 changed file with 86 additions and 1 deletion.
87 changes: 86 additions & 1 deletion ckanext/knowledgehub/templates/package/resource_read.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{% resource 'knowledgehub/javascript/resource_feedback.js' %}
{% resource 'knowledgehub/javascript/copy_clipboard.js' %}
{% ckan_extends %}

{% set data_quality = h.get_resource_data_quality(resource_id) %}
{% block resource_actions %}
<ul>
{% block resource_actions_inner %}
Expand Down Expand Up @@ -297,7 +297,92 @@
{% endblock %}

{% block primary_content %}
<section class="additional-info">
<h3>{{ _('Data Quality') }}</h3>
{% if data_quality.calculated_on %}
<p>Calculated on: {{data_quality.calculated_on}}</p>
{% endif %}
<table class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th scope="col">{{ _('Field') }}</th>
<th scope="col">{{ _('Value') }}</th>
</tr>
</thead>
<tbody>
<!-- <label> Completeness </label> <span> {{data_quality.timeliness }} -->
{% if data_quality.completeness %}
<tr>
<th>Completeness</th>
<td>{{data_quality.completeness}}</td>
</tr>
{% else %}
<tr>
<th>Completeness</th>
<td>N/A</td>
</tr>
{% endif %}
{% if data_quality.timeliness %}
<tr>
<th>Timeliness</th>
<td>{{data_quality.timeliness}}</td>
</tr>
{% else %}
<tr>
<th>Timeliness</th>
<td>N/A</td>
</tr>
{% endif %}
{% if data_quality.validity %}
<tr>
<th>Validity</th>
<td>{{data_quality.validity}}</td>
</tr>
{% else %}
<tr>
<th>Validity</th>
<td>N/A</td>
</tr>
{% endif %}
{% if data_quality.uniqueness %}
<tr>
<th>Uniqueness</th>
<td>{{data_quality.uniqueness}}</td>
</tr>
{% else %}
<tr>
<th>Uniqueness</th>
<td>N/A</td>
</tr>
{% endif %}
{% if data_quality.consistency %}
<tr>
<th>Consistency</th>
<td>{{data_quality.consistency}}</td>
</tr>
{% else %}
<tr>
<th>Consistency</th>
<td>N/A</td>
</tr>
{% endif %}
{% if data_quality.accuracy %}
<tr>
<th>Accuracy</th>
<td>{{data_quality.accuracy}}</td>
</tr>
{% else %}
<tr>
<th>Accuracy</th>
<td>N/A</td>
</tr>
{% endif %}

</tbody>
</table>
</section>

{{ super() }}

{{ h.disqus_comments() }}
{% endblock %}

0 comments on commit be4fa76

Please sign in to comment.