report_sprints.html 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. {% extends '_layout.html' %}
  2. {% block title %}
  3. Rapport: Sprints
  4. {% endblock %}
  5. {% block breadcrumb %}
  6. <li><a href="{% url 'index' %}">Accueil</a></li>
  7. <li><a href="{% url 'reports' %}">Rapports</a></li>
  8. <li><a>Les Sprints</a></li>
  9. {% endblock %}
  10. {% block main %}
  11. {% load martortags %}
  12. <section id="backlog">
  13. <header>
  14. <div class="flex-row">
  15. <h2 class="flex-extend">Les Sprints</h2>
  16. </div>
  17. </header>
  18. <canvas id="chart-velocity" width="400" height="120"></canvas>
  19. <ul class="sprints-list">
  20. {% for sprint in sprints %}
  21. <li class="sprint-li">
  22. <div class="flex-col">
  23. <div class="flex-row">
  24. <h4>Sprint #{{ sprint.id }} : {{ sprint.date_start|date:"d M. Y" }} au {{ sprint.date_end|date:"d M. Y" }}</h4>
  25. {% if sprint.running %}<span class="running" style="margin-left: 14px;">En cours</span>{% endif %}
  26. </div>
  27. <div class="flex-row flex-space-around" style="margin-bottom: 20px;">
  28. <b>Stories programmées: <a href="{% url 'story_index' %}?sprint={{ sprint.id }}">{{ sprint.nb_stories }}</a> </b>
  29. <b>Vélocité prévue: {{ sprint.planned_velocity }} </b>
  30. <b>Vélocité réelle: {{ sprint.real_velocity }} </b>
  31. </div>
  32. {% if sprint.retro %}
  33. <div style="padding: 0 20px;">
  34. {{ sprint.retro|safe_markdown }}
  35. </div>
  36. {% endif %}
  37. </div>
  38. </li>
  39. {% endfor %}
  40. </ul>
  41. </section>
  42. <script>
  43. var ctx = document.getElementById("chart-velocity").getContext('2d');
  44. var myChart = new Chart(ctx, {
  45. type: 'line',
  46. data: {
  47. labels: [{% for sprint in sprints|dictsort:"id" %}{% if not forloop.last %}"Sprint #{{ sprint.id }}",{% endif %}{% endfor %}],
  48. datasets: [{
  49. label: 'Vélocité réelle',
  50. data: [{% for sprint in sprints|dictsort:"id" %}{% if not forloop.last %}{{ sprint.real_velocity }},{% endif %}{% endfor %}],
  51. backgroundColor: [
  52. 'rgba(255, 255, 255, 0.2)'
  53. ],
  54. borderColor: [
  55. 'rgba(0,150,0,1)',
  56. ],
  57. borderWidth: 1
  58. },
  59. {
  60. label: 'Vélocité prévue',
  61. data: [{% for sprint in sprints|dictsort:"id" %}{% if not forloop.last %}{{ sprint.planned_velocity }},{% endif %}{% endfor %}],
  62. backgroundColor: [
  63. 'rgba(255, 255, 255, 0.2)'
  64. ],
  65. borderColor: [
  66. 'rgba(0,0,150,1)',
  67. ],
  68. borderWidth: 1
  69. }]
  70. },
  71. options: {
  72. scales: {
  73. yAxes: [{
  74. ticks: {
  75. beginAtZero:true
  76. }
  77. }]
  78. }
  79. }
  80. });
  81. </script>
  82. {% endblock %}