{% set action = 'edit_view' if is_edit else 'resource_read' %}

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

<li{% if is_selected %} class="active"{% endif %} data-id="{{ view.id }}">

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