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

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

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

{% block series_set_title %}Metadata{% endblock %}

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

{% block series_set_content %}
<div class="pt-3 my-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">
        Series set metadata is empty.
    </p>
    {% endif %}
</div>
{% endblock %}
