Skip to content

Commit

Permalink
Merge pull request #611 from IATI/feat/change-branding-part-one
Browse files Browse the repository at this point in the history
Change branding to IATI - Part I
  • Loading branch information
chrisarridge authored Aug 28, 2024
2 parents 419b94c + f0bf0ed commit f5b3421
Show file tree
Hide file tree
Showing 17 changed files with 81 additions and 67 deletions.
29 changes: 21 additions & 8 deletions make_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ def xpath_to_url(path):
# remove conditions
path = re.sub(r'\[[^]]+\]', '', path)
if path.startswith('iati-activity'):
url = 'https://reference.codeforiati.org/activity-standard/iati-activities/' + path.split('@')[0]
url = 'http://iatistandard.org/activity-standard/iati-activities/' + path.split('@')[0]
elif path.startswith('iati-organisation'):
url = 'https://reference.codeforiati.org/organisation-standard/iati-organisations/' + path.split('@')[0]
url = 'http://iatistandard.org/organisation-standard/iati-organisations/' + path.split('@')[0]
else:
url = 'https://reference.codeforiati.org/activity-standard/iati-activities/iati-activity/' + path.split('@')[0]
url = 'http://iatistandard.org/activity-standard/iati-activities/iati-activity/' + path.split('@')[0]
if '@' in path:
url += '#attributes'
return url
Expand Down Expand Up @@ -117,7 +117,8 @@ def get_codelist_values(codelist_values_for_element):
app.jinja_env.filters['has_future_transactions'] = timeliness.has_future_transactions
app.jinja_env.filters['round_nicely'] = round_nicely

# Custom Jinja globals
# Custom Jinja globals - NOTE: codeforIATI stats URLs have not been
# changed.
app.jinja_env.globals['dataset_to_publisher'] = dataset_to_publisher
app.jinja_env.globals['url'] = lambda x: '/' if x == 'index.html' else x
app.jinja_env.globals['datetime_generated'] = lambda: datetime.now(UTC).strftime('%-d %B %Y (at %H:%M %Z)')
Expand Down Expand Up @@ -327,10 +328,22 @@ def registration_agencies():
nonmatching=nonmatching)


# Serve static files through the development server (--live)
@app.route('/<any("favicon.ico", "style.css", "img/tablesorter-icons.gif"):filename>')
def favicon_development(filename):
return send_from_directory('static', filename)
@app.route('/<any("img/tablesorter-icons.gif", "img/favicon.ico", "img/favicon-16x16.png", "img/favicon-32x32.png"):filename>')
def serve_images_development(filename):
"""Serve static images through the development server (--live)"""
return send_from_directory('static/', filename)


@app.route('/<any("style.css"):filename>')
def serve_css_development(filename):
"""Serve static css through the development server (--live)"""
return send_from_directory('static/', filename)


@app.route('/favicon.ico')
def favicon_root():
"""Serve favicon from img folder when requested from root"""
return send_from_directory('static/img', 'favicon.ico')


@app.route('/<name>.csv')
Expand Down
1 change: 0 additions & 1 deletion static/CNAME

This file was deleted.

Binary file removed static/favicon.ico
Binary file not shown.
Binary file added static/img/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/favicon.ico
Binary file not shown.
20 changes: 5 additions & 15 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='style.css') }}" />
<link rel="icon" href="{{ url_for('static', filename='favicon.ico') }}">
<title>{% block title %}{{ page_titles[page] }} – Code for IATI Analytics{% endblock %}</title>
<link rel="icon" href="{{ url_for('static', filename='img/favicon-32x32.png') }}" sizes="32x32" type="image/png">
<title>IATI Dashboard – {% block title %}{{ page_titles[page] }}{% endblock %}</title>

