Skip to content

Commit

Permalink
wip ati
Browse files Browse the repository at this point in the history
  • Loading branch information
Bjwebb committed Dec 12, 2024
1 parent 6700e8f commit a78e811
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
2 changes: 2 additions & 0 deletions dashboard/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
"comprehensiveness": "Comprehensiveness",
"summary_stats": "Summary Statistics",
"humanitarian": "Humanitarian Reporting",
"ati_publishers": "",
"ati_publisher_detail": "",
}

page_leads = {
Expand Down
6 changes: 6 additions & 0 deletions dashboard/ui/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@
),
# Registration agencies.
path("registration-agencies", ui.views.registration_agencies, name="dash-registrationagencies"),
path("ati/publishers", ui.views.ati_publishers, name="dash-ati-publishers"),
path(
"ati/publishers/<slug:publisher>",
ui.views.ati_publisher_detail,
name="dash-ati-publisher-detail",
),
path(
"registration_agencies.html",
RedirectView.as_view(pattern_name="dash-registrationagencies", permanent=True),
Expand Down
30 changes: 24 additions & 6 deletions dashboard/ui/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,14 @@ def _make_context(page_name: str):
"summary_stats": "dash-publishingstats-summarystats",
"humanitarian": "dash-publishingstats-humanitarian",
},
current_stats=current_stats,
#current_stats=current_stats,
publisher_name=publisher_name,
publishers_ordered_by_title=publishers_ordered_by_title,
ckan_publishers=ckan_publishers,
ckan=ckan,
codelist_lookup=codelist_lookup,
codelist_mapping=codelist_mapping,
codelist_sets=codelist_sets,
#ckan_publishers=ckan_publishers,
#ckan=ckan,
#codelist_lookup=codelist_lookup,
#codelist_mapping=codelist_mapping,
#codelist_sets=codelist_sets,
github_issues=github_issues,
MAJOR_VERSIONS=MAJOR_VERSIONS,
expected_versions=vars.expected_versions,
Expand Down Expand Up @@ -577,3 +577,21 @@ def registration_agencies(request):
context["nonmatching"].append((orgid, publishers))

return HttpResponse(template.render(context, request))


#
# ATI pages
#
def ati_publishers(request):
template = loader.get_template("ati_publishers.html")
return HttpResponse(template.render(_make_context("ati_publishers"), request))


def ati_publisher_detail(request, publisher):
context = _make_context("ati_publisher_detail")
context["publisher"] = publisher
publisher_stats = get_publisher_stats(publisher)
context["publisher_stats"] = publisher_stats

template = loader.get_template("ati_publisher_detail.html")
return HttpResponse(template.render(context, request))

0 comments on commit a78e811

Please sign in to comment.