{% load i18n %}

{% if request.site.rule_set.count %}
<div class="panel panel-default">
  <div class="panel-heading">
    <a class="btn btn-default btn-sm" role="button" data-toggle="collapse" href="#show-global-rules" aria-expanded="false" aria-controls="collapseExample">
    Common Rules
    </a>
  </div>
  {% include "promgen/rule_block.html" with rule_list=request.site.rule_set.all show_overwrite=project.service.id collapse="show-global-rules" content_type='project' show_overwrite=project.id %}
</div>
{% endif %}

{% if project.service.rule_set.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-rules" aria-expanded="false" aria-controls="collapseExample">
      Rules for {{ project.service.name }}
    </a>
  </div>
  {% include "promgen/rule_block.html" with rule_list=project.service.rule_set.all content_type='project' collapse="show-service-rules" show_overwrite=project.id %}
</div>
{% endif %}

{% if project.rule_set.count %}
<div class="panel panel-primary">
  <div class="panel-heading">Rules for {{ project.name }}</div>
  {% include "promgen/rule_block.html" with rule_list=project.rule_set.all content_type='project' show_edit=1 %}
</div>
{% endif %}