<script defer data-domain="dashboard.iatistandard.org" src="https://plausible.io/js/script.file-downloads.outbound-links.js"></script>
<script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>
Expand All @@ -28,15 +28,6 @@
<div id="wrap">
<div class="navbar navbar-default navbar-static-top" role="navigation">
<div class="container">
<div class="navbar-header">
<a href="#" class="navbar-brand" data-c4i-toggle="sidebar" aria-controls="c4i-sidebar" aria-expanded="false" aria-label="Toggle Code for IATI sidebar"><img src="https://codeforiati.org/assets/img/logo.png" alt="Code for IATI" /></a>
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li {% if page=='index' %}class="active"{% endif %}><a href="{{ url_for('homepage') }}">{{ top_titles['index'] }}</a></li>
Expand Down Expand Up @@ -82,21 +73,20 @@ <h1>{{ page_titles[page] }}</h1>
<div id="footer">
<div class="container">
<p class="text-muted">
<a href="https://github.com/codeforIATI/analytics/tree/{{ commit_hash }}">Source code</a>.
<a href="https://github.com/IATI/IATI-Dashboard/">Source code</a>.

<a href="https://github.com/codeforIATI/analytics/issues?state=open">Report bugs, and request features using Github issues</a>.<br/>
<a href="https://github.com/IATI/IATI-Dashboard/issues?state=open">Report bugs, and request features using Github issues</a>.<br/>

Generated on <em>{{ datetime_generated() }}</em> from data downloaded on <em>{{ datetime_data }}</em>.<br/>

(NB This is the time the download task started. Any changes made after this time may not be reflected).<br />

For details on how often these updates are applied, see the <a href="{{ url_for('basic_page', page_name='faq') }}">Code for IATI Analytics FAQ</a>.
For details on how often these updates are applied, see the <a href="{{ url_for('basic_page', page_name='faq') }}">IATI Dashboard FAQ</a>.

<a href="https://iatistandard.org/en/privacy-policy/">Privacy Policy</a></p>
</div>
</div>

<script src="//codeforiati.org/sidebar/sidebar.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.13.3/jquery.tablesorter.min.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion templates/codelist.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ <h1>Codelist values used for <code>{{ element }}</code></h1>
<p class="lead">Who uses <code>{{ codelist_mapping[major_version].get(element) }}</code> in <code><a href="{{ element|xpath_to_url }}">{{ element }}</a></code>?</p>
<p class="lead">(for files published to version {{ major_version }}.xx of the standard)</p>
<p style="float:right">(<a href="{{ stats_url }}/current/inverted-publisher/codelist_values.json">This page in JSON format</a>)</p>
<p>Values should be on the <code><a href="{% if major_version=='2' %}https://codelists.codeforiati.org/{% else %}https://iatistandard.org/105/codelists/{% endif %}{{ codelist_mapping[major_version].get(element) }}/">{{ codelist_mapping[major_version].get(element) }}</a></code> codelist.</p>
<p>Values should be on the <code><a href="{% if major_version=='2' %}http://iatistandard.org/codelists/{% else %}https://iatistandard.org/105/codelists/{% endif %}{{ codelist_mapping[major_version].get(element) }}/">{{ codelist_mapping[major_version].get(element) }}</a></code> codelist.</p>
{% endblock %}

