-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathindex.html
32 lines (24 loc) · 1.17 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{% extends "_26thandcalifornia.html" %}
{% block page %}
<div class="headline">
<h1>{{ headline }}</h1>
</div>
<div class="hero">
{{ about_text|markdown }}
</div>
<hr />
<h3>On average, the jail population is <span class="population-trend-label"></span></h3>
<p>Since <span class="start"></span>, the average number of bookings per day is <span class="population-bookings"></span> and the average number of departures per day is <span class="population-leavings"></span>. This means that the jail population is changing by <span class="population-trend"></span> persons per day. <a href="population.html">Learn more about population trends »</a></p>
{% endblock %}
{% block data_loaded %}
var booked_avg = DailyPopulation.average('booked').toFixed(1);
var left_avg = DailyPopulation.average('left').toFixed(1);
var trend = (booked_avg - left_avg).toFixed(1);
var trend_label = (trend > 0) ? "increasing" : "decreasing";
var first = DailyPopulation.toJSON().pop();
$('.start').text(first.date);
$('.population-trend-label').text(trend_label);
$('.population-bookings').text(booked_avg);
$('.population-leavings').text(left_avg);
$('.population-trend').text(trend);
{% endblock %}