{% extends 'base.html' %}

{% block container %}
<h1>{{ _('Welcome to the Catalog Home') }}</h1>
  <a href="{{ url_for('catalog.products') }}" id="catalog_link">
  {{ _('Click here to see the catalog ') }}
  </a>
{% endblock %}

{% block scripts %}
<script>
$(document).ready(function(){
  $.getJSON("/home", function(data) {
    $('#catalog_link').append('<span class="badge">' + data.count + '</span>');
  });
});
</script>
{% endblock %}