{% block content %}
Expand Down
4 changes: 2 additions & 2 deletions templates/codelists.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ <h3 class="panel-title">Codelists for version {{ major_version }}.xx</h3>
{% for i, (element, values) in enumerate(current_stats.inverted_publisher.codelist_values_by_major_version[major_version].items()) %}
<tr>
<td><a href="{{ url_for('codelist', major_version=major_version, slug=slugs.codelist[major_version].by_i[i]) }}">{{ element }}</td>
<td><a href="https://codelists.codeforiati.org/{{ codelist_mapping[major_version].get(element) }}">{{ codelist_mapping[major_version].get(element) }}</a></td>
<td><a href="http://iatistandard.org/codelists/{{ codelist_mapping[major_version].get(element) }}">{{ codelist_mapping[major_version].get(element) }}</a></td>
<td><a href="{{ url_for('codelist', major_version=major_version, slug=slugs.codelist[major_version].by_i[i]) }}">{{ values|length }}</a></td>
<td><a href="https://codelists.codeforiati.org/{{ codelist_mapping[major_version].get(element) }}">{{ codelist_sets[major_version].get(codelist_mapping[major_version].get(element))|length }}</a></td>
<td><a href="http://iatistandard.org/codelists/{{ codelist_mapping[major_version].get(element) }}">{{ codelist_sets[major_version].get(codelist_mapping[major_version].get(element))|length }}</a></td>
{% with codes=sorted(codelist_sets[major_version].get(codelist_mapping[major_version].get(element)).intersection(get_codelist_values(values))) %}
<td><a href="{{ url_for('codelist', major_version=major_version, slug=slugs.codelist[major_version].by_i[i]) }}">{{ codes|length }}</a></td>
{% endwith %}
Expand Down
12 changes: 6 additions & 6 deletions templates/comprehensiveness_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ <h3 class="panel-title">Pseudocode</h3>
<td>Core</td>
<td>Version</th>
<td>iati-activities/@version must exist for the file the activity is in</th>
<td>iati-activities/@version must be on the <a href="https://codelists.codeforiati.org/Version/">Version codelist</a></th>
<td>iati-activities/@version must be on the <a href="http://iatistandard.org/codelists/Version/">Version codelist</a></th>
</tr>
<tr>
<td>Core</td>
Expand Down Expand Up @@ -269,7 +269,7 @@ <h3 class="panel-title">Pseudocode</h3>
<td>Core</td>
<td>Status</td>
<td>Activity must contain an activity-status element</td>
<td>activity-status/@code must be on the <a href="https://codelists.codeforiati.org/ActivityStatus/">ActivityStats codelist</a></td>
<td>activity-status/@code must be on the <a href="http://iatistandard.org/codelists/ActivityStatus/">ActivityStats codelist</a></td>
</tr>
<tr>
<td>Core</td>
Expand Down Expand Up @@ -308,7 +308,7 @@ <h3 class="panel-title">Pseudocode</h3>
<td>Financials</td>
<td>Transaction - Currency</td>
<td>All transactions must have value/@currency OR the activity must have a @default-currency attribute. All transactions must have value/@value-date</td>
<td>All currency values must be on the <a href="https://codelists.codeforiati.org/Currency/">Currency codelist</a>. value/@value-date must be valid <code>xs:date</code>.</td>
<td>All currency values must be on the <a href="http://iatistandard.org/codelists/Currency/">Currency codelist</a>. value/@value-date must be valid <code>xs:date</code>.</td>
</tr>
<tr>
<td>Financials</td>
Expand All @@ -320,7 +320,7 @@ <h3 class="panel-title">Pseudocode</h3>
<td>Financials</td>
<td>Budget</td>
<td>Activity must have at least 1 budget element OR the activity must have the budget-not-provided attribute AND no budget elements</td>
<td>Each budget element must contain period-start/@iso-date and period-end/@iso-date and value/@value-date that are valid <code>xs:date</code>s AND a value element that is a valid <code>xs:decimal</code> OR the activity element must have a valid iati-activity/@budget-not-provided attribute under the <a href="https://codelists.codeforiati.org/BudgetNotProvided/">BudgetNotProvided codelist</a> AND no budget elements</td>
<td>Each budget element must contain period-start/@iso-date and period-end/@iso-date and value/@value-date that are valid <code>xs:date</code>s AND a value element that is a valid <code>xs:decimal</code> OR the activity element must have a valid iati-activity/@budget-not-provided attribute under the <a href="http://iatistandard.org/codelists/BudgetNotProvided/">BudgetNotProvided codelist</a> AND no budget elements</td>
</tr>
{% endblock %}

