Skip to content

Commit

Permalink
label rouge label
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin POCHAT committed Oct 3, 2021
1 parent 322cfb1 commit 7942bb3
Show file tree
Hide file tree
Showing 14 changed files with 149 additions and 40 deletions.
10 changes: 10 additions & 0 deletions core/src/main/java/com/localeat/core/domains/slaughter/Animal.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public class Animal {

private String identificationNumber;

private Boolean certifiedLabelRouge;

public Long getId() {
return id;
}
Expand Down Expand Up @@ -85,4 +87,12 @@ public Farm getFinalFarm() {
public void setFinalFarm(Farm finalFarm) {
this.finalFarm = finalFarm;
}

public Boolean isCertifiedLabelRouge() {
return certifiedLabelRouge;
}

public void setCertifiedLabelRouge(Boolean certifiedLabelRouge) {
this.certifiedLabelRouge = certifiedLabelRouge;
}
}
1 change: 1 addition & 0 deletions docker-compose-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ services:

database:
image: postgres:12.2-alpine
container_name: databasex
volumes:
- ${postgres_datafile_path}:/var/lib/postgresql/data/pgdata
environment:
Expand Down
2 changes: 1 addition & 1 deletion scripts/dev/run-database-dev.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
docker-compose -f docker-compose-run.yml run --service-ports database
docker-compose -f docker-compose-run.yml run --name database --service-ports database
1 change: 1 addition & 0 deletions scripts/dev/run-sql-client-dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker exec -ti database psql -U localeat
1 change: 1 addition & 0 deletions ui/src/app/commons/models/animal.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ export class Animal {
identificationNumber: string;
breed: AnimalBreed;
animalType: AnimalType;
certifiedLabelRouge: boolean
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,18 @@
border-color: darkolivegreen;
}

.delivery-card__content,
.delivery-card__batch-list {
.delivery-card__title {
font-family: acme;
font-size: 1.8rem;
}

.delivery-card__general-information {
display: flex;
flex-flow: wrap;
justify-content: space-between;
}

.delivery-card__product-batch-list {
display: flex;
flex-flow: wrap;
justify-content: left;
Expand All @@ -18,14 +28,16 @@
.delivery-card__animal,
.delivery-card__animal-id,
.delivery-card__farm,
.delivery-card__quantity-sold {
.delivery-card__quantity-sold,
.delivery-card__certification-logo {
display: grid;
grid-template-columns: 2rem 1fr;
padding: 0.3rem;
}

.delivery-card__quantity-sold {
position: absolute;
font-size: 1.2rem;
}

.delivery-card__quantity-sold > div {
Expand All @@ -47,6 +59,11 @@
font-size: small;
}

.certified-label-rouge-icon {
width: 4rem;
height: 4rem;
}

@media (min-width:600px) {
.delivery-card__quantity-sold app-piechart {
width: 5rem;
Expand All @@ -58,7 +75,7 @@
right: 2rem;
}

.delivery-card__content {
.delivery-card__general-information {
padding-right: 5rem;
}
}
Expand All @@ -72,9 +89,11 @@
.delivery-card__quantity-sold {
top: 0.5rem;
right: 1rem;
font-size: 0.8rem;
}

.delivery-card__title {
padding-right: 3rem;
font-size: 1rem;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,44 +20,51 @@
</mat-card-title>
</mat-card-header>
<mat-card-content>
<div class="delivery-card__content">
<div class="delivery-card__address">
<i class="icon placeholder-icon"></i>
<span>
Adresse de livraison :<br>
{{delivery.deliveryAddress.name}}<br>
{{delivery.deliveryAddress.addressLine1}}<br>
{{delivery.deliveryAddress.zipCode}}<br>
{{delivery.deliveryAddress.city}}
</span>
</div>
<div class="delivery-card__date">
<i class="icon time-icon"></i>
<span>
Livré entre {{delivery.deliveryStart | date: 'shortTime'}}
et {{delivery.deliveryEnd | date: 'shortTime'}}
</span>
</div>
<div *ngIf="getAnimalLabel()" class="delivery-card__animal">
<i class="icon cow-icon"></i>
<span>
{{getAnimalLabel()}}
</span>
</div>
<div *ngIf="animal?.identificationNumber" class="delivery-card__animal-id">
<i class="icon label-icon"></i>
<span>
{{animal.identificationNumber}}
</span>
<div class="delivery-card__general-information">
<div class="delivery-card__delivery-information">
<div class="delivery-card__address">
<i class="icon placeholder-icon"></i>
<span>
Adresse de livraison :<br>
{{delivery.deliveryAddress.name}}<br>
{{delivery.deliveryAddress.addressLine1}}<br>
{{delivery.deliveryAddress.zipCode}}<br>
{{delivery.deliveryAddress.city}}
</span>
</div>
<div class="delivery-card__date">
<i class="icon time-icon"></i>
<span>
Livré entre {{delivery.deliveryStart | date: 'shortTime'}}
et {{delivery.deliveryEnd | date: 'shortTime'}}
</span>
</div>
</div>
<div *ngIf="animal?.finalFarm" class="delivery-card__farm">
<i class="icon farm-icon"></i>
<span>
{{animal.finalFarm.name}}
</span>
<div class="delivery-card__animal-information">
<div *ngIf="isCertifiedLabelRouge()" class="delivery-card__certification-logo">
<i class="icon certified-label-rouge-icon"></i>
</div>
<div *ngIf="getAnimalLabel()" class="delivery-card__animal">
<i class="icon cow-icon"></i>
<span>
{{getAnimalLabel()}}
</span>
</div>
<div *ngIf="animal?.identificationNumber" class="delivery-card__animal-id">
<i class="icon label-icon"></i>
<span>
{{animal.identificationNumber}}
</span>
</div>
<div *ngIf="animal?.finalFarm" class="delivery-card__farm">
<i class="icon farm-icon"></i>
<span>
{{animal.finalFarm.name}}
</span>
</div>
</div>
</div>
<div class="delivery-card__batch-list">
<div class="delivery-card__product-batch-list">
<app-product *ngFor="let batch of delivery.availableBatches" [product]="batch.product">
</app-product>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ export class DeliveryComponent implements OnInit {
return this.animalService.getAnimalDescription(this.animal);
}

isCertifiedLabelRouge(): boolean {
return this.animal?.certifiedLabelRouge;
}

showFarmSlideshow() {
this.showSlideshowEvent.emit(this.animal.finalFarm);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
font-size: large;
grid-column: 1 / -1;
padding: 0.2rem;
font-weight: 500;
}

.product__description {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,13 @@
font-family: Acme;
font-size: 1.5rem;
}

@media (max-width:600px) {
.slideshow__title {
font-size: 1rem;
}

.slideshow {
width: 100%;
}
}
Binary file added ui/src/assets/images/icons/png/bio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions ui/src/assets/images/icons/svg/agriculture_biologique.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 7942bb3

Please sign in to comment.