Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report views refactor #347

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions tally_ho/apps/tally/static/js/data_table.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,10 @@ $(document).ready(function () {
stateSave: true,
ajax: LIST_JSON_URL,
dom:
"<'row'<'col-sm-1'B><'col-sm-6'l><'col-sm-5'f>>" +
"<'row'<'col-sm-6'l><'col-sm-6'f>>" +
"<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
buttons: [
{
extend: "csv",
filename: exportFileName,
action: exportAction,
exportOptions: {
columns: ':visible :not(.hide-from-export)',
},
},
],
buttons: [],
select: {
style: "multi",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,15 @@

<h1>{{ title }}</h1>
<br>

<div class="row">
<div class="col-sm-4">
{% if 'Active' in title %}
<a href="{% url 'result-export' tally_id=tally_id report='active-candidates' %}">{% trans 'Download Active Candidate Votes' %}</a>
{% else %}
<a href="{% url 'result-export' tally_id=tally_id report='all-candidates' %}">{% trans 'Download All Candidate Votes' %}</a>
{% endif %}
</div>
</div>
<table class="display datatable results">
<caption style="margin-top: 2em; margin-left: -0.5em">
<div id="report" class="row">
Expand Down
6 changes: 5 additions & 1 deletion tally_ho/apps/tally/templates/reports/duplicate_results.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@

<h1>{% trans 'Result Forms with Duplicate Results' %}</h1>
<br>

<div class="row">
<div class="col-sm-5">
<a href="{% url 'result-export' tally_id=tally_id report='duplicates' %}">{% trans 'Download Result Forms With Duplicate Results' %}</a>
</div>
</div>
<table class="display datatable results">
<caption style="margin-top: 2em; margin-left: -0.5em">
<div id="report" class="row">
Expand Down
6 changes: 5 additions & 1 deletion tally_ho/apps/tally/templates/reports/form_results.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@

<h1>{% trans 'Form Results' %}</h1>
<br>

<div class="row">
<div class="col-sm-4">
<a href="{% url 'result-export' tally_id=tally_id report='formresults' %}">{% trans 'Download Form List' %}</a>
</div>
</div>
<table class="display datatable results">
<caption style="margin-top: 2em; margin-left: -0.5em; margin-bottom: 2em;">
<div id="report" class="row">
Expand Down
16 changes: 4 additions & 12 deletions tally_ho/apps/tally/templates/super_admin/result_export.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,11 @@
{% block content %}

<h1>{% trans 'Downloads' %}</h1>
<!-- TODO: uncomment after figuring out how these reports can be used on the hnec public site -->
<!-- <ul>
<li><a href="{% url 'form-results' tally_id=tally_id %}">{% trans 'Result Form List' %}</a></li>
<li><a href="{% url 'all-candidates-votes' tally_id=tally_id %}">{% trans 'All Candidate Votes' %}</a></li>
<li><a href="{% url 'active-candidates-votes' tally_id=tally_id %}">{% trans 'Active Candidate Votes' %}</a></li>
<li><a href="{% url 'result-forms-with-duplicate-results' tally_id=tally_id %}">{% trans 'Result Forms With Duplicate Results' %}</a></li>
</ul> -->

<ul>
<li><a href="{% url 'result-export' tally_id=tally_id report='formresults' %}">{% trans 'Result Form List' %}</a></li>
<li><a href="{% url 'result-export' tally_id=tally_id report='all-candidates' %}">{% trans 'All Candidate Votes' %}</a></li>
<li><a href="{% url 'result-export' tally_id=tally_id report='active-candidates' %}">{% trans 'Active Candidate Votes' %}</a></li>
<li><a href="{% url 'result-export' tally_id=tally_id report='duplicates' %}">{% trans 'Result Forms With Duplicate Results' %}</a></li>
<li><a href="{% url 'form-results' tally_id=tally_id %}">{% trans 'Result Form List' %}</a></li>
<li><a href="{% url 'all-candidates-votes' tally_id=tally_id %}">{% trans 'All Candidate Votes' %}</a></li>
<li><a href="{% url 'active-candidates-votes' tally_id=tally_id %}">{% trans 'Active Candidate Votes' %}</a></li>
<li><a href="{% url 'result-forms-with-duplicate-results' tally_id=tally_id %}">{% trans 'Result Forms With Duplicate Results' %}</a></li>
</ul>

{% endblock %}