{% extends 'series-set-template-layout.html' %}

{% from 'macros.html' import visualize_metadata_value %}

{% block menu %}
{{ series_set_template_menu('Metadata') }}
{% endblock %}

{% block custom_actions %}
<a class="btn btn-primary me-2 mb-2 mb-sm-0" href="{{ url_for('.edit_series_set_template_metadata', templatename=template.name, sourcename=source_name) }}">
    Edit metadata
</a>
{% endblock %}

{% block series_set_template_content %}
<div class="mt-3 py-3">
    {% if metadata %}
    <table class="ts-table table table-borderless">
        <thead class="thead-secondary">
            <tr class="border-top border-bottom">
                <th scope="col">Metadata</th>
                <th scope="col">Configured value</th>
            </tr>
        </thead>
        <tbody>
            {% for k, v in metadata.iter_names() %}
            <tr class="border-bottom">
                <th scope="row">
                    {{ k|capitalize }}
                </th>
                {{ visualize_metadata_value(k, v)}}
            </tr>
            {% endfor %}
        </tbody>
    </table>
    {% else %}
    <p class="alert alert-info mt-3">
        No metadata configured for this series set template.
    </p>
    {% endif %}
</div>
{% endblock %}
