{% extends 'base.html.twig' %} {% block body %} {{ form_start(form) }}

{% if mode=="update" %} Modification SCRUM {% elseif mode=="submit" %} Création SCRUM {% endif %}

{{ form_widget(form.submit) }} Annuler {% if mode=="update" %} Supprimer {% endif %}

{% if app.session.flashbag.has('error') %}
Erreur
{% for flashMessage in app.session.flashbag.get('error') %} {{ flashMessage }}
{% endfor %}
{% endif %} {% if app.session.flashbag.has('notice') %}
Information
{% for flashMessage in app.session.flashbag.get('notice') %} {{ flashMessage }}
{% endfor %}
{% endif %}
Informations
{{ form_row(form.category) }} {{ form_row(form.name) }} {{ form_row(form.giteaid) }} {{ form_row(form.users) }}
{% if mode=="update" %}
Equipes
Colonnes
{% endif %}
{{ form_end(form) }} {% endblock %} {% block localjavascript %} $(document).ready(function() { $("#scrum_giteaid").select2(); $("#scrum_name").focus(); {% if mode=="update" %} loadscrumcolumns(); loadscrumteams(); {%endif%} }); {% if mode=="update" %} $("#addcolumn").click(function() { ModalLoad('mymodalcolumn','Ajouter une colonne','{{path('app_scrumcolumn_submit',{scrumid:scrum.id})}}'); }); $('#scrumcolumns').on('click', '.modcolumn', function(event) { url="{{path('app_scrumcolumn_update',{id:'xxx'})}}"; url=url.replace("xxx",$(this).data("id")); ModalLoad('mymodalcolumn','Modifier une colonne',url); }); $('#mymodalcolumn').on('hidden.bs.modal', function () { loadscrumcolumns(); }); function loadscrumcolumns() { $("#scrumcolumns").empty(); $.ajax({ method: "POST", url: "{{path("app_scrumcolumn_select",{scrumid:scrum.id})}}", success: function(datas, dataType) { jQuery.each(datas, function(i, wid) { html ='
  • '; html+='
    '; html+='
    '; html+='
    '; html+=wid.name; html+='
    '; html+='
    '; html+=''; html+='
  • '; $("#scrumcolumns").append(html); }); $( "#scrumcolumns" ).sortable({ axis: "y", handle: ".fa-arrows-alt-v", update: function( event, ui ) { lstordered=""; $( "#scrumcolumns li" ).each(function( index ) { if(index==0) lstordered=$(this).data("id"); else lstordered=lstordered+","+$(this).data("id"); }); $.ajax({ method: "POST", url: "{{path("app_scrumcolumn_order",{scrumid:scrum.id})}}", data: { lstordered:lstordered } }); } }); }, }); } $("#addteam").click(function() { ModalLoad('mymodalteam','Ajouter une colonne','{{path('app_scrumteam_submit',{scrumid:scrum.id})}}'); }); $('#scrumteams').on('click', '.modteam', function(event) { url="{{path('app_scrumteam_update',{id:'xxx'})}}"; url=url.replace("xxx",$(this).data("id")); ModalLoad('mymodalteam','Modifier une team',url); }); $('#mymodalteam').on('hidden.bs.modal', function () { loadscrumteams(); }); function loadscrumteams() { $("#scrumteams").empty(); $.ajax({ method: "POST", url: "{{path("app_scrumteam_select",{scrumid:scrum.id})}}", success: function(datas, dataType) { jQuery.each(datas, function(i, wid) { html ='
  • '; html+='
    '; html+='
    '; html+='
    '; html+=wid.name; html+='
    '; html+='
    '; html+=''; html+='
  • '; $("#scrumteams").append(html); }); $( "#scrumteams" ).sortable({ axis: "y", handle: ".fa-arrows-alt-v", update: function( event, ui ) { lstordered=""; $( "#scrumteams li" ).each(function( index ) { if(index==0) lstordered=$(this).data("id"); else lstordered=lstordered+","+$(this).data("id"); }); $.ajax({ method: "POST", url: "{{path("app_scrumteam_order",{scrumid:scrum.id})}}", data: { lstordered:lstordered } }); } }); }, }); } {% endif %} {% endblock %}