{% extends 'layout/page.html' %}

{% block head_title %}
  {{ i18n.gettext('List of issues') }}
{% endblock %}

{% block page_header %}
  {{ i18n.gettext('List of issues') }}
{% endblock %}

{% block content %}

  {% include 'layout/permission.html' %}

  {% if context.is_view_ok() %}
    {% if context.list() %}
      <table class='table'>
        <tr class='info'>
          <td>{{ i18n.gettext('Priority') }}</td>
          <td>{{ i18n.gettext('ID') }}</td>
          <td>{{ i18n.gettext('Activity') }}</td>
          <td>{{ i18n.gettext('Actor') }}</td>
          <td>{{ i18n.gettext('Keyword') }}</td>
          <td>{{ i18n.gettext('Title') }}</td>
          <td>{{ i18n.gettext('Status') }}</td>
          <td>{{ i18n.gettext('Creator') }}</td>
          <td>{{ i18n.gettext('Assigned To') }}</td>
        </tr>
        {% for issue in context.list() %}
          <tr>
           <td>{{ issue.priority.plain() }}</td>
           <td>{{ issue.id }}</td>
           <td>{{ issue.activity }}</td>
           <td>{{ issue.actor }}</td>
           <td>{{ issue.keyword.plain() }}</td>
           <td>
            <a href='issue{{ issue.id }}'>{{ issue.title.plain(hyperlink=0) }}</a>
           </td>
           <td>{{ issue.status.plain() }}</td>
           <td>{{ issue.creator.plain() }}</td>
           <td>{{ issue.assignedto.plain() }}</td>
          </tr>
        {% endfor %}
      </table>
      {% include 'layout/pagination.html' %}
  <div class='row-fluid'> 
    <div class='pull-right'>
      <a class='btn btn-success'
          href="{{ request.indexargs_url('issue', {'@action':'export_csv'}) }}">
        {{ i18n.gettext('Download as CSV') }}
      </a>
    </div>
  </div>

  {% include 'layout/sort.html' %}

    {% else %}
      <p class='text-error'>{{ i18n.gettext('There are no issues yet!') }}</p>
    {% endif %}

  {% endif %}

{% endblock %}
