{% include "loads/header.html" %}

<p>Selected Work Package : {{package}} <a href="{%url 'workpackage_change' %}">(Change Package)</a></p>

{% if package.draft %}
<h1>This is a DRAFT allocation and may be incomplete.</h1>
{% endif %}  

{% if combined_list %}
    <table border="1">
      <tr>
        <th>Module Code</th><th>Module Name</th><th>Relationship</th><th>Most Recent Assessment Resource</th><th>Details</th>
      </tr>
      {% for module, relationship, resource in combined_list %}
      <tr class="{% cycle 'row1' 'row2' as rowcolours %}">
        <th>{{ module.module_code }}</th>
        <td>{{ module.module_name }}</td>
        <td>{% for relation in relationship %}{% if relation == 'team_member' %}Team{% endif %}{% if relation == 'moderator' %}Moderator{% endif %}{% endfor %} </td>
        <td>{% if resource %}{{resource.resource_type}} ({{ resource.created }}){% else %}No Information{% endif %}</td>
        <td><a href="{% url 'modules_details' module.id %}">Details</a></td>
      </tr>      
      {% endfor %}
    </table>
    
  <p>Total of {{ combined_list|length}} module{{combined_list|length|pluralize}}.
  </p>
    
{% else %}
    <p>No modules currently exist for this package.</p>
{% endif %}

{% include "loads/footer.html" %}
{% include "loads/header.html" %}

<p>Selected Work Package : {{package}} <a href="{%url 'workpackage_change' %}">(Change Package)</a></p>

{% if package.draft %}
<h1>This is a DRAFT allocation and may be incomplete.</h1>
{% endif %}  

{% if combined_list %}
    <table border="1">
      <tr>
        <th>Module Code</th><th>Module Name</th><th>Relationship</th><th>Most Recent Assessment Resource</th><th>Details</th>
      </tr>
      {% for module, relationship, resource in combined_list %}
      <tr class="{% cycle 'row1' 'row2' as rowcolours %}">
        <th>{{ module.module_code }}</th>
        <td>{{ module.module_name }}</td>
        <td>{% if relationship %}{% for relation in relationship %}{% if relation == 'external' %}External Examiner (Information Only){% endif %}{% if relation == 'lead_external' %}Lead External Examiner{% endif %}{% if relation == 'team_member' %}Team{% endif %}{% if relation == 'moderator' %}Moderator{% endif %}{% endfor %}{% else %}None{% endif %} </td>
        <td>{% if resource %}{{resource.resource_type}} ({{ resource.created }}){% else %}No Information{% endif %}</td>
        <td><a href="{% url 'modules_details' module.id %}">Details</a></td>
      </tr>      
      {% endfor %}
    </table>
    
  <p>Total of {{ combined_list|length}} module{{combined_list|length|pluralize}}.
  </p>
    
{% else %}
    <p>No modules currently exist for this package.</p>
{% endif %}

{% include "loads/footer.html" %}
Add external and lead external relationships and none if appropriate
Add external and lead external relationships and none if appropriate

This feels really clunky, and it's partly to allow translation but I haven't looked up how that works.
