Spaces:
Sleeping
Sleeping
Commit ·
8f5ca4d
1
Parent(s): cf13ec1
fix layout title (#16)
Browse files- update layout (fabd194f349355b857d9dfdeb508cb06f288667f)
- src/app.py +22 -25
src/app.py
CHANGED
|
@@ -779,6 +779,28 @@ with tab_single:
|
|
| 779 |
delta="kg CO2 eq / t produit",
|
| 780 |
)
|
| 781 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 782 |
# --- Forfait transport ---
|
| 783 |
transport_val, transport_zone = _get_transport_surcharge(
|
| 784 |
pays_production=result.pays_production,
|
|
@@ -815,32 +837,7 @@ with tab_single:
|
|
| 815 |
value=f"+{extrusion_val:.2f} kg CO2 eq / t",
|
| 816 |
)
|
| 817 |
|
| 818 |
-
# Impact total mis en avant
|
| 819 |
-
st.markdown("---")
|
| 820 |
-
st.metric(
|
| 821 |
-
label="🌍 IMPACT TOTAL",
|
| 822 |
-
value=f"{impact_total:.2f} kg CO2 eq / t",
|
| 823 |
-
help="Impact total incluant la matière première" + (", transport" if transport_val > 0 else "") + (" et extrusion" if extrusion_single else "")
|
| 824 |
-
)
|
| 825 |
|
| 826 |
-
st.markdown("---")
|
| 827 |
-
st.markdown("#### ℹ️ Informations")
|
| 828 |
-
info_data = {
|
| 829 |
-
"Source": result.source_db,
|
| 830 |
-
"Intrant utilisé": result.intrant_utilise,
|
| 831 |
-
"Match exact": '✅ Oui' if result.match_exact else '⚠️ Non',
|
| 832 |
-
"Classification": '🏭 Transformé' if result.classification == 'transforme' else '🌾 Brut',
|
| 833 |
-
}
|
| 834 |
-
if result.pays_production:
|
| 835 |
-
info_data["Pays production"] = result.pays_production
|
| 836 |
-
if result.pays_transformation:
|
| 837 |
-
info_data["Pays transformation"] = result.pays_transformation
|
| 838 |
-
|
| 839 |
-
for key, value in info_data.items():
|
| 840 |
-
st.markdown(f"**{key}:** {value}")
|
| 841 |
-
|
| 842 |
-
with st.expander("Détails techniques"):
|
| 843 |
-
st.markdown(f"**Node résultat :** `{result.node_resultat}`")
|
| 844 |
|
| 845 |
# ========================================================================
|
| 846 |
# RIGHT COLUMN: Produits candidats
|
|
|
|
| 779 |
delta="kg CO2 eq / t produit",
|
| 780 |
)
|
| 781 |
|
| 782 |
+
|
| 783 |
+
|
| 784 |
+
# Display Source and Intrant utilisé right next to Impact metric
|
| 785 |
+
st.markdown(f"<p style='font-size: 18px; margin-top: 8px; margin-bottom: 4px;'><strong>Source:</strong> {result.source_db}</p>", unsafe_allow_html=True)
|
| 786 |
+
st.markdown(f"<p style='font-size: 18px; margin-bottom: 12px;'><strong>Intrant utilisé:</strong> {result.intrant_utilise}</p>", unsafe_allow_html=True)
|
| 787 |
+
|
| 788 |
+
# Match exact and Classification
|
| 789 |
+
st.markdown(f"**Match exact:** {'✅ Oui' if result.match_exact else '⚠️ Non'}")
|
| 790 |
+
st.markdown(f"**Classification:** {'🏭 Transformé' if result.classification == 'transforme' else '🌾 Brut'}")
|
| 791 |
+
|
| 792 |
+
# Pays information if available
|
| 793 |
+
if result.pays_production:
|
| 794 |
+
st.markdown(f"**Pays production:** {result.pays_production}")
|
| 795 |
+
if result.pays_transformation:
|
| 796 |
+
st.markdown(f"**Pays transformation:** {result.pays_transformation}")
|
| 797 |
+
|
| 798 |
+
with st.expander("Détails techniques"):
|
| 799 |
+
st.markdown(f"**Node résultat :** `{result.node_resultat}`")
|
| 800 |
+
|
| 801 |
+
st.markdown("---")
|
| 802 |
+
|
| 803 |
+
|
| 804 |
# --- Forfait transport ---
|
| 805 |
transport_val, transport_zone = _get_transport_surcharge(
|
| 806 |
pays_production=result.pays_production,
|
|
|
|
| 837 |
value=f"+{extrusion_val:.2f} kg CO2 eq / t",
|
| 838 |
)
|
| 839 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 840 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 841 |
|
| 842 |
# ========================================================================
|
| 843 |
# RIGHT COLUMN: Produits candidats
|