<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title>{{collection.title}}</title>
  <link rel="stylesheet" type="text/css" href="{{static_files}}/style.css">
</head>

<body>

<div id="bodyContent">
<div class="title">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
  <td>{{collection.title}}</td>
  <td align="right">{{date}}</td>
</tr>
</tbody>
</table>
</div>

<div>
{% for year_group in records|groupby('year') %}
<section class="coins">
<header>{{year_group.grouper}}</header>
  {% for series_group in year_group.list|groupby('series')|sort(attribute='1.0.issuedate_raw') %}
    {% if series_group.grouper and series_group.list|groupby('country')|length > 1 %}
<div class="row">
<div class="aside">
<div class="div-image">
      {% for country_group in series_group.list|groupby('country') %}
        {% set record=country_group.list[0] %}
        {% if record.obverseimg %}
<span><a href="{{static_files}}/{{record.obverseimg}}" class="image"><img style="width: {{record.diameter_raw}}mm" class="photo" src="{{static_files}}/{{record.obverseimg}}" alt="{{titles.obverseimg}}"></a></span>
        {% else %}
<center>{{titles.obverseimg}}</center>
        {% endif %}
      {% endfor %}
</div>
      <b>{{series_group.grouper}}</b>
<div class="div-mint">
  <table>
      {% for country_group in series_group.list|groupby('country') %}
        {% for mint_group in country_group.list|groupby('mintmark') %}
          {% set record_item=mint_group.list[0] %}
    <tr>
      <td>{{record_item.issuedate}}</td><td>{{record_item.country}}</td><td>{{record_item.mintmark}}</td><td style="text-align: right;">{{record_item.mintage}}</td>
      <td><input type="checkbox"
          {% for status_group in mint_group.list|groupby('status_raw') %}
            {% if status_group.grouper in ('owned', 'ordered', 'sale', 'duplicate', 'replacement') %}
        checked
            {% endif %}
          {% endfor %}
        onclick="return false;"></td>
    </tr>
        {% endfor %}
      {% endfor %}
  </table>
</div>
      {% set record=series_group.list[0] %}
      {{record.subject}}
</div>
</div>
    {% else %}
      {% for subject_group in series_group.list|groupby('subjectshort')|sort(attribute='1.0.issuedate_raw') %}
        {% set record=subject_group.list[0] %}
<div class="row">
<div class="aside">
<div class="div-image">
        {% if record.obverseimg %}
<center><a href="{{static_files}}/{{record.obverseimg}}" class="image"><img style="width: {{record.diameter_raw}}mm" class="photo" src="{{static_files}}/{{record.obverseimg}}" alt="{{titles.obverseimg}}"></a></center>
        {% else %}
<center>{{titles.obverseimg}}</center>
        {% endif %}
</div>
<div class="div-title"><b>{{record.subjectshort}}</b></div>
<div class="div-mint">
  <table>
        {% for mint_group in subject_group.list|groupby('mintmark') %}
          {% set record_item=mint_group.list[0] %}
    <tr>
      <td>{{record_item.issuedate}}</td><td>{{record_item.country}}</td><td>{{record_item.mintmark}}</td><td style="text-align: right;">{{record_item.mintage}}</td>
      <td><input type="checkbox"
          {% for status_group in mint_group.list|groupby('status_raw') %}
            {% if status_group.grouper in ('owned', 'ordered', 'sale', 'duplicate', 'replacement') %}
        checked
            {% endif %}
          {% endfor %}
        onclick="return false;"></td>
    </tr>
        {% endfor %}
  </table>
</div>
{{record.subject}}
</div>
</div>
      {% endfor %}
    {% endif %}
  {% endfor %}
</section>
{% endfor %}
</div>

<p>Generated by OpenNumismat</p>
</body>
</html>
