Fix some stuff

This commit is contained in:
Maxime Boulay
2025-08-17 21:53:26 +01:00
parent b1f115d889
commit fd652ae936
8 changed files with 1090 additions and 1067 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
@@ -10,8 +10,8 @@
<ItemGroup>
<PackageReference Include="BCrypt.Net-Next" Version="4.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.1">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>

View File

@@ -1,6 +1,9 @@
{
"createNewPurchase" : "Create new purchase",
"createNewProduct" : "Create new product",
"startDate": "Start Date",
"endDate": "End Date",
"labelCost": "CO2 consumption from {start} to {end}",
"date": "Date",
"CO2Cost": "CO2 cost",
"WaterCost": "Water cost"

View File

@@ -1,6 +1,9 @@
{
"createNewPurchase" : "Créer une nouvelle liste d'achat",
"createNewProduct" : "Créer un nouveau produit",
"startDate": "Date de début",
"endDate": "Date de fin",
"labelCost": "Utilisation de CO2 sur la période du {start} au {end}",
"date": "Date",
"CO2Cost": "Coût en CO2",
"WaterCost": "Coût en eau"

View File

@@ -51,17 +51,20 @@ export const HomePurchase = () => {
else
return (
<>
<div className='mbottom-10'>
<div className='center'>
{t("labelCost").replace("{start}", new Intl.DateTimeFormat("fr-FR").format(startDate)).replace("{end}", new Intl.DateTimeFormat("fr-FR").format(endDate))}
</div>
<div className='mbottom-20'>
<ProgressBar now={CO2EmissionsPurcentage} label={`${CO2EmissionsPurcentage.toFixed(2)}%`} />
</div>
<div style={{display: "flex"}} className="form-group">
<DatePicker dateFormat="dd/MM/yyyy" selected={startDate} className="form-control" onChange={(date) => {setStartDate(date);}} />
<DatePicker dateFormat="dd/MM/yyyy" selected={endDate} className="form-control" onChange={(date) => {setEndDate(date);}} />
<label>{t("startDate")}</label><DatePicker dateFormat="dd/MM/yyyy" selected={startDate} className="form-control" onChange={(date) => {setStartDate(date);}} />
<label>{t("endDate")}</label><DatePicker dateFormat="dd/MM/yyyy" selected={endDate} className="form-control" onChange={(date) => {setEndDate(date);}} />
</div>
<div className='flex'>
<div className='form-group width-20'>{t("date")}</div>
<div className='form-group width-20'>{t("CO2Cost")}</div>
<div className='form-group width-20'>{t("WaterCost")}</div>
<div className='form-group width-30'>{t("date")}</div>
<div className='form-group width-30'>{t("CO2Cost")}</div>
<div className='form-group width-30'>{t("WaterCost")}</div>
</div>
{
purchasesUser.map((purchaseUser, index) => {

View File

@@ -6,12 +6,12 @@ export const LinePurchase = ({ purchaseUser, onChange }) => {
return (
<>
<div className='flex'>
<div className='form-group width-20 inline-flex'>
<div className='form-group width-30 inline-flex'>
<Link to={`/purchase/${purchaseUser.id}`}>{new Date(Date.parse(purchaseUser.datePurchase)).toLocaleString("fr-FR", {month: '2-digit',day: '2-digit',year: 'numeric'})}</Link>
</div>
<div className='form-group width-20 inline-flex'>{parseFloat(purchaseUser.cO2Cost).toFixed(2)}</div>
<div className='form-group width-20 inline-flex'>{parseFloat(purchaseUser.waterCost).toFixed(2)}</div>
<div>
<div className='form-group width-30 inline-flex'>{parseFloat(purchaseUser.cO2Cost).toFixed(2)}</div>
<div className='form-group width-30 inline-flex'>{parseFloat(purchaseUser.waterCost).toFixed(2)}</div>
<div className='form-group width-10 inline-flex'>
<a onClick={() => onChange(purchaseUser.id)} href="#/" className='btn btn-reverse btn-block'>
<FaTrash />
</a>

View File

@@ -149,6 +149,14 @@ h3 {
width: 40%;
}
.width-30 {
width: 30%;
}
.width-25 {
width: 25%;
}
.width-20 {
width: 20%;
}
@@ -161,6 +169,10 @@ h3 {
margin-top: 10px;
}
.mbottom-20 {
margin-bottom: 20px;
}
.mbottom-10 {
margin-bottom: 10px;
}

File diff suppressed because it is too large Load Diff