<script id="count_badge.partial" type="text/x-handlebars-template">
    {{#ifPositive count}}
        <a class="accordion-toggle" data-toggle="collapse" href="{{target}}"><span class="badge float-right btn-info">{{count}}</span></a>
    {{else}}
        <span class="badge float-right btn-info disabled">0</span>
    {{/ifPositive}}
</script>

<script>
    Handlebars.registerPartial("count_badge", $("#count_badge\\.partial").html());
</script>