ninegitea/templates/Scrum/link.html.twig

72 lines
2.0 KiB
Twig
Raw Permalink Normal View History

2024-04-15 13:25:09 +02:00
{% extends 'base.html.twig' %}
{% block body %}
<h1>{{scrum.name}}</h1>
<div class="form-group ">
<label class="control-label required" for="scrum_category">
Le ticket n°
<span class="mandatory">*</span>
</label>
<select id="issue" class="form-control">
<option value="" selected></option>
{% for issue in scrum.scrumissues %}
<option value="{{issue.id}}">#{{issue.giteanumber}} = {{issue.giteatitle}}</option>
{% endfor %}
</select>
</div>
<div class="form-group ">
<label class="control-label required" for="scrum_category">
bloque / débloque le ticket n°
<span class="mandatory">*</span>
</label>
<select id="block" class="form-control">
<option value="" selected></option>
{% for issue in scrum.scrumissues %}
<option value="{{issue.giteanumber}}">#{{issue.giteanumber}} = {{issue.giteatitle}}</option>
{% endfor %}
</select>
</div>
<button onClick="lock()" class="btn btn-success">Bloque</button>
<button onClick="unlock()" class="btn btn-success">Débloque</button>
{% endblock %}
{% block localjavascript %}
$(document).ready(function() {
$("#issue").select2();
$("#block").select2();
});
function lock() {
console.log($("#issue").val());
console.log($("#block").val());
$.ajax({
method: "POST",
url: "{{path("app_scrumissue_block")}}",
data: {
id:$("#issue").val(),
issueblocked:$("#block").val(),
},
success: function(data) {
}
});
}
function unlock() {
$.ajax({
method: "POST",
url: "{{path("app_scrumissue_unblock")}}",
data: {
id:$("#issue").val(),
},
success: function(data) {
}
});
}
{% endblock %}