Skip to content

Commit

Permalink
Add missing data to urban zone detail
Browse files Browse the repository at this point in the history
  • Loading branch information
smdsgn committed Jun 26, 2024
1 parent 3572c7c commit 4a65a65
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
</div>
<div class="fr-collapse" id="target-data-couv">
<h6 class="fr-mt-2w">Source</h6>
<p class="fr-text--sm">Données d'OCcupation des Sols à Grande Echelle (OCS GE) de l'IGN, sur la période d'analyse (millésime min : {{ project.first_year_ocsge }}, millésime max : {{ project.last_year_ocsge }}).</p>
<p class="fr-text--sm">Données d'OCcupation des Sols à Grande Echelle (OCS GE) de l'IGN, sur la période d'analyse (millésime min : {{ first_millesime }}, millésime max : {{ last_millesime }}).</p>

<h6 class="fr-mt-2w">Calcul</h6>
<p class="fr-text--sm">OCS GE traduite grâce à la matrice de passage.</p>
Expand Down Expand Up @@ -121,7 +121,7 @@ <h6 class="fr-mt-2w">Données</h6>
<td class="text-end text-muted">100%</td>
<td class="text-end">{{ detail_total_renat|floatformat:1 }}</td>
<td class="text-end text-muted">100%</td>
<td class="text-end">{{ artif_area|floatformat:1 }}</td>
<td class="text-end">{{ detail_total_artif_period|floatformat:1 }}</td>
</tr>
</tbody>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
</div>
<div class="fr-collapse" id="target-data-usage">
<h6 class="fr-mt-2w">Source</h6>
<p class="fr-text--sm">Données d'OCcupation des Sols à Grande Echelle (OCS GE) de l'IGN, sur la période d'analyse (millésime min : {{ project.first_year_ocsge }}, millésime max : {{ project.last_year_ocsge }}).</p>
<p class="fr-text--sm">Données d'OCcupation des Sols à Grande Echelle (OCS GE) de l'IGN, sur la période d'analyse (millésime min : {{ first_millesime }}, millésime max : {{ last_millesime }}).</p>

<h6 class="fr-mt-2w">Calcul</h6>
<p class="fr-text--sm">OCS GE traduite grâce à la matrice de passage.</p>
Expand Down Expand Up @@ -119,7 +119,7 @@ <h6 class="fr-mt-2w">Données</h6>
<td class="text-end text-muted">100%</td>
<td class="text-end">{{ detail_total_renat|floatformat:1 }}</td>
<td class="text-end text-muted">100%</td>
<td class="text-end">{{ artif_area|floatformat:1 }}</td>
<td class="text-end">{{ detail_total_artif_period|floatformat:1 }}</td>
</tr>
</tbody>
</table>
Expand Down
6 changes: 6 additions & 0 deletions project/views/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -672,11 +672,14 @@ def get_context_data(self, **kwargs: Any) -> Dict[str, Any]:
detail_couv_artif_table[i]["last_millesime"] = row["surface"]
break
kwargs |= {
"first_millesime": str(self.diagnostic.first_year_ocsge),
"last_millesime": str(self.diagnostic.last_year_ocsge),
"couv_artif_sol": couv_artif_sol,
"detail_couv_artif_chart": detail_couv_artif_chart,
"detail_couv_artif_table": detail_couv_artif_table,
"detail_total_artif": sum(_["artif"] for _ in detail_couv_artif_chart.get_series()),
"detail_total_renat": sum(_["renat"] for _ in detail_couv_artif_chart.get_series()),
"detail_total_artif_period": sum(_["last_millesime"] for _ in detail_couv_artif_table),
}
return super().get_context_data(**kwargs)

Expand Down Expand Up @@ -752,11 +755,14 @@ def get_context_data(self, **kwargs: Any) -> Dict[str, Any]:
detail_usage_artif_table[i]["last_millesime"] = row["surface"]
break
kwargs |= {
"first_millesime": str(self.diagnostic.first_year_ocsge),
"last_millesime": str(self.diagnostic.last_year_ocsge),
"usage_artif_sol": usage_artif_sol,
"detail_usage_artif_chart": detail_usage_artif_chart,
"detail_usage_artif_table": detail_usage_artif_table,
"detail_total_artif": sum(_["artif"] for _ in detail_usage_artif_chart.get_series()),
"detail_total_renat": sum(_["renat"] for _ in detail_usage_artif_chart.get_series()),
"detail_total_artif_period": sum(_["last_millesime"] for _ in detail_usage_artif_table),
}
return super().get_context_data(**kwargs)

Expand Down

0 comments on commit 4a65a65

Please sign in to comment.