Expand All @@ -347,7 +347,7 @@ <h3 class="panel-title">Pseudocode</h3>
<td>Value added</td>
<td>DAC Sectors</td>
<td>At least 1 sector where @vocabulary is <code>DAC</code> or <code>DAC-3</code> (1.xx) or <code>1</code> or <code>2</code> (2.xx), must be reported at activity level, unless there is no @vocabulary attribute, in which case DAC/1 is assumed. If there is no DAC sector element at activity level it must be reported within all transactions contained within that activity.</td>
<td>Must be valid code on the <a href="https://codelists.codeforiati.org/Sector/">DAC</a> or <a href="https://codelists.codeforiati.org/SectorCategory/">DAC-3</a> lists as appropriate.</td>
<td>Must be valid code on the <a href="http://iatistandard.org/codelists/Sector/">DAC</a> or <a href="http://iatistandard.org/codelists/SectorCategory/">DAC-3</a> lists as appropriate.</td>
</tr>
<tr>
<td>Value added</td>
Expand All @@ -365,7 +365,7 @@ <h3 class="panel-title">Pseudocode</h3>
<td>Value added</td>
<td>Aid Type</td>
<td>Activity must contain either i) a value in <code>default-aid-type/@code</code> or ii) each transaction must contain a value in <code>transaction/aid-type/@code</code>.</td>
<td>Must be valid code on the <a href="https://codelists.codeforiati.org/AidType/">AidType codelist</a>.</td>
<td>Must be valid code on the <a href="http://iatistandard.org/codelists/AidType/">AidType codelist</a>.</td>
</tr>
<tr>
<td>Value added</td>
Expand Down
4 changes: 2 additions & 2 deletions templates/coverage.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ <h3>The coverage stats page is being rebuilt.</h3>
<br>

<p>
In future, we plan to use an automated system that will calculate the coverage statistic for an organisation by using its <a href="https://reference.codeforiati.org/organisation-standard/">IATI organisation file.</a>
We are exploring a methodology that uses the <a href="https://reference.codeforiati.org/organisation-standard/iati-organisations/iati-organisation/total-expenditure/">&lt;total-expenditure&gt;</a> element in a publisher’s organisation file, and compares this to the total spend for a given year in their activity files.
In future, we plan to use an automated system that will calculate the coverage statistic for an organisation by using its <a href="http://reference.iatistandard.org/203/organisation-standard/">IATI organisation file.</a>
We are exploring a methodology that uses the <a href="http://reference.iatistandard.org/203/organisation-standard/iati-organisations/iati-organisation/total-expenditure/">&lt;total-expenditure&gt;</a> element in a publisher’s organisation file, and compares this to the total spend for a given year in their activity files.
Completing this work requires an update to the methodology. This is in our job queue but we don’t have an estimated time for completing the work.
Please look out for updates via <a href="https://discuss.iatistandard.org/">IATI Discuss</a> and our website.
</p>
Expand Down
4 changes: 2 additions & 2 deletions templates/data_quality.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends 'section_index.html' %}
{% block about %}
<p>This section tracks published IATI data around a series of quality measures.</p>
<p>These are specifically technical measures - schema validation, download issues, XML formatting, etc - that can be easily rectified by publishers. No attempt is made to evaluate the actual content of the data - it should be used for sense checking and technical fixes.</p>
<p>This section of the IATI Dashboard tracks published IATI data around a series of quality measures.</p>
<p>These are specifically technical measures - schema validation, download issues, XML formatting, etc - that can be easily rectified by publishers. No attempt is made to evaluate the actual content of the data - the dashboard should be used for sense checking and technical fixes.</p>
{% endblock about %}
{% block publisher_page_hash %}#h_dataquality{% endblock %}
4 changes: 2 additions & 2 deletions templates/exploring_data.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends 'section_index.html' %}
{% block about %}
This section tracks the various elements, attributes and codelists within published IATI data.
For every instance of these properties, a report is made available.
<p>This section tracks the various elements, attributes and codelists within published IATI data.</p>
<p>For every instance of these properties, a report is made available.</p>
{% endblock about %}
{% block publisher_page_hash %}#h_exploringdata{% endblock %}
Loading

0 comments on commit f5b3421

Please sign in to comment.