Skip to content

Commit

Permalink
[#108] Add ruleset pass percentages
Browse files Browse the repository at this point in the history
  • Loading branch information
Bjwebb committed May 19, 2014
1 parent 9b52d19 commit 0e800eb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions data.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def get_publisher_stats(publisher, stats_type='aggregated'):

current_stats = {
'aggregated': JSONDir('./stats-calculated/current/aggregated'),
'aggregated_file': JSONDir('./stats-calculated/current/aggregated-file'),
'inverted_publisher': JSONDir('./stats-calculated/current/inverted-publisher'),
'inverted_file': JSONDir('./stats-calculated/current/inverted-file'),
'download_errors': []
Expand Down
1 change: 1 addition & 0 deletions make_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def make_slugs(keys):
'xml.html': iati_stats_page('xml.html', xml=True),
'validation.html': iati_stats_page('validation.html', validation=True),
'versions.html': iati_stats_page('versions.html', versions=True, expected_versions=expected_versions),
'rulesets.html': iati_stats_page('rulesets.html', versions=True, expected_versions=expected_versions),
'licenses.html': licenses.main,
'organisation.html': iati_stats_page('organisation.html', organisation=True),
'elements.html': iati_stats_page('elements.html', elements=True),
Expand Down
1 change: 1 addition & 0 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
<li{% if xml %} class="active"{% endif %}><a href="{{url('xml.html')}}">XML Errors</a></li>
<li{% if validation %} class="active"{% endif %}><a href="{{url('validation.html')}}">Validation</a></li>
<li{% if versions %} class="active"{% endif %}><a href="{{url('versions.html')}}">Versions</a></li>
<li{% if rulesets %} class="active"{% endif %}><a href="{{url('rulesets.html')}}">Rulesets</a></li>
<li{% if licenses %} class="active"{% endif %}><a href="{{url('licenses.html')}}">Licenses</a></li>
<li{% if organisation %} class="active"{% endif %}><a href="{{url('organisation.html')}}">Organisation XML</a></li>
{% endif %}
Expand Down
4 changes: 4 additions & 0 deletions templates/publisher.html
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ <h3 class="panel-title">Files</h3>
<th>Activities <a href="{{stats_url}}/current/inverted-file/{{publisher}}/activities.json">(J)</a></th>
<th>Organisations <a href="{{stats_url}}/current/inverted-file/{{publisher}}/organisations.json">(J)</a></th>
<th>File Size <a href="{{stats_url}}/current/inverted-file/{{publisher}}/file_size.json">(J)</a></th>
<th>Version <a href="{{stats_url}}/current/inverted-file-publisher/{{publisher}}/versions.json">(J)</a></th>
<th><a href="../ruleset.html">Standard Ruleset</a> <a href="{{stats_url}}/current/inverted-./version.json">(J)</a></th>
</tr>
</thead>
<tbody>
Expand All @@ -247,6 +249,8 @@ <h3 class="panel-title">Files</h3>
<td>{{activities}}</td>
<td>{{current_stats.inverted_file.organisations.get(package)}}</td>
<td data-bytes="{{current_stats.inverted_file.file_size.get(package)}}">{{current_stats.inverted_file.file_size.get(package)|filesizeformat}}</td>
<td>{{current_stats.aggregated_file[publisher][package]['versions'].keys()[0]}}</td>
<td>{% if package in current_stats.inverted_file.ruleset_passes.standard %}{{100.0*current_stats.inverted_file.ruleset_passes.standard[package]/current_stats.inverted_file.activities[package]}}{% endif %}</td>
</tr>
{% endfor %}
</tbody>
Expand Down

0 comments on commit 0e800eb

Please sign in to comment.