Skip to content

Commit

Permalink
badges beat labels; outputting badge_type if 0
Browse files Browse the repository at this point in the history
  • Loading branch information
BigBlueHat committed Apr 27, 2012
1 parent ef259a9 commit 6b81d8c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions breweries.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// the brewery doc itself adds to the count of docs
// so we're removing it here.
'count' => $entry['value'] - 1,
'badge_type' => ($entry['value'] - 1 == 0 ? 'badge-warning' : 'badge-info'),
'beers_url' => '../beers/?by=' . $entry['key'][0]);
}
$app->view()->appendData(array('breweries'=> $beer_counts));
Expand Down
2 changes: 1 addition & 1 deletion templates/breweries.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{{#breweries}}
<li>
<a href="{{url}}" title="more about {{name}}">{{name}}</a>
<a class="label label-info" href="{{beers_url}}">{{count}}</a>
<a class="badge {{badge_type}}" href="{{beers_url}}">{{count}}</a>
</li>
{{/breweries}}
</ul>

0 comments on commit 6b81d8c

Please sign in to comment.