|
|
@@ -0,0 +1,105 @@
|
|
|
+{% extends '_layout.html' %}
|
|
|
+
|
|
|
+{% block title %}
|
|
|
+ Clotûre de sprint
|
|
|
+{% endblock %}
|
|
|
+
|
|
|
+
|
|
|
+{% block breadcrumb %}
|
|
|
+ <li><a href="{% url 'index' %}">Accueil</a></li>
|
|
|
+ <li><a>Clotûre de sprint</a></li>
|
|
|
+{% endblock %}
|
|
|
+
|
|
|
+{% block main %}
|
|
|
+ <header>
|
|
|
+ <div class="flex-row">
|
|
|
+ <h2 class="flex-extend">Clotûre du {{ sprint }}</h2>
|
|
|
+ <span>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </header>
|
|
|
+
|
|
|
+ <h5>Clore les stories</h5>
|
|
|
+ <table>
|
|
|
+ {% for story in sprint.stories.all|dictsort:"id" %}
|
|
|
+ <tr data-id="{{ story.id }}">
|
|
|
+ <td class="btn-cell">
|
|
|
+ {% if story.closed %}
|
|
|
+ <a class="button special icon fa-check tool-btn" style="color: green !important; background: none !important;"></a>
|
|
|
+ {% else %}
|
|
|
+ <a href="" class="story_close button special icon fa-check tool-btn"></a>
|
|
|
+ {% endif %}
|
|
|
+ </td>
|
|
|
+ <td>{{ story.name }}</td>
|
|
|
+ <td width="1%">{% if story.weight %}<span>{% include 'weight_svg.html' with weight=story.weight h=20 %}</span>{% endif %}</td>
|
|
|
+ </tr>
|
|
|
+ {% endfor %}
|
|
|
+ </table>
|
|
|
+
|
|
|
+ <h5>Rétrospective</h5>
|
|
|
+ <form action="." method="post" enctype="multipart/form-data">
|
|
|
+ {% csrf_token %}
|
|
|
+
|
|
|
+ {{ form.retro }}
|
|
|
+
|
|
|
+ <div class="flex-row flex-end" style="margin-top: 10px;">
|
|
|
+ <input type="submit" value="Enregistrer">
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+
|
|
|
+ <script>
|
|
|
+ function csrfSafeMethod(method) {
|
|
|
+ // these HTTP methods do not require CSRF protection
|
|
|
+ return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));
|
|
|
+ }
|
|
|
+ function getCookie(name) {
|
|
|
+ var cookieValue = null;
|
|
|
+ if (document.cookie && document.cookie !== '') {
|
|
|
+ var cookies = document.cookie.split(';');
|
|
|
+ for (var i = 0; i < cookies.length; i++) {
|
|
|
+ var cookie = jQuery.trim(cookies[i]);
|
|
|
+ // Does this cookie string begin with the name we want?
|
|
|
+ if (cookie.substring(0, name.length + 1) === (name + '=')) {
|
|
|
+ cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return cookieValue;
|
|
|
+ }
|
|
|
+ var csrftoken = getCookie('csrftoken');
|
|
|
+
|
|
|
+ $(".story_close").click(function(event) {
|
|
|
+ event.preventDefault();
|
|
|
+ var story_tr = $(this).closest('tr');
|
|
|
+ var story_id = story_tr.data('id');
|
|
|
+
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ url: "/stories/axclose/" + story_id + "/",
|
|
|
+ data: '{story_id:' + story_id + '}',
|
|
|
+ contentType: "application/json; charset=utf-8",
|
|
|
+ dataType: "json",
|
|
|
+ beforeSend: function(xhr, settings) {
|
|
|
+ if (!csrfSafeMethod(settings.type) && !this.crossDomain) {
|
|
|
+ xhr.setRequestHeader("X-CSRFToken", csrftoken);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ success: function (response) {
|
|
|
+ story_tr.find('.btn-cell').html('<a class="button special icon fa-check tool-btn" style="color: green !important; background: none !important;"></a>');
|
|
|
+ },
|
|
|
+ failure: function (response) {
|
|
|
+ alert(response.responseText);
|
|
|
+ },
|
|
|
+ error: function (response) {
|
|
|
+ alert(response.responseText);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+ </script>
|
|
|
+
|
|
|
+
|
|
|
+{% endblock %}
|