Skip to content

Commit

Permalink
wip ati
Browse files Browse the repository at this point in the history
  • Loading branch information
Bjwebb committed Dec 13, 2024
1 parent 5fca83b commit f419cd4
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 0 deletions.
30 changes: 30 additions & 0 deletions dashboard/templates/ati_publisher_detail.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{% extends 'base.html' %}
{% block content %}
<div class="row">
<div class="col-xs-12">
<div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title"></h3></div>
<div class="panel-body">
<p>This is a work in progress development copy.</p>
<td>{{ publisher_stats.ati_current }}</td>
{% include '_partials/tablesorter_instructions.html' %}
</div>
<table class="table table-striped">
<thead>
<tr>
<th>Test Name</th>
</tr>
</thead>
<tbody>
{% for test_name, test_value in publisher_stats.ati_tests.items() %}
<tr>
<td>{{ test_name }}</td>
<td>{{ test_value }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endblock %}
18 changes: 18 additions & 0 deletions dashboard/templates/ati_publishers.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% extends 'base.html' %}
{% block content %}
<div class="row">
<div class="col-xs-12">
<div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title"></h3></div>
<div class="panel-body">
<p>This is a work in progress development copy.</p>
<ul>
{% for publisher_title, publisher in publishers_ordered_by_title %}
<li><a href="{{ url('dash-ati-publisher-detail', args=[publisher]) }}">{{ publisher_name[publisher] }}</a></li>
{% endfor %}
</ul>
</div>
</div>
</div>
</div>
{% endblock %}
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
18 changes: 18 additions & 0 deletions dashboard/ui/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,3 +581,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", include_large_dicts=False), request))


def ati_publisher_detail(request, publisher):
context = _make_context("ati_publisher_detail", include_large_dicts=False)
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 f419cd4

Please sign in to comment.