Skip to content

Commit

Permalink
link to historical data on download page
Browse files Browse the repository at this point in the history
  • Loading branch information
fgregg committed Apr 8, 2024
1 parent e9b00e3 commit 9a011c2
Showing 1 changed file with 97 additions and 90 deletions.
187 changes: 97 additions & 90 deletions pages/templates/downloads.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,107 +4,114 @@
{% block title %}Data downloads{% endblock %}

{% block full_content %}
<div class="container">
<div class="container">
<div class='row'>
<div class='col-sm-8 col-sm-offset-2'>
<h1 id='download'><i class='fa fa-fw fa-download'></i> Data downloads</h1>
<hr />
{{ page.text|safe }}
<h3>
<i class="fa fa-fw fa-users"></i>
Candidates and committees
</h3>
<br/>
<div class='col-sm-8 col-sm-offset-2'>
<h1 id='download'><i class='fa fa-fw fa-download'></i> Data downloads</h1>
<hr />
{{ page.text|safe }}
<h3>
<i class="fa fa-fw fa-users"></i>
Candidates and committees
</h3>
<br/>

<div class="row">
<h4 class="col-xs-12">
<i class="fa fa-fw fa-plus-circle"></i>
Contributions
</h4>
{% with action='/api/bulk/contributions/' icon='fa fa-fw fa-download' title='Contributions' from_id='from1' to_id='to1' %}
{% include 'camp_fin/widgets/calendar-form.html' %}
{% endwith %}
<div class="col-xs-12">
<br/>
</div>
</div>
<div class="row">
<h4 class="col-xs-12">
<i class="fa fa-fw fa-plus-circle"></i>
Contributions
</h4>
{% with action='/api/bulk/contributions/' icon='fa fa-fw fa-download' title='Contributions' from_id='from1' to_id='to1' %}
{% include 'camp_fin/widgets/calendar-form.html' %}
{% endwith %}
<div class="col-xs-12">
<br/>
</div>
</div>

<div class="row">
<h4 class="col-xs-12">
<i class="fa fa-fw fa-minus-circle"></i>
Expenditures
</h4>
{% with action='/api/bulk/expenditures/' icon='fa fa-fw fa-download' title='Expenditures' from_id='from2' to_id='to2' %}
{% include 'camp_fin/widgets/calendar-form.html' %}
{% endwith %}
<div class="col-xs-12">
<br/>
</div>
</div>
<div class="row">
<h4 class="col-xs-12">
<i class="fa fa-fw fa-minus-circle"></i>
Expenditures
</h4>
{% with action='/api/bulk/expenditures/' icon='fa fa-fw fa-download' title='Expenditures' from_id='from2' to_id='to2' %}
{% include 'camp_fin/widgets/calendar-form.html' %}
{% endwith %}
<div class="col-xs-12">
<br/>
</div>
</div>

<div class="row">
<h4 class="col-xs-12">
<i class="fa fa-fw fa-user"></i>
Candidates
</h4>
{% with action='/api/bulk/candidates/' icon='fa fa-fw fa-download' title='Candidates' from_id='from3' to_id='to3' %}
{% include 'camp_fin/widgets/calendar-form.html' %}
{% endwith %}
<div class="col-xs-12">
<br/>
</div>
</div>
<div class="row">
<h4 class="col-xs-12">
<i class="fa fa-fw fa-user"></i>
Candidates
</h4>
{% with action='/api/bulk/candidates/' icon='fa fa-fw fa-download' title='Candidates' from_id='from3' to_id='to3' %}
{% include 'camp_fin/widgets/calendar-form.html' %}
{% endwith %}
<div class="col-xs-12">
<br/>
</div>
</div>

<div class="row">
<h4 class="col-xs-12">
<i class="fa fa-fw fa-users"></i>
PACs
</h4>
{% with action='/api/bulk/committees/' icon='fa fa-fw fa-download' title='PACs' from_id='from4' to_id='to4' %}
{% include 'camp_fin/widgets/calendar-form.html' %}
{% endwith %}
<div class="col-xs-12">
<br/><br />
</div>
</div>
<div class="row">
<h4 class="col-xs-12">
<i class="fa fa-fw fa-users"></i>
PACs
</h4>
{% with action='/api/bulk/committees/' icon='fa fa-fw fa-download' title='PACs' from_id='from4' to_id='to4' %}
{% include 'camp_fin/widgets/calendar-form.html' %}
{% endwith %}
<div class="col-xs-12">
<br/><br />
</div>
</div>
<hr />
</div>
</div>
</div>
<div class='row'>
<div class='col-sm-8 col-sm-offset-2'>
<h3>Historical Data</h3>
<p><a href="https://openness-project-nmid.s3.amazonaws.com/historical_data.zip">Download historical data</a> (2010-2020 data).</p>
</div>
</div>
</div>
{% endblock %}

{% block extra_js %}
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.0/jquery-ui.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var ids = [1, 2, 3, 4, 5, 6, 7, 8, 9];
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.0/jquery-ui.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var ids = [1, 2, 3, 4, 5, 6, 7, 8, 9];

for (var i=0; i<ids.length; i++) {
var id = ids[i];
// Start date
$( '#from' + id ).datepicker({
dayNamesMin: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
prevText: '',
nextText: '',
dateFormat: "yy-mm-dd",
maxDate: new Date(),
minDate: new Date( 1994, 0, 1),
changeMonth: true,
changeYear: true
});
for (var i=0; i<ids.length; i++) {
var id = ids[i];
// Start date
$( '#from' + id ).datepicker({
dayNamesMin: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
prevText: '',
nextText: '',
dateFormat: "yy-mm-dd",
maxDate: new Date(),
minDate: new Date( 1994, 0, 1),
changeMonth: true,
changeYear: true
});

// End date
$( '#to' + id ).datepicker({
dayNamesMin: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
prevText: '',
nextText: '',
dateFormat: "yy-mm-dd",
maxDate: new Date(),
minDate: new Date( 1994, 0, 1),
changeMonth: true,
changeYear: true
});
}
// End date
$( '#to' + id ).datepicker({
dayNamesMin: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
prevText: '',
nextText: '',
dateFormat: "yy-mm-dd",
maxDate: new Date(),
minDate: new Date( 1994, 0, 1),
changeMonth: true,
changeYear: true
});
</script>
}
});
</script>
{% endblock %}

0 comments on commit 9a011c2

Please sign in to comment.