{% set action = 'resource.edit_view' if is_edit else 'resource.read' %}

{% if current_filters %}
  {% set url = h.url_for(action, id=pkg.name,
                         resource_id=view.resource_id, view_id=view.id,
                         filters=current_filters) %}
{% else %}
  {% set url = h.url_for(action, id=pkg.name,
                         resource_id=view.resource_id, view_id=view.id) %}
{% endif %}

<li data-id="{{ view.id }}">
  {% set tab_class = "nav-link active" if is_selected else "nav-link" %}

  <a class="{{ tab_class }}" href="{{ url }}" data-id="{{ view.id }}">
    <i class="fa icon fa-{{ h.resource_view_icon(view) }}"></i>
    {{ view.title }}
  </a>
</li>
