Skip to content

Commit

Permalink
Merge pull request #6528 from OCHA-DAP/hotfix/hdx-10559
Browse files Browse the repository at this point in the history
HDX-10559 add text for not logged in users on stats tab
  • Loading branch information
danmihaila authored Feb 6, 2025
2 parents 223a003 + 0a0ae5a commit cb2d35f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -77,22 +77,26 @@ def test_stats_organization(self,hdx_generate_organization_stats, app):
# no user
result = app.get(url, headers={})
assert 'Monthly dataset download and page view statistics' not in result.body
assert 'If you are an administrator of this organization, you can log in to download monthly statistics going back five years.' in result.body

url = h.url_for('hdx_org.stats', id=org_id)
# regular user
result = app.get(url, headers=auth_user)
assert 'Monthly dataset download and page view statistics' not in result.body
assert 'If you are an administrator of this organization, you can log in to download monthly statistics going back five years.' in result.body

url = h.url_for('hdx_org.stats', id=org_id)
# org member
result = app.get(url, headers=auth_member)
assert 'Monthly dataset download and page view statistics' not in result.body
assert 'If you are an administrator of this organization, you can log in to download monthly statistics going back five years.' in result.body

url = h.url_for('hdx_org.stats', id=org_id)
# org admin
result = app.get(url, headers=auth_admin)
assert result.status_code == 200
assert 'Monthly dataset download and page view statistics' in result.body
assert 'If you are an administrator of this organization, you can log in to download monthly statistics going back five years.' not in result.body


# download xls access
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ <h2 class="hide-heading">{% block page_heading %}{{ _('Stats') }}{% endblock %}<
<a href="{{ h.url_for('hdx_org.download_organization_stats', id=org_meta.org_dict.id) }}">XLSX</a></p>
</div>
{% set margin_top="mt0" %}
{% else %}
<div class="text-end mt-3">
<p>If you are an administrator of this organization, you can log in to download monthly statistics going back five years.</p>
</div>
{% set margin_top="mt0" %}
{% endif %}
<div class="{{ margin_top }} list-header crisis-list-header">
<span class="mL15 list-header-title">Number of Downloads (last 24 weeks)</span>
Expand Down
2 changes: 1 addition & 1 deletion ckanext-hdx_theme/ckanext/hdx_theme/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hdx_version = 'v1.87.4'
hdx_version = 'v1.87.5'

0 comments on commit cb2d35f

Please sign in to comment.