Bläddra i källkod

corrections diverses

omassot 7 år sedan
förälder
incheckning
58bc1c5b1b

+ 8 - 0
main/static/css/custom.css

@@ -415,3 +415,11 @@ select[multiple] option {
 .sprint-li {
 	padding: 25px !important;
 }
+
+/* Sprint cloture */
+
+.already-checked {
+	color: green !important; 
+	background: none !important;
+	pointer-events: none;
+}

+ 1 - 1
main/static/css/templated.css

@@ -2518,7 +2518,7 @@
 		button.special,
 		.button.special {
 			background-color: #25a2c3;
-			color: #ffffff !important;
+			color: #ffffff;
 		}
 
 			input[type="submit"].special:hover,

+ 1 - 1
main/templates/index.html

@@ -39,7 +39,7 @@
 					<b>{{ epic.name }}</b>
 				</td>
 				<td>{{ epic.size }}</td>
-				<td>{{ epic.contributors }}</td>
+				<td>{% for contrib in epic.contributors %}{{ contrib.username }}{% if not forloop.last %}, {% endif %}{% endfor %}</td>
 				<td>{{ epic.nb_stories }}</td>
 			</tr>
 			{% endfor %}

+ 1 - 0
main/templates/reports/report_index.html

@@ -18,6 +18,7 @@
 	<ul>
 		<li><a href="{% url 'report_sprints' %}">Historique des sprints</a></li>
 		<li><a href="{% url 'report_projects' %}">Revue de projets</a></li>
+		<li><a href="{% url 'report_activity' %}">Activité</a></li>
 	</ul>
 
 

+ 2 - 43
main/templates/reports/report_projects.html

@@ -19,8 +19,6 @@
 			<h2 class="flex-extend">Revue de Projets</h2>
 		</div>
 	</header>
-
-	<canvas id="chart-activity" width="400" height="120"></canvas>
 	
 	<ul class="alt">
 	{% for epic in epics %}
@@ -32,7 +30,7 @@
 				</div>
 				
 				<div style="margin-bottom: 20px;">
-					<div>Contributeurs: {{ epic.contributors }}</div>
+					<div>Contributeurs: {% for contrib in epic.contributors %}{{ contrib.first_name }} {{ contrib.last_name }}{% if not forloop.last %}, {% endif %}{% endfor %}</div>
 					<div>Stories (Total / En cours / Terminées): 
 					{{ epic.nb_stories }} / 
 					<span class="valid">{{ epic.nb_active_stories }}</span> / 
@@ -52,45 +50,6 @@
 	
 </section>
 
-<script>
-var ctx = document.getElementById("chart-activity").getContext('2d');
-var myChart = new Chart(ctx, {
-	type: 'line',
-    data: {
-        labels: [{% for epic in epics|dictsort:"id" %}{% if not forloop.last %}"Sprint #{{ sprint.id }}",{% endif %}{% endfor %}],
-        datasets: [{
-            label: 'Vélocité réelle',
-            data: [{% for sprint in sprints|dictsort:"id" %}{% if not forloop.last %}{{ sprint.real_velocity }},{% endif %}{% endfor %}],
-            backgroundColor: [
-            	'rgba(255, 255, 255, 0.2)'
-            ],
-            borderColor: [
-                'rgba(0,150,0,1)',
-            ],
-            borderWidth: 1
-        },
-        {
-            label: 'Vélocité prévue',
-            data: [{% for sprint in sprints|dictsort:"id" %}{% if not forloop.last %}{{ sprint.planned_velocity }},{% endif %}{% endfor %}],
-            backgroundColor: [
-                'rgba(255, 255, 255, 0.2)'
-            ],
-            borderColor: [
-            	'rgba(0,0,150,1)',
-            ],
-            borderWidth: 1
-        }]
-    },
-    options: {
-        scales: {
-            yAxes: [{
-                ticks: {
-                    beginAtZero:true
-                }
-            }]
-        }
-    }
-});
-</script>
+
 
 {% endblock %}

+ 54 - 11
main/templates/sprint_end.html

@@ -1,13 +1,13 @@
 {% extends '_layout.html' %}
 
 {% block title %}
-	Clotûre de sprint
+	Clotûre de {{ sprint }}
 {% endblock %}
 
 
 {% block breadcrumb %}
 	<li><a href="{% url 'index' %}">Accueil</a></li>
-	<li><a>Clotûre de sprint</a></li>
+	<li><a>Clotûre du {{ sprint }}</a></li>
 {% endblock %}
 
 {% block main %}
@@ -19,35 +19,43 @@
 		</div>
 	</header>
 	
-	<h5>Clore les stories</h5>
+	<h4>Clore les stories</h4>
 	<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>
+				<a href="" class="story_close button special icon fa-check tool-btn already-checked"></a>
 				{% else %}
-				<a href="" class="story_close button special icon fa-check tool-btn"></a>
+				<a href="" class="story_close button special icon fa-check tool-btn" title="Clôre"></a>
 				{% endif %}
 			</td>
-			<td>{{ story.name }}</td>
+			<td class="btn-cell-2">
+				{% if story.closed %}
+				<a class="button special icon fa-mail-forward tool-btn disabled"></a>
+				{% else %}
+				<a href="" class="story_reaffect button special icon fa-mail-forward tool-btn" title="Ré-affecter à {{ next_sprint }}"></a>
+				{% endif %}
+			</td>
+			
+			<td><a href="{% url 'story_details' story_id=story.id %}">{{ story.name }}</a></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">
+	<h4>Rétrospective</h4>
+	<form id="retro-section" 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">
+    		<input type="submit" value="Enregistrer et clôre le sprint">
     	</div>
 	</form>
 	
-	
 	<script>
 		function csrfSafeMethod(method) {
 		    // these HTTP methods do not require CSRF protection
@@ -87,7 +95,8 @@
                     }
                 },
                 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>');
+                	story_tr.find('.btn-cell').html('<a class="button special icon fa-check tool-btn already-checked"></a>');
+                	story_tr.find('.btn-cell-2').html('<a class="button special icon fa-mail-forward tool-btn disabled"></a>');
                 },
                 failure: function (response) {
                     alert(response.responseText);
@@ -96,7 +105,41 @@
                     alert(response.responseText);
                 }
             });
+		});
+	
+		$(".story_reaffect").click(function(event) {
+			event.preventDefault();
+			var story_tr = $(this).closest('tr');
+			var story_id = story_tr.data('id');
 			
+            $.ajax({
+                type: "POST",
+                url: "/stories/axreaffect/" + 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 disabled"></a>');
+                	story_tr.find('.btn-cell-2').html('<a class="button special icon fa-mail-forward tool-btn already-checked"></a>');
+                },
+                failure: function (response) {
+                    alert(response.responseText);
+                },
+                error: function (response) {
+                    alert(response.responseText);
+                }
+            });
+		});
+
+		$(".retro-section input").click(function (event) {
+			if (confirm('Le sprint courant va être marqué comme terminé, continuer?')) {
+				return true;
+			}
 		});
 		
 	</script>