{% extends "base.html.twig" %} {% block localstyle %} #main { padding-left:0px; margin-bottom:0px; } #mycontent { display:none } .tag { border-radius: 5px; padding: 8px 8px; margin-bottom: 5px; display: inline-block; min-width: 35px; text-align: center; color: #ffffff !important; zoom: 80%; } .tag i { margin-right:5px; } .assignee { width:30px; margin: 5px 5px 0px 0px; } {% endblock %} {% block body %}
{% if id == 0 %}
{% endif %}
{% if id!=0 %} {% endif %}
{%if id==0 %}{%endif%} {% for gitearepo in gitearepos %} {% for giteaissue in gitearepo.issues %} {% set tosee=false %} {% if app.session.get('viewclosed')=="true" and giteaissue.state=="closed" %} {% set tosee=true %} {% endif %} {% if giteaissue.state!="closed" %} {% set tosee=true %} {% endif %} {% if not giteaissue.pull_request is null %} {% set tosee=false %} {% endif %} {% if tosee %} {% set dataticket = giteaissue.number %} {% set datarepo = gitearepo.id %} {% if giteaissue.milestone %} {% set datamilestone = giteaissue.milestone.id %} {%else%} {% set datamilestone = gitearepo.full_name %} {%endif%} {% set statut = "Backlog" %} {% set teams = "" %} {% set datateams = "" %} {% set prioritys = ''~giteaprioritys|last~'' %} {% set dataprioritys = ','~giteaprioritys|last %} {% set prioritys = ''~giteaprioritys|last~'' %} {% set dataprioritys = ','~giteaprioritys|last %} {% set labels = "" %} {% set datalabels = "" %} {% for label in giteaissue.labels %} {% if label.id in gitearepo.columns %} {% set statut= label.name %} {% elseif label.name in giteateams %} {% set teams=teams~''~label.name~'' %} {% set datateams=datateams~','~label.name %} {% elseif label.name in giteaprioritys %} {% set prioritys=''~label.name~'' %} {% set dataprioritys=','~label.name %} {% else %} {% set labels=labels~''~label.name~'' %} {% set datalabels=datalabels~','~label.name %} {% endif %} {% endfor %} {% set dataassignees="" %} {% for assignee in giteaissue.assignees %} {% set dataassignees=dataassignees~','~assignee.username %} {% endfor %} {%if id==0 %}{%endif%} {% set dataorder="" %} {% for assignee in giteaissue.assignees %} {% set dataorder=dataorder~assignee.username %} {% endfor %} {% endif %} {% endfor %} {% endfor %}
ProjetJalon Titre Equipe Priorité Poid Affecté à Statut Etiquettes
{{ gitearepo.full_name }}{% if giteaissue.milestone %}{{ giteaissue.milestone.title }} {%endif%} {{ giteaissue.number }} {% if giteaissue.state=="closed" %}CLOS LE = {{ giteaissue.closed_at|date("d/m/y") }}
{% endif %} {{ giteaissue.title }}
{{ teams|raw }} {{ prioritys|raw }} {% for assignee in giteaissue.assignees %} {% endfor %} {{ statut }} {{ labels|raw }}
{% endblock %} {% block localjavascript %} var table; 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:{{id}}, value: toshow } }); } function showhide() { textfilters=""; ticketfilter=$("#filterticket").val(); categoryfilters=$("#filtercategorys").val(); repofilters=$("#filterrepos").val(); milestonefilters=$("#filtermilestones").val(); columnfilters=$("#filtercolumns").val(); teamfilters=$("#filterteams").val(); priorityfilters=$("#filterprioritys").val(); labelfilters=$("#filterlabels").val(); assigneefilters=$("#filterassignees").val(); excludefilters=$("#filterexcludes").val(); $.fn.dataTable.ext.search.push(function(settings, data, dataIndex, rowObj, counter) { el=table.row(dataIndex).nodes().to$(); {% if id == 0 %} category = $(el).data('category'); repo = $(el).data('repo'); {% endif %} ticket= $(el).data('ticket'); milestone = $(el).data('milestone'); column = $(el).data('column'); teams = $(el).data('teams').split(','); prioritys = $(el).data('prioritys').split(','); labels = $(el).data('labels').split(','); assignees = $(el).data('assignees').split(','); toreturn=true; {% if id == 0 %} if(categoryfilters.length!==0 && jQuery.inArray(category.toString(), categoryfilters )<0) { toreturn=false; } if(categoryfilters.length!==0) { textfilters=textfilters+" CATEGORIES ="; $.each(categoryfilters, function( index, value ) { textfilters=textfilters+" "+value; }); } if(repofilters.length!==0 && jQuery.inArray(repo.toString(), repofilters )<0) { toreturn=false; } {% endif %} if(ticketfilter.length!==0 && ticket.toString()!=ticketfilter) { toreturn=false; } if(milestonefilters.length!==0 && jQuery.inArray(milestone.toString(), milestonefilters )<0) { toreturn=false; } if(columnfilters.length!==0 && jQuery.inArray(column.toString(), columnfilters )<0) { toreturn=false; } if(excludefilters.length!==0) { $.each(excludefilters, function( index, value ) { if(jQuery.inArray(value, labels )>0) { toreturn=false; } }); } if(toreturn&&(teamfilters.length!==0||priorityfilters.length!==0||labelfilters.length!==0||assigneefilters.length!==0)) { if(labelfilters.length!==0) { toreturn=false; $.each(labelfilters, function( index, value ) { if(jQuery.inArray(value, labels )>0) { toreturn=true; } }); } if(teamfilters.length!==0&&toreturn) { toreturn=false; $.each(teamfilters, function( index, value ) { if(jQuery.inArray(value, teams )>0) { toreturn=true; } }); } if(priorityfilters.length!==0&&toreturn) { toreturn=false; $.each(priorityfilters, function( index, value ) { if(jQuery.inArray(value, prioritys )>0) { toreturn=true; } }); } if(assigneefilters.length!==0&&toreturn) { toreturn=false; $.each(assigneefilters, function( index, value ) { if(jQuery.inArray(value, assignees )>0) { toreturn=true; } }); } } return toreturn; }); if(ticketfilter.length!==0) { textfilters=textfilters+"    TICKET ="+ticketfilter; } {% if id == 0 %} if(categoryfilters.length!==0) { data = $("#filtercategorys").select2('data'); textfilters=textfilters+"    CATEGORIES ="; $.each(categoryfilters, function( index, value ) { if(index>0)textfilters=textfilters+" &"; textfilters=textfilters+" "+data[index].text; }); } if(repofilters.length!==0) { data = $("#filterrepos").select2('data'); textfilters=textfilters+"    PROJETS ="; $.each(repofilters, function( index, value ) { if(index>0)textfilters=textfilters+" &"; textfilters=textfilters+" "+data[index].text; }); } {% endif %} if(milestonefilters.length!==0) { data = $("#filtermilestones").select2('data'); textfilters=textfilters+"    JALONS ="; $.each(milestonefilters, function( index, value ) { if(index>0)textfilters=textfilters+" &"; textfilters=textfilters+" "+data[index].text; }); } if(columnfilters.length!==0) { data = $("#filtercolumns").select2('data'); textfilters=textfilters+"    STATUS ="; $.each(columnfilters, function( index, value ) { if(index>0)textfilters=textfilters+" &"; textfilters=textfilters+" "+data[index].text; }); } if(teamfilters.length!==0) { data = $("#filterteams").select2('data'); textfilters=textfilters+"    EQUIPES ="; $.each(teamfilters, function( index, value ) { if(index>0)textfilters=textfilters+" &"; textfilters=textfilters+" "+data[index].text; }); } if(priorityfilters.length!==0) { data = $("#filterprioritys").select2('data'); textfilters=textfilters+"    EQUIPES ="; $.each(priorityfilters, function( index, value ) { if(index>0)textfilters=textfilters+" &"; textfilters=textfilters+" "+data[index].text; }); } if(labelfilters.length!==0) { data = $("#filterlabels").select2('data'); textfilters=textfilters+"    ETIQUETTES ="; $.each(labelfilters, function( index, value ) { if(index>0)textfilters=textfilters+" &"; textfilters=textfilters+" "+data[index].text; }); } if(assigneefilters.length!==0) { data = $("#filterassignees").select2('data'); textfilters=textfilters+"    AFFECTATIONS ="; $.each(assigneefilters, function( index, value ) { if(index>0)textfilters=textfilters+" &"; textfilters=textfilters+" "+data[index].text; }); } if(excludefilters.length!==0) { data = $("#filterexcludes").select2('data'); textfilters=textfilters+"    EXCLURE ETIQUETTES ="; $.each(excludefilters, function( index, value ) { if(index>0)textfilters=textfilters+" &"; textfilters=textfilters+" "+data[index].text; }); } $("#textfilters").html(textfilters); table.draw(); } {% if id == 0 %} function filtercategorys() { $.ajax({ method: "POST", url: "{{ path('app_user_preference') }}", data: { key:'filtercategorys', id:{{id}}, value: $("#filtercategorys").val() } }); showhide(); } function filterrepos() { $.ajax({ method: "POST", url: "{{ path('app_user_preference') }}", data: { key:'filterrepos', id:{{id}}, value: $("#filterrepos").val() } }); showhide(); } {% endif %} function filtermilestones() { $.ajax({ method: "POST", url: "{{ path('app_user_preference') }}", data: { key:'filtermilestones', id:{{id}}, value: $("#filtermilestones").val() } }); showhide(); } function filtercolumns() { $.ajax({ method: "POST", url: "{{ path('app_user_preference') }}", data: { key:'filtercolumns', id:{{id}}, value: $("#filtercolumns").val() } }); showhide(); } function filterteams() { $.ajax({ method: "POST", url: "{{ path('app_user_preference') }}", data: { key:'filterteams', id:{{id}}, value: $("#filterteams").val() } }); showhide(); } function filterprioritys() { $.ajax({ method: "POST", url: "{{ path('app_user_preference') }}", data: { key:'filterprioritys', id:{{id}}, value: $("#filterprioritys").val() } }); showhide(); } function filterlabels() { $.ajax({ method: "POST", url: "{{ path('app_user_preference') }}", data: { key:'filterlabels', id:{{id}}, value: $("#filterlabels").val() } }); showhide(); } function filterassignees() { $.ajax({ method: "POST", url: "{{ path('app_user_preference') }}", data: { key:'filterassignees', id:{{id}}, value: $("#filterassignees").val() } }); showhide(); } function filterexcludes() { $.ajax({ method: "POST", url: "{{ path('app_user_preference') }}", data: { key:'filterexcludes', id:{{id}}, value: $("#filterexcludes").val() } }); showhide(); } function refreshinfo() { $.ajax({ method: "POST", url: "{{path("app_scrum_info",{id:id})}}", success: function(data) { $(".totalweight").html("0"); Object.entries(data.weights).forEach(entry => { const [key, value] = entry; $("#total"+key).html(value); }); } }); } $(document).on('click','.modissu',function(){ $(".modal-title").html("#"+$(this).data("giteaid")+" - "+$(this).data("giteatitle")); $("#modal-issueid").val($(this).data("issue")); $.ajax({ method: "POST", url: "{{path("app_scrumissue_info")}}", data: { id:$("#modal-issueid").val(), }, success: function(data) { $("#modal-issueweight").val(data.weight); $("#mymodalissue").modal('show'); $("#modal-issueweight").focus(); }, }); }); $("#issu_update").click(function(){ $.ajax({ method: "POST", url: "{{path("app_scrumissue_update")}}", data: { id:$("#modal-issueid").val(), weight:$("#modal-issueweight").val(), }, success: function(data) { $("#issue"+$("#modal-issueid").val()+"-weight").html($("#modal-issueweight").val()); refreshinfo(); $("#mymodalissue").modal('hide'); }, error: function (request, status, error) { $("#mymodalissue").modal('hide'); } }); }); $(document).ready(function() { {% if id== 0 %} $('#filtercategorys').select2(); {% if filtercategorys %} {% for category in filtercategorys %} $("#filtercategorys").val($("#filtercategorys").val().concat("{{category}}")); {%endfor%} $('#filtercategorys').trigger('change'); {% endif %} $('#filtercategorys').on("select2:select", function(e) { filtercategorys(); }); $('#filtercategorys').on("select2:unselect", function(e) { filtercategorys(); }); $('#filterrepos').select2(); {% if filterrepos %} {% for repo in filterrepos %} $("#filterrepos").val($("#filterrepos").val().concat("{{repo}}")); {%endfor%} $('#filterrepos').trigger('change'); {% endif %} $('#filterrepos').on("select2:select", function(e) { filterrepos(); }); $('#filterrepos').on("select2:unselect", function(e) { filterrepos(); }); {% endif %} $("#filterticket").on("keyup", function() { 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(); }); $('#filtercolumns').select2(); {% if filtercolumns %} {% for column in filtercolumns %} $("#filtercolumns").val($("#filtercolumns").val().concat("{{column}}")); {%endfor%} $('#filtercolumns').trigger('change'); {% endif %} $('#filtercolumns').on("select2:select", function(e) { filtercolumns(); }); $('#filtercolumns').on("select2:unselect", function(e) { filtercolumns(); }); $('#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(); }); $('#filterprioritys').select2(); {% if filterprioritys %} {% for priority in filterprioritys %} $("#filterprioritys").val($("#filterprioritys").val().concat("{{priority}}")); {%endfor%} $('#filterprioritys').trigger('change'); {% endif %} $('#filterprioritys').on("select2:select", function(e) { filterprioritys(); }); $('#filterprioritys').on("select2:unselect", function(e) { filterprioritys(); }); $('#filterlabels').select2(); {% if filterlabels %} {% for label in filterlabels %} $("#filterlabels").val($("#filterlabels").val().concat("{{label}}")); {%endfor%} $('#filterlabels').trigger('change'); {% endif %} $('#filterlabels').on("select2:select", function(e) { filterlabels(); }); $('#filterlabels').on("select2:unselect", function(e) { filterlabels(); }); $('#filterassignees').select2(); {% if filterassignees %} {% for assignee in filterassignees %} $("#filterassignees").val($("#filterassignees").val().concat("{{assignee}}")); {%endfor%} $('#filterassignees').trigger('change'); {% endif %} $('#filterassignees').on("select2:select", function(e) { filterassignees(); }); $('#filterassignees').on("select2:unselect", function(e) { filterassignees(); }); $('#filterexcludes').select2(); {% if filterexcludes %} {% for label in filterexcludes %} $("#filterexcludes").val($("#filterexcludes").val().concat("{{label}}")); {%endfor%} $('#filterexcludes').trigger('change'); {% endif %} $('#filterexcludes').on("select2:select", function(e) { filterexcludes(); }); $('#filterexcludes').on("select2:unselect", function(e) { filterexcludes(); }); table = $('#dataTables').DataTable({ columnDefs: [ { "targets": "no-sort", "orderable": false }, { "targets": "no-string", "type" : "num" } ], responsive: true, iDisplayLength: 100, order: [[ 1, "asc" ]], }); {% if not showfilters %} $("#filters").addClass("d-none"); $("#filters").removeClass("d-flex"); {% endif %} showhide(); $("#mycontent").show(); }); {% endblock %}