{% extends "base.html.twig" %} {% block localstyle %} #main { padding-left:0px; margin-bottom:0px; } #mycontent { display:none; } .flot-chart { display: block; height: 450px; } .flot-chart-content { width: 400px; height: 250px; } .flot-chart-subcontent { height: 200px; width: 40%; } {% endblock %} {% block body %}

{{ scrum.name }}

{% for milestone in tbstat %}

{{milestone.name}}

{% for column in milestone.stat %}
{{ column.label }} = {{ column.total }}
{% for label in column.labels %}
  • {{label.label}} = {{label.total}}
  • {% endfor %}
    {%endfor%}
    {% endfor %}
    {% endblock %} {% block localjavascript %} function showFilters() { if($("#filters").hasClass("d-flex")) { toshow=0; $("#filters").addClass("d-none"); $("#filters").removeClass("d-flex"); } else { toshow=1; $("#filters").addClass("d-flex"); $("#filters").removeClass("d-none"); } $.ajax({ method: "POST", url: "{{ path('app_user_preference') }}", data: { key:'showfilters', id:{{scrum.id}}, value: toshow } }); } $(document).ready(function() { // Apply Filter function showhide() { if($("#filtermilestones").val().length !== 0) { $("[data-milestone]").hide(); $.each($("#filtermilestones").val(), function( index, value ) { $("[data-milestone="+value+"]").show(); }); } else $("[data-milestone]").show(); textfilters=""; if($("#filtermilestones").val().length!==0) { data = $("#filtermilestones").select2('data'); textfilters=textfilters+"    JALONS ="; $.each($("#filtermilestones").val(), function( index, value ) { if(index>0)textfilters=textfilters+" &"; textfilters=textfilters+" "+data[index].text; }); } if($("#filterteams").val().length!==0) { data = $("#filterteams").select2('data'); textfilters=textfilters+"    EQUIPES ="; $.each($("#filterteams").val(), function( index, value ) { if(index>0)textfilters=textfilters+" &"; textfilters=textfilters+" "+data[index].text; }); } $("#textfilters").html(textfilters); } // Filter Milestones function filtermilestones() { $.ajax({ method: "POST", url: "{{ path('app_user_preference') }}", data: { key:'filtermilestones', id:{{scrum.id}}, value: $("#filtermilestones").val() } }); showhide(); } $('#filtermilestones').select2(); {% if filtermilestones %} {% for milestone in filtermilestones %} $("#filtermilestones").val($("#filtermilestones").val().concat("{{milestone}}")); {%endfor%} $('#filtermilestones').trigger('change'); {% endif %} $('#filtermilestones').on("select2:select", function(e) { filtermilestones(); }); $('#filtermilestones').on("select2:unselect", function(e) { filtermilestones(); }); // Filter Teams function filterteams() { $.ajax({ method: "POST", url: "{{ path('app_user_preference') }}", data: { key:'filterteams', id:{{scrum.id}}, value: $("#filterteams").val() } }); location.reload(); } $('#filterteams').select2(); {% if filterteams %} {% for team in filterteams %} $("#filterteams").val($("#filterteams").val().concat("{{team}}")); {%endfor%} $('#filterteams').trigger('change'); {% endif %} $('#filterteams').on("select2:select", function(e) { filterteams(); }); $('#filterteams').on("select2:unselect", function(e) { filterteams(); }); {% for milestone in tbstat %} var data = [ {% for data in milestone.stat %} { label: "{{ data.label}}", data: {{ data.total }}, color: "{{ data.color }}", }, {% endfor %} ]; var plotObj = $.plot($("#floatdonut{{ milestone.id }}"), data, { series: { pie: { show: true, radius: 1, label: { show: true, radius: 1, threshold: 0.1, background: { opacity: 0.5, color: '#cdcdcd', }, formatter: function(label, series) { return '' + label + ''; } } } }, legend: { show: false, }, }); {% for data in milestone.stat %} {% for data in milestone.stat %} var data = [ {% for label in data.labels %} { label: "{{ label.label}}", data: {{ label.total }}, color: "{{ label.color }}", }, {% endfor %} ]; var plotObj = $.plot($("#floatsubdonut{{ milestone.id }}-{{ data.id }}"), data, { series: { pie: { show: true, label: { show: false, radius: 3/4, threshold: 0.1, background: { opacity: 0.5, color: '#cdcdcd', }, } } }, legend: { show: false, }, }); {% endfor %} {% endfor %} {% endfor %} {% if not showfilters %} $("#filters").addClass("d-none"); $("#filters").removeClass("d-flex"); {% endif %} // Appliy filters showhide(); $("#mycontent").show(); }); {% endblock %}