{% if no_fuzzy_time -%}
  {% set no_fuzzy_time_str = "&amp;no_fuzzy_time=" + no_fuzzy_time -%}
{% else -%}
  {% set no_fuzzy_time_str = "" -%}
{% endif -%}
{% set cycle_str = entry.cycle|replace('+', '%2B') -%}
{% set taskjobs_link = (
    (script ~ "/taskjobs/" ~ user ~ "?&amp;suite=" ~
     suite|urlencode|replace('/', '%2F') ~ no_fuzzy_time_str) | safe
) -%}
{% set view_link = (
    (script ~ "/view/" ~ user ~ "?&amp;suite=" ~ suite|urlencode|replace('/', '%2F') ~
     no_fuzzy_time_str) | safe
) -%}
<tr class="entry"><!-- entry row -->
  <td>
    <!-- entry: task status -->
    {% if entry.task_status == "succeeded" -%}
      {% set icon = "ok" %}
      {% set label_class = "label-success" %}
      {% set url_arg = (
        ("&amp;task_status=" ~
         task_status_groups["success"]|join("&amp;task_status=")) | safe
      ) -%}
    {% elif entry.task_status in ["failed", "submission failed"] -%}
      {% set icon = "remove" %}
      {% set label_class = "label-danger" %}
      {% set url_arg = (
        ("&amp;task_status=" ~
         task_status_groups["fail"]|join("&amp;task_status=")) | safe
      ) -%}
    {% else -%}
      {% set icon = "play" %}
      {% set label_class = "label-info" %}
      {% set url_arg = (
        ("&amp;task_status=" ~
         task_status_groups["active"]|join("&amp;task_status=")) | safe
      ) -%}
    {% endif -%}
    <small>
      <a href="{{taskjobs_link}}{{url_arg}}">
        <span class="label {{label_class}}">
          <i class="glyphicon glyphicon-{{icon}}"></i>
        </span>&nbsp;{{entry.task_status}}
      </a>
    </small>
  </td>
  <td>
    <!-- entry: submit_status, run_status -->
    <small>
    {% set link = (
        (script ~ "/taskjobs/" ~ user ~ "?&amp;suite=" ~
         suite|urlencode|replace('/', '%2F') ~ no_fuzzy_time_str) | safe
    ) -%}
    {% if entry.run_status == 0 -%}
      <a href="{{taskjobs_link}}&amp;job_status=succeeded"
      class="label label-success">
        <i class="glyphicon glyphicon-ok-circle" title="succeeded"></i>
      </a>
    {% elif entry.run_status == 1 -%}
      <a href="{{taskjobs_link}}&amp;job_status=failed"
      class="label label-danger">
        <i class="glyphicon glyphicon-remove-circle" title="failed"></i>
        {% if entry.run_signal and entry.run_signal not in ["ERR", "EXIT"] -%}
          {{entry.run_signal}}
        {% endif -%}
      </a>
    {% elif entry.events[1] -%}
      <a href="{{taskjobs_link}}&amp;job_status=running"
      class="label label-info">
        <i class="glyphicon glyphicon-play-circle" title="running"></i>
      </a>
    {% elif entry.submit_status == 0 -%}
      <a href="{{taskjobs_link}}&amp;job_status=submitted"
      class="label label-info">
        <i class="glyphicon glyphicon-time" title="submitted"></i>
      </a>
    {% elif entry.submit_status == 1 -%}
      <a href="{{taskjobs_link}}&amp;job_status=submission-failed"
      class="label label-danger">
        <i class="glyphicon glyphicon-remove-sign"
        title="submission failed"></i>
      </a>
    {% else -%}
      <span class="label label-default">
        <i class="glyphicon glyphicon-info-sign" title="ready"></i>
      </span>
    {% endif -%}
    </small>
  </td>
  <td>
    <!-- entry: cycle -->
    <small>
    {% if entry.cycle != "1" -%}
      <a
      href="{{taskjobs_link}}&amp;cycles={{cycle_str}}"
      title="{{entry.cycle}}">{{entry.cycle}}</a>
    {% endif -%}
    </small>
  </td>
  <td>
    <!-- entry: name -->
    <small>
      <a
      href="{{taskjobs_link}}&amp;tasks={{entry.name|urlencode}}"
      title="{{entry.name}}">{{entry.name}}</a>
    </small>
  </td>
  <td>
    <!-- entry: submi_num -->
    <small>
    {% if entry.submit_num > 0 %}
      <a
      href="{{taskjobs_link}}&amp;cycles={{cycle_str}}&amp;tasks={{entry.name|urlencode}}"
      >{{entry.submit_num}} of {{entry.submit_num_max}}</a>
    {% endif %}
    </small>
  </td>
  <td>
    <!-- entry: submit time -->
    <small>
      <abbr class="t_submit livestamp"
      title="{{entry.events[0]}}">{{entry.events[0] or ''}}</abbr>
    </small>
  </td>
  <td class="text-right">
    <!-- entry: start time -->
    {% if entry.events[1] -%}
      <small>
        <abbr class="t_init"
        title="{{entry.events[1]}}">{{entry.events[1]}}</abbr>
      </small>
    {% endif -%}
  </td>
  <td class="text-right">
    <!-- entry: exit time -->
    {% if entry.events[2] -%}
      <small>
        <abbr class="t_exit"
        title="{{entry.events[2]}}">{{entry.events[2]}}</abbr>
      </small>
    {% endif -%}
    <!-- entry: exit time -->
  </td>
  <td>
    <!-- entry: host -->
    {% if entry.host -%}
      <small>
       {{entry.host}}
     </small>
   {% endif -%}
  </td>
  <td>
    <!-- entry: submit_method and submit_method_id -->
    {% if entry.submit_method -%}
      <small>
        {{entry.submit_method}}{% if entry.submit_method_id -%}[{{entry.submit_method_id}}]{% endif -%}
      </small>
    {% endif -%}
  </td>
  <td>
    <!-- entry: logs -->
    <small>
      {% if entry.logs -%}
        <ul class="list-inline">
          {% for key, log in entry.logs|dictsort if not log.seq_key -%}
            {% if key in ["job.out", "job.err"] -%}
              {% set key_str = ("<strong>" ~ key ~ "</strong>") | safe -%}
            {% else -%}
              {% set key_str = key -%}
            {% endif -%}
            <li>
              {% set path_arg = log.path|urlencode -%}
              {% if log.path_in_tar -%}
                {% if path_in_tar is defined and path_in_tar == log.path_in_tar -%}
                  {{key_str}}
                {% else -%}
                  {% set path_in_tar_arg = log.path_in_tar|urlencode -%}
                  <a
                  {% if log.size == "?" or not log.size -%}class="text-muted" {% endif -%}
                  href="{{view_link}}&amp;path={{path_arg}}&amp;path_in_tar={{path_in_tar_arg}}"
                  title="{{log.size}} bytes">{{key_str}}</a>
                {% endif -%}
              {% else -%}
                {% if path is defined and path == log.path -%}
                  {{key_str}}
                {% else -%}
                  <a
                  {% if log.size == "?" or not log.size -%}class="text-muted" {% endif -%}
                  href="{{view_link}}&amp;path={{path_arg}}"
                  title="{{log.size}} bytes">{{key_str}}</a>
                {% endif -%}
              {% endif -%}
            </li>
          {% endfor -%}
        </ul>
      {% endif -%}<!-- entry.logs -->
      {% if entry.seq_logs_indexes -%}
        <ul class="list-inline">
          {% for seq_key, indexes in entry.seq_logs_indexes|dictsort -%}
            <li>
              <form action="{{script}}/view" class="form-inline"
                autocomplete="off">
                <input type="hidden" name="user" value="{{user}}"/>
                <input type="hidden" name="suite" value="{{suite|urlencode|replace("/", "%2F")}}"/>
                <input type="hidden" name="no_fuzzy_time"
                value="{{no_fuzzy_time}}"/>
                {% if entry.logs[indexes.values()|first].path_in_tar -%}
                  <input type="hidden" name="path"
                  value="{{entry.logs[indexes.values()|first].path}}"/>
                  <select class="seq_log" name="path_in_tar">
                    <option disabled="disabled"
                    selected="selected">{{seq_key}}</option>
                    {% for index, key in indexes|dictsort -%}
                      {% set log = entry.logs[key] -%}
                      <option title="{{log.size}} bytes"
                      {% if log.size == 0 -%}disabled="disabled"{% endif -%}
                      value="{{log.path_in_tar}}">{{key}}</option>
                    {% endfor -%}
                  </select>
                {% else -%}
                  <select class="seq_log" name="path">
                    <option disabled="disabled"
                    selected="selected">{{seq_key}}</option>
                    {% for index, key in indexes|dictsort -%}
                      {% set log = entry.logs[key] -%}
                      <option title="{{log.size}} bytes"
                      {% if log.size == 0 -%}disabled="disabled"{% endif -%}
                      value="{{log.path}}">{{key}}</option>
                    {% endfor -%}
                  </select>
                {% endif -%}
              </form>
            </li>
          {% endfor -%}
        </ul>
      {% endif -%}<!-- entry.seq_logs_indexes -->
    </small>
  </td>
</tr><!-- entry row -->
