<!DOCTYPE html>
<html lang="{{ language }}">
    <head>
        <meta charset="utf-8"/>
        <title>{{ gettext('Record Metadata') }}</title>
        <style type="text/css">
            body, h3 {
                background-color: #ffffff;
                font-family: arial, verdana, sans-serif;
                text-align: left;
                float: left;
            }
            header {
                display: inline-block;
            }
        </style>
    </head>
    <body>
        <header>
            <h3>{{ gettext('Record Metadata') }} (<a href="{{ obj.url }}">{{ gettext('View XML') }}</a>)</h3>
        </header>
        <section id="record-metadata">
            <table>
                <tr>
                    <td>{{ gettext('Identifier') }}</td>
                    <td>{{ obj.identifier if obj.identifier not in [None, 'None', '']
                        else gettext('None') }}</td>
                </tr>
                <tr>
                    <td>{{ gettext('Title') }}</td>
                    <td>{{ obj.title if obj.title not in [None, 'None', '']
                        else gettext('None') }}</td>
                </tr>
                <tr>
                    <td>{{ gettext('Abstract') }}</td>
                    <td>{{ obj.abstract if obj.abstract not in [None, 'None', '']
                        else gettext('None') }}</td>
                </tr>
                <tr>
                    <td>{{ gettext('Subjects') }}</td>
                    <td>{% set filteredSubjects = obj.subjects | select('ne', None) | select('ne', 'None') | select('ne', '') | list %}
                        {{ filteredSubjects | join(',') if filteredSubjects else gettext('None') }}</td>
                </tr>
                <tr>
                    <td>{{ gettext('Creator') }}</td>
                    <td>{{ obj.creator if obj.creator not in [None, 'None', '']
                        else gettext('None') }}</td>
                </tr>
                <tr>
                    <td>{{ gettext('Contributor') }}</td>
                    <td>{{ obj.contributor if obj.contributor not in [None, 'None', '']
                        else gettext('None') }}</td>
                </tr>
                <tr>
                    <td>{{ gettext('Publisher') }}</td>
                    <td>{{ obj.publisher if obj.publisher not in [None, 'None', '']
                        else gettext('None') }}</td>
                </tr>
                <tr>
                    <td>{{ gettext('Modified') }}</td>
                    <td>{{ obj.modified if obj.modified not in [None, 'None', '']
                        else gettext('None') }}</td>
                </tr>
                <tr>
                    <td>{{ gettext('Language') }}</td>
                    <td>{{ obj.language if obj.language not in [None, 'None', '']
                        else gettext('None') }}</td>
                </tr>
                <tr>
                    <td>{{ gettext('Format') }}</td>
                    <td>{{ obj.format if obj.format not in [None, 'None', '']
                        else gettext('None') }}</td>
                </tr>
                <tr>
                    <td>{{ gettext('Rights') }}</td>
                    <td>{% set filteredRights = obj.rights | select('ne', None) | select('ne', 'None') | select('ne', '') | list %}
                        {{ filteredRights | join(',') if filteredRights else gettext('None') }}</td>
                </tr>
                <tr>
                    <td>{{ gettext('Bounding Box') }}</td>
                    <td>{{ [obj.bbox.minx, obj.bbox.miny, obj.bbox.maxx, obj.bbox.maxy] | join(',')
                           if obj.bbox not in [None, 'None', '']
                           else gettext('None') }}</td>
                </tr>
            </table>
        </section>
        <section id="links">
            <h4>Links</h4>
            <ul>
            {% for link in obj.references %}
                <li><a href="{{ link['url'] }}">
                    {{ link['name'] if link['name'] not in [None, 'None', '']
                       else link['description'] if link['description'] not in [None, 'None', '']
                       else link['scheme'] if link['scheme'] not in [None, 'None', '']
                       else gettext('Access Link') }}
                    {% if link['scheme'] not in [None, 'None', '']
                       and ( link['name'] not in [None, 'None', '']
                       or link['description'] not in [None, 'None', ''] ) %}
                           ({{ link['scheme'] }})
                    {% endif %}
                </a></li>
            {% endfor %}
            {% for link in obj.uris %}
                <li><a href="{{ link['url'] }}">
                    {{ link['name'] if link['name'] not in [None, 'None', '']
                       else link['description'] if link['description'] not in [None, 'None', '']
                       else link['protocol'] if link['protocol'] not in [None, 'None', '']
                       else gettext('Access Link') }}
                    {% if link['protocol'] not in [None, 'None', '']
                       and ( link['name'] not in [None, 'None', '']
                       or link['description'] not in [None, 'None', ''] ) %}
                           ({{ link['protocol'] }})
                    {% endif %}
                </a></li>
            {% endfor %}
            </ul>
        </section>
    </body>
</html>
