2017-12-19 17:03:51 +01:00
{% extends "base.html" %}
{% block content %}
2018-01-29 03:39:04 +01:00
< h2 class = "text-center my-3" > {{ ref.display_name }} vs. {{ target.display_name }}< / h2 >
2018-01-30 22:20:23 +01:00
< div id = "compareSummary" style = "height: 270px;" class = "col-sm-6 offset-sm-3 my-3" > < / div >
2017-12-19 17:03:51 +01:00
< div class = "row" >
2018-01-29 03:39:04 +01:00
< div class = "mx-auto" >
2018-05-21 23:59:34 +02:00
< div >
< button id = "filter_onlyDiffs" type = "button" class = "btn btn-primary btn-lg" href = "javascript:void(0)" onclick = "toggle(this)" > Show only diffs< / button >
< button id = "filter_onlyOfficials" type = "button" class = "btn btn-default btn-lg" href = "javascript:void(0)" onclick = "toggle(this)" > Show only officials< / button >
< / div >
2017-12-19 17:03:51 +01:00
< div >
2018-01-29 03:39:04 +01:00
< table class = "table table-responsive ci-app-table" >
2017-12-19 17:03:51 +01:00
< thead >
< tr >
2018-01-29 03:39:04 +01:00
< th class = "ci-app-row-title" > < / th >
2017-12-19 17:03:51 +01:00
< th class = "ci-app-test-title" > < div > {{ ref.display_name }} < / div > < / th >
< th class = "ci-app-test-title" > < div > {{ target.display_name }} < / div > < / th >
< th class = "ci-app-test-title" > < / th >
< / tr >
< / thead >
< tbody >
{% for result in results %}
2018-05-21 23:59:34 +02:00
< tr class = "ci-branch-comparison {% if result.app.list.name == " official " % } official { % endif % } " value = "{{ result.compare }}" app = "{{ result.app.name }}" >
2017-12-19 17:03:51 +01:00
< td class = "ci-app-row-title" >
{% if result.app.list.name == "official" %}
< span class = "official-star oi oi-star" title = "Official" aria-hidden = "true" > < / span >
{% endif %}
2017-12-19 19:20:27 +01:00
< a href = "{{ url_for('main.appci_app', app=result.app.name) }}" >
2017-12-19 17:03:51 +01:00
< span title = "App" >
< strong > {{ result.app.name }}< / strong > < / span >
< / a >
< / td >
< td class = "ci-app-level" value = "{{ result.level }}" > < div title = "Level" >
< strong >
{{ result.level if result.level >= 0 else "" }}
< / strong > < / div > < / td >
< td class = "ci-app-level" value = "{{ result.level_compare }}" > < div title = "Level" >
< strong >
{{ result.level_compare if result.level_compare >= 0 else "" }}
< / strong > < / div > < / td >
< td class = "compare" >
{% if result.level == -1 or result.level_compare == -1 %}
< span class = "oi oi-question-mark level-unknown" title = "Don't know" aria-hidden = "true" > < / span >
{% elif result.level > result.level_compare %}
< span class = "oi oi-chevron-bottom level-regression" title = "Regression" aria-hidden = "true" > < / span >
{% elif result.level < result.level_compare % }
< span class = "oi oi-chevron-top level-improvement" title = "Improvement" aria-hidden = "true" > < / span >
{% endif %}
< / td >
< / tr >
{% endfor %}
< / tbody >
< / table >
< / div >
< / div >
< / div >
2018-01-30 22:20:23 +01:00
< script src = "{{ url_for('static', filename='js/canvasjs.min.js') }}" > < / script >
< script >
window.onload = function () {
var chart = new CanvasJS.Chart("compareSummary", {
animationEnabled: false,
data: [{
type: "doughnut",
startAngle: -90,
//innerRadius: 60,
indexLabelFontSize: 17,
indexLabel: "{label} - #percent%",
toolTipContent: "< b > {label}:< / b > {y} (#percent%)",
dataPoints: [
{ y: $(".ci-branch-comparison[value=unknown]").length, label: "Unknown", color:"#cccccc" },
2018-01-30 22:47:16 +01:00
{ y: $(".ci-branch-comparison[value=broken]").length, label:"Broken", color: "#d9534f" },
{ y: $(".ci-branch-comparison[value=regression]").length, label: "Regressions", color: "#f0ad4e" },
{ y: $(".ci-branch-comparison[value=same]").length, label: "Same", color: "#419fef" },
2018-01-30 22:20:23 +01:00
{ y: $(".ci-branch-comparison[value=improvement]").length, label: "Improvements", color: "#46bd32" }
]
}]
});
chart.render();
2018-05-21 23:59:34 +02:00
update_filters();
2018-01-30 22:20:23 +01:00
}
2018-05-21 23:59:34 +02:00
function toggle(e) {
$(e).toggleClass("btn-default");
$(e).toggleClass("btn-primary");
update_filters();
}
function update_filters() {
var onlyDiffs = $("#filter_onlyDiffs").hasClass("btn-primary");
var onlyOfficials = $("#filter_onlyOfficials").hasClass("btn-primary");
$(".ci-branch-comparison").show();
if (onlyDiffs) { $(".ci-branch-comparison[value='same']").hide(); }
if (onlyOfficials) { $(".ci-branch-comparison:not(.official)").hide(); }
}
2018-01-30 22:20:23 +01:00
< / script >
2017-12-19 17:03:51 +01:00
{% endblock %}