Skip to content

Commit

Permalink
Changed facets and properly filter projects and tools. #6
Browse files Browse the repository at this point in the history
  • Loading branch information
jmatsushita committed Jan 9, 2016
1 parent b66167f commit d60bc7d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 34 deletions.
28 changes: 15 additions & 13 deletions layouts/projects.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@
</div>
<div class="col-md-3">
<div class="form-group">
<fieldset id="phase_criteria">
<legend>Phase</legend>
<fieldset id="practice_criteria">
<legend>Practice</legend>
</fieldset>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<fieldset id="project_audience_criteria">
<legend>Project Audience</legend>
<fieldset id="phase_criteria">
<legend>Phase</legend>
</fieldset>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<fieldset id="practice_criteria">
<legend>Practice</legend>
<fieldset id="project_audience_criteria">
<legend>Project Audience</legend>
</fieldset>
</div>
</div>
Expand All @@ -59,14 +59,13 @@
<div class="row">
<div class="col-md-12" role="main">
<table class="table table-striped">
<thead><td>Type</td><td>Name</td><td>Description</td></thead>
<thead><td>Name</td><td>Description</td></thead>
<tbody class="search-results" id="results"></tbody>
</table>
</div>
</div>
<script id="result-template" type="text/html">
<tr>
<td><%= content_type %></td>
<td><a href="<%= path %>"><%= name %></a></td>
<td><%= description %></td>
</tr>
Expand Down Expand Up @@ -128,11 +127,14 @@
})

var ks = _.keys(store);
var results = _.map(ks, function(k) {
// add store key of object as path key of array object
var ret = _.extend( { path: k } , store[k] );
return ret;
})
var results = _.chain(ks)
.filter(function(k){ return store[k].content_type=="project"})
.map(function(k) {
// add store key of object as path key of array object
var ret = _.extend( { path: k } , store[k] );
return ret;
})
.value()

var FJS = FilterJS(results, '#results', {
template: '#result-template',
Expand Down
38 changes: 17 additions & 21 deletions layouts/tools.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
<p id="total-results"></p>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<fieldset id="practice_criteria">
<legend>Practice</legend>
</fieldset>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<fieldset id="usage_audience_criteria">
Expand All @@ -34,31 +41,17 @@
</fieldset>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<fieldset id="open_source_license_criteria">
<legend>Open Source License</legend>
</fieldset>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<fieldset id="practice_criteria">
<legend>Practice</legend>
</fieldset>
</div>
</div></div>
</div>
<div class="row">
<div class="col-md-12" role="main">
<table class="table table-striped">
<thead><td>Type</td><td>Name</td><td>Description</td></thead>
<thead><td>Name</td><td>Description</td></thead>
<tbody class="search-results" id="results"></tbody>
</table>
</div>
</div>
<script id="result-template" type="text/html">
<tr>
<td><%= content_type %></td>
<td><a href="<%= path %>"><%= name %></a></td>
<td><%= description %></td>
</tr>
Expand Down Expand Up @@ -120,11 +113,14 @@
})

var ks = _.keys(store);
var results = _.map(ks, function(k) {
// add store key of object as path key of array object
var ret = _.extend( { path: k } , store[k] );
return ret;
})
var results = _.chain(ks)
.filter(function(k){ return store[k].content_type=="tool"})
.map(function(k) {
// add store key of object as path key of array object
var ret = _.extend( { path: k } , store[k] );
return ret;
})
.value()

var FJS = FilterJS(results, '#results', {
template: '#result-template',
Expand Down

0 comments on commit d60bc7d

Please sign in to comment.