{% macro application_list_item(label, description, url, icon) %}
<div class="list-group-item d-flex align-items-center">
    <span class="d-flex flex-column me-3">
        {{ bootstrap_icon(icon, 'text-primary', size="24") }}
    </span>
    <div class="d-flex flex-column flex-grow-1">
        <a class="stretched-link text-decoration-none text-dark fw-bold" href="{{ url }}">{{ label }} </a>
        <small class="text-muted">{{ description }}</small>
    </div>
    <span class="d-flex flex-column text-muted">
        {{ bootstrap_icon('chevron-right') }}
    </span>
</div>
{% endmacro %}

<div class="modal fade" id="createApplicationModal" tabindex="-1" aria-labelledby="createApplicationLabel" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered modal-lg modal-fullscreen-md-down">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="createApplicationLabel">Applications</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body">
                <div class="list-group m-3">
                    {{ application_list_item('Compression optimization','[prototype]', url_for('compression.list_optimizations', sourcename=source_name), 'arrows-angle-contract')}}
                    {{ application_list_item('Flows','Run custom analyses on time series.', url_for('flows.list_flows', sourcename=source_name), 'shuffle')}}
                    {{ application_list_item('Series set discovery', '[prototype]', url_for('series_set_discovery.select_template', sourcename=source_name), 'search') }}
                    {{ application_list_item('Uncertainties propagation', '[prototype]', url_for('uncertainties_propagation.define_formula', sourcename=source_name), 'arrows-move') }}
                </div>
            </div>
        </div>
    </div>
</div>
