<script id="count_badge.partial" type="text/x-handlebars-template">
    {{#ifPositive count}}
        <span class="badge float-right badge-dark">{{count}}</span>
    {{else}}
        <span class="badge float-right badge-light disabled">0</span>
    {{/ifPositive}}
</script>

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