{% macro linkindex(project) %}

<div class="backptr">
<a href="index.html">{{ project.name }} project page</a>
</div>

{% endmacro %}

{% macro issue_table(issues, show_component=false, show_release=false) %}

<table class="sortable">
  <thead>
    <tr>
      <td></td>
      <td>Created</td>
      <td>Description</td>
      {% if show_release %}
      <td>Release</td>
      {% endif %}
      {% if show_component %}
      <td>Component</td>
      {% endif %}
    </tr>
  </thead>
  <tbody>
    {% for issue in issues %}
    <tr>
      <td sorttable_customkey="{{ issue|sortkey }}">{{ issue|imagetag }}</td>
      <td class="littledate">{{ issue.creation_time|dateformat }}</td>
      <td class="issuename">{{ issue|link }}</td>
      {% if show_release %}
      <td class="issuerelease">
	{{ issue|release|link }}
      </td>
      {% endif %}
      {% if show_component %}
      <td class="issuecomponent">
	{{ issue|component|link }}
      </td>
      {% endif %}
    </tr>
    {% endfor %}
  </tbody>
</table>

{% endmacro %}

{% macro event_log(events) %}

<table class="log">
  <tbody>
    {% for time, who, what, comment in events|reverse %}
    <tr class="{{ loop.cycle('odd-row', 'even-row') }}">
    <td class="date">{{ time|timeformat }}</td>
    <td class="person">{{ who|email|e }}</td>
    <td class="message">{{ what }}</td>
    </tr>
    <tr>
      <td colspan="3" class="logcomment">
	{{ comment|addlinks }}
      </td>
    </tr>
    <tr>
      <td></td>
    </tr>
    {% endfor %}
  </tbody>
</table>

{% endmacro %}

{% macro recent_activity(activity) %}

<table class="log">
  <tbody>
    {% for date, email, text, comment, issue in activity %}
    <tr class="{{ loop.cycle('odd-row', 'even-row') }}">
      <td class="date">{{ date|dateformat }}</td>
      <td class="issuename">{{ issue|link(image=true) }}</td>
      <td>{{ text }}</td>
    </tr>
    <tr>
      <td></td>
    </tr>
    {% endfor %}
  </tbody>
</table>

{% endmacro %}
