Skip to content

Commit

Permalink
Replace "Department" with "State"
Browse files Browse the repository at this point in the history
In both prose and within code. Towards #1.
  • Loading branch information
waldoj committed Nov 9, 2015
1 parent 6425915 commit d0758db
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions public/common/templates/card-template.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="panel panel-default">
<div class="panel-heading department-title-heading">
<h1 class="department-title">{{Department}}, {{State}} {{"Type of Data"}}</h1>
<div class="panel-heading state-title-heading">
<h1 class="state-title">{{State}}: {{"Type of Data"}}</h1>
</div>
<div class="panel-body">
<div class="data-icons">
Expand Down
4 changes: 2 additions & 2 deletions public/datasets/css/datasets.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.department-title {
.state-title {
margin-top: 0px;
margin-bottom: 0px;
color: white;
}

.panel-default > .department-title-heading {
.panel-default > .state-title-heading {
background-color: navy;
}
.clickable {
Expand Down
6 changes: 3 additions & 3 deletions public/datasets/datasets.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
<div class="col-xs-12 col-sm-8 col-sm-offset-2 col-md-10 col-md-offset-1 main">
<div class="alert alert-info" role="alert">
<!--<button type="button" class="close" data-dismiss="alert">×</button>-->
<p><b>Is something missing? Please let us know about <a href="https://docs.google.com/a/codeforamerica.org/forms/d/1Qe3UQOPI7w0QxdsVVhy6tTbX5TYMlqc48duP7YP9z6k/viewform">additional or updated policing datasets</a>.</b></p>
<p><b>Is something missing? Please let us know about <a href="https://docs.google.com/a/codeforamerica.org/forms/d/1Qe3UQOPI7w0QxdsVVhy6tTbX5TYMlqc48duP7YP9z6k/viewform">additional or updated datasets</a>.</b></p>
</div>
</div>
<div id="cards" class="col-xs-12 col-sm-8 col-sm-offset-2 col-md-10 col-md-offset-1 main">
</div>
</div>
</div>
<script id="department-template" type="text/x-handlebars-template">
<option onChange="filterByDepartment('{{Department}}')">{{Department}}</option>
<script id="state-template" type="text/x-handlebars-template">
<option onChange="filterByState('{{State}}')">{{State}}</option>
</script>
<script id="datatype-template" type="text/x-handlebars-template">
<li><a href="#" onClick="filterByDatatype('{{[Type of Data]}}' )">{{[Type of Data]}}</a></li>
Expand Down
14 changes: 7 additions & 7 deletions public/datasets/js/datasets.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
var allRows = [];

function showInfo(data, tabletop) {
allRows = _.sortBy(tabletop.sheets("Completed Detailed Data").all(), "Department");
allRows = _.sortBy(tabletop.sheets("Completed Detailed Data").all(), "State");

var uri = new URI();
var params = uri.search(true);

if (params) {
var filters = [];
filters.push(buildDepartmentFilter(params["department"]));
filters.push(buildStateFilter(params["state"]));
filters.push(buildDatatypeFilter(params["datatype"]));
updateCards(allRows, _.compact(filters));
} else {
Expand Down Expand Up @@ -68,12 +68,12 @@



function buildDepartmentFilter(department) {
if (!department) {
function buildStateFilter(state) {
if (!state) {
return false;
}
return function(row) {
return row["Department"] === department;
return row["State"] === state;
}
}

Expand All @@ -90,9 +90,9 @@
$("#cards").empty();
}

function filterByDepartment(department) {
function filterByState(state) {
clearCards();
updateCards(allRows, [buildDepartmentFilter(department)]);
updateCards(allRows, [buildStateFilter(state)]);
}

function resetSearch() {
Expand Down
2 changes: 1 addition & 1 deletion public/datatype/js/datatype.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var allRows = [];


function showInfo(data, tabletop) {
allRows = _.sortBy(tabletop.sheets("Completed Detailed Data").all(), "Department");
allRows = _.sortBy(tabletop.sheets("Completed Detailed Data").all(), "State");
filterByDatatype(pageType);
}

Expand Down

0 comments on commit d0758db

Please sign in to comment.