{% extends "view_page.html" %}
{% load my_tags %}

{% block table_data %} 

<table cellspacing="0" class="infolist surname" width="90%">
<thead>
  <tr>
    <th>#</th>
    <th>ID</th>
    <th>Title</th>
    <th>Pub Info</th>
    <th>Author</th>
  </tr>
</thead>
<tbody>
  {% for source in page.object_list %}
  <tr class="{% cycle odd,even %}">
    <td>{{ forloop.counter|row_count:page }}</td>
    <td><a href="/{{view}}/{{source.handle|escape}}{{args}}" class="noThumb browsecell">
           <span class="grampsid">[{{source.gramps_id}}]</span></a>
    {% if user.is_authenticated or source.public %}
    <td><a href="/{{view}}/{{source.handle|escape}}{{args}}" class="browsecell">{{source.title|escape|nbsp}}</a>
    <td><a href="/{{view}}/{{source.handle|escape}}{{args}}" class="browsecell">{{source.pubinfo|nbsp}}</a>
    <td><a href="/{{view}}/{{source.handle|escape}}{{args}}" class="browsecell">{{source.author|nbsp}}</a>
    {% else %}
      <td></td>
      <td></td>
      <td></td>
    {% endif %}
  </tr>
  {% endfor %}
</tbody>
</table>

{% endblock %}

{% block admin_functions %}
{% if user.is_superuser %}
   <div style="background-color: lightgray; padding: 2px 0px 0px 2px">
   {% make_button "+Add Source" "/source/add" args %}
   </div>
{% endif %}
{% endblock %}