{% extends 'timeseer.html' %}
{% from 'flows.html' import flows_header with context %}
{% from 'macros.html' import bootstrap_icon, info_popover, menu_back, visualize_score %}
{% macro compare(a, b) %}
{% if a == b %}
=
{% elif a > b %}
{{ b - a }}%
{% else %}
+{{ b - a }}%
{% endif %}
|
{% endmacro %}
{% block styles %}
{% endblock %}
{% block menu %}
{{ menu_back(url_for('.list_reports', sourcename=source_name, blockevaluationid=block_evaluation.db_id)) }}
{% endblock %}
{% block main %}
{{ flows_header(block_evaluation.flow_evaluation, 'Compare reports') }}
Comparing reports from
{{ comparison.date|datetimeformat }}
{{ bootstrap_icon('box-arrow-up-right') }}
and
{{ report.date|datetimeformat }}
{{ bootstrap_icon('box-arrow-up-right') }}
.
Score |
{{ comparison.date|datetimeformat }} |
{{ report.date|datetimeformat }} |
Evolution |
Aggregated score |
{{ visualize_score(comparison.score) }}
{{ visualize_score(report.score) }}
{{ compare(comparison.score, report.score) }}
KPI |
{{ comparison.date|datetimeformat }} |
{{ report.date|datetimeformat }} |
Evolution |
{% for kpi in kpis %}
{{ kpi.name }}
{{ info_popover(kpi.short_help_text) }}
|
{% if kpi.name in comparison.kpi_scores %}
{{ visualize_score(comparison.kpi_scores[kpi.name]) }}
{% else %}
- |
{% endif %}
{% if kpi.name in report.kpi_scores %}
{{ visualize_score(report.kpi_scores[kpi.name]) }}
{% else %}
- |
{% endif %}
{% if kpi.name in comparison.kpi_scores and kpi.name in report.kpi_scores %}
{{ compare(comparison.kpi_scores[kpi.name], report.kpi_scores[kpi.name]) }}
{% else %}
- |
{% endif %}
{% endfor %}
{% for kpi in kpis %}
{{ kpi.name }} |
{{ comparison.date|datetimeformat }} |
{{ report.date|datetimeformat }} |
Evolution |
{% for score in report.kpi_score_scores[kpi.name]|sort(attribute='metadata.name') %}
{{ score.metadata.name|capitalize }}
{% if score.metadata.short_help_text %}
{{ info_popover(score.metadata.short_help_text) }}
{% endif %}
|
{% set comparison_scores = comparison.kpi_score_scores[kpi.name]|selectattr('metadata.name', 'eq', score.metadata.name)|list %}
{% if comparison_scores|count > 0 %}
{{ visualize_score(comparison_scores|first|attr('score')) }}
{{ visualize_score(score.score) }}
{{ compare(comparison_scores|first|attr('score'), score.score) }}
{% endif %}
{% endfor %}
{% endfor %}
{% endblock %}