{% load i18n %}

{% if project.service.notifiers.count %}
<div class="panel panel-default">
  <div class="panel-heading">
    <a class="btn btn-default btn-sm" role="button" data-toggle="collapse" href="#show-service-senders" aria-expanded="false" aria-controls="collapseExample">
      Service Notifiers ({{project.service.notifiers.count}})
    </a>
  </div>
  {% include "promgen/notifier_block.html" with object=project.service collapse="show-service-senders" %}
</div>
{% endif %}


<div class="panel panel-primary">
  <div class="panel-heading">Project Notifiers</div>
  {% include "promgen/notifier_block.html" with object=project show_edit=1 %}
  <div class="panel-footer">
    <a href="{% url 'project-notifier' project.id %}" class="btn btn-primary">{% trans "Register Notifier" %}</a>
    <form action="{% url 'project-notifier' project.id %}" style="display:inline" method="post">{% csrf_token %}
      <input type="hidden" name="sender" value="promgen.notification.user">
      <input type="hidden" name="value" value="{{request.user.username}}" />
      <button class="btn btn-primary">{% trans "Subscribe to Notifications" %}</button>
    </form>
  </div>
</div>
