{% extends "report_base.html" %}
{% block content %}
<div class="page-header">
    <h1>{{ page_title }}</h1>
</div>

<div class="panel-group">
    <div class="panel panel-default">
        <div class="panel-heading" data-toggle="collapse" data-target="#collapse_expt">
            <h4 class="panel-title">
                <a>Experiments</a>
            </h4>
        </div>
        <div id="collapse_expt" class="panel-collapse collapse in">
            <div class="panel-body">
                {{ macros.table(crystal_table) }}
                <div class="panel-group">
                    <div class="panel panel-default">
                        <div class="panel-heading" data-toggle="collapse" data-target="#collapse_geom">
                            <h4 class="panel-title">
                                <a>Experimental geometry</a>
                            </h4>
                        </div>
                        <div id="collapse_geom" class="panel-collapse collapse">
                            <div class="panel-body">
                                {{ macros.table(geometry_table) }}
                            </div>
                        </div>
                    </div>
                    {% if scan_varying_graphs | length %}
                        {{ macros.panel('Analysis of scan-varying crystal model',
                                        'scan_varying', scan_varying_graphs) }}
                    {% endif %}
                </div>
            </div>
        </div>
    </div>
</div>

<div>
    <h2>DIALS analysis plots</h2>

    <div class="panel-group">
        {{ macros.panel('Analysis of strong reflections', 'strong', strong_graphs) }}
        {% if centroid_graphs | length %}
            {{ macros.panel('Analysis of reflection centroids', 'centroid', centroid_graphs) }}
        {% endif %}
        {% if intensity_graphs | length %}
            {{ macros.panel('Analysis of reflection intensities', 'intensity', intensity_graphs) }}
        {% endif %}
        {% if reference_graphs | length %}
            {{ macros.panel('Analysis of reference profiles', 'reference', reference_graphs) }}
        {% endif %}
    </div>
    {% if scaling_tables | length %}
        <div class="panel-group">
            <div class="panel panel-default">
                <div class="panel-heading" data-toggle="collapse" data-target="#collapse_scaling">
                    <h4 class="panel-title">
                        <a>Analysis of scaling results</a>
                    </h4>
                </div>
                <div id="collapse_scaling" class="panel-collapse collapse">
            <div class="panel-body">
                {{macros.merging_statistics(scaling_tables, xtriage_output, 'main')}}
            </div>
            {{ macros.panel('Analysis by resolution', 'cc_one_half', resolution_plots) }}
            {{ macros.panel('Analysis by image number', 'batch', batch_graphs, tables=image_range_tables) }}
            {{ macros.panel('Scaling model plots', 'scaling_model', scaling_model_graphs) }}
            {{ macros.panel('Miscellanous plots', 'misc_plots', misc_plots) }}
            {{ macros.panel('Scaled intensity plots', 'scaled_intensity_plots', scaled_intensity_plots) }}
        </div>
    {% endif %}

</div>

{% endblock %}
