{% macro list(name, btn=True, href=None, ng_click=None) %}
<div class="panel-group">
  <div class="panel panel-default polaris-well" ng-repeat="item in items | filter:libFilter">
    <div class="panel-body">
      {% if btn %}
      <div style="float:right;">
        <a href="/{{ name }}/edit/{%- raw %}{{ item.id }}{% endraw -%}"
          class="btn btn-info">edit</a>
      </div>
      {% endif %}
      <div style="padding: 5px">
        {% with %}
          {% if not href %}
            {% set href = "/{}/{{{{item.id}}}}".format(name) %}
          {% endif %}
          {% if ng_click %}
            {% set ng_click = '{}'.format(ng_click) %}
          {% else %}
            {% set ng_click = '' %}
          {% endif %}
          <a style="color: #2980b9" href="{{ href }}" ng-click="{{ ng_click }}"
            ng-bind="item.name"></a>
        {% endwith %}
      </div>
    </div>
  </div>
</div>
{% endmacro %}
