stash merge + card resto

This commit is contained in:
Thomas Cardon 2022-02-18 14:21:13 +01:00
parent 334f799c60
commit d7f423f93c
5 changed files with 126 additions and 25 deletions

View File

@ -41,7 +41,7 @@
<i class="fas fa-euro-sign ps-2 pe-2" style="color:#a8a8a8"></i>
<span class="prix" style="font-weight: bold;">5-10€</span>
<span class="prix" style="font-weight: bold;"></span>
<div class="d-inline-flex" *ngIf="restaurant.website; else noWebsite">
<p class="description pt-3 ps-2 pe-1"><i class="bi bi-globe2 ps-2 pe-2" style="color:#a8a8a8"></i>

View File

@ -13,6 +13,7 @@ export class CardRestoComponent implements OnInit {
@Input() likeResto: any;
@Output() clickLike = new EventEmitter<boolean>();
isLiked : boolean = false;
priceRef = ["Info indisponible"," € 1-10€ "," €€ 11-20€"," €€€ 21-30€"," €€€€ 31-40€"];
constructor(private apiBackService : ApiBackService) {
this.distance = 0 ;
@ -20,8 +21,6 @@ export class CardRestoComponent implements OnInit {
ngOnInit(): void {
console.log(this.restaurant);
this.distance = Math.round(
this.apiBackService.setDistance(
48.86201110271593 , //latitude Simplon
@ -30,9 +29,6 @@ export class CardRestoComponent implements OnInit {
this.restaurant.longitude)
);
console.log(this.distance);
}
onClickLike() {
console.log('click');

View File

@ -74,20 +74,117 @@
class="form-control"
id="floatingInputWebsite"
placeholder=""
name="website" >
name="website"
formControlName="websiteFc"
[ngClass]="{'is-valid' : signupForm.controls['websiteFc'].touched && signupForm.controls['websiteFc'].valid,
'is-invalid': signupForm.controls['websiteFc'].touched && !signupForm.controls['websiteFc'].valid}">
<label for="floatingInputWebsite">Site Web</label>
</div>
<div class="form-floating">
<input type="checkbox"
class="form-control"
id="floatingInputAEmporter"
placeholder=""
name="website" >
<label for="floatingInputAEmporter">A Emporter</label>
<div class="form-control">
<p class="text-left"> Sur Place :</p>
<div class="form-check form-check-inline">
<input
type="radio"
class="form-check-input"
id="checkboxSurPlaceTrue"
name="surPlaceFc"
value=true
formControlName="surPlaceFc">
<label class="form-check-label" for="checkboxSurPlaceTrue">Oui</label>
</div>
<div class="form-check form-check-inline">
<input
type="radio"
class="form-check-input"
id="checkboxSurPlaceFalse"
name="surPlaceFc"
value=false
formControlName="surPlaceFc">
<label class="form-check-label" for="checkboxSurPlaceFalse">Non</label>
</div>
<div class="form-check form-check-inline">
<input
type="radio"
class="form-check-input"
id="checkboxSurPlaceNull"
name="surPlaceFc"
value=null
formControlName="surPlaceFc">
<label class="form-check-label" for="checkboxSurPlaceNull">Pas d'infos</label>
</div>
</div>
<div *ngIf="errorMessage" class="alert alert-warning">
{{errorMessage}}
<div class="form-control">
<p class="text-left"> A Emporter :</p>
<div class="form-check form-check-inline">
<input
type="radio"
class="form-check-input"
id="checkboxAEmporterTrue"
name="aEmporterFc"
value=true
formControlName="aEmporterFc">
<label class="form-check-label" for="checkboxAEmporterTrue">Oui</label>
</div>
<div class="form-check form-check-inline">
<input
type="radio"
class="form-check-input"
id="checkboxAEmporterFalse"
name="aEmporterFc"
value=false
formControlName="aEmporterFc">
<label class="form-check-label" for="checkboxAEmporterFalse">Non</label>
</div>
<div class="form-check form-check-inline">
<input
type="radio"
class="form-check-input"
id="checkboxAEmporterNull"
name="aEmporterFc"
value=null
formControlName="aEmporterFc">
<label class="form-check-label" for="checkboxAEmporterNull">Pas d'infos</label>
</div>
</div>
<div class="form-control">
<p class="text-left"> Accès PMR :</p>
<div class="form-check form-check-inline">
<input
type="radio"
class="form-check-input"
id="checkboxAccesPMRTrue"
name="accesPMRFc"
value=true
formControlName="accesPMRFc">
<label class="form-check-label" for="checkboxAccesPMRTrue">Oui</label>
</div>
<div class="form-check form-check-inline">
<input
type="radio"
class="form-check-input"
id="checkboxAccesPMRFalse"
name="accesPMRFc"
value=false
formControlName="accesPMRFc">
<label class="form-check-label" for="checkboxAccesPMRFalse">Non</label>
</div>
<div class="form-check form-check-inline">
<input
type="radio"
class="form-check-input"
id="checkboxAccesPMRNull"
name="accesPMRFc"
value=null
formControlName="accesPMRFc">
<label class="form-check-label" for="checkboxAccesPMRNull">Pas d'infos</label>
</div>
</div>
<div *ngIf="errorMessage" class="alert alert-danger">
<p class="alert-link">{{errorMessage}}</p>
</div>
<button class="w-100 btn btn-lg btn-success"

View File

@ -6,7 +6,7 @@
.form-signup {
width: 100%;
max-width: 330px;
max-width: 350px;
padding: 15px;
margin: auto;
}
@ -30,3 +30,7 @@
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.text-left{
text-align: left;
}

View File

@ -28,7 +28,9 @@ export class AdminPageComponent implements OnInit {
adresseFc : new FormControl('', [Validators.required]),
telephoneFc : new FormControl(''),
websiteFc : new FormControl(''),
surPlaceFc : new FormControl(''),
aEmporterFc : new FormControl(''),
accesPMRFc : new FormControl('')
})
}
@ -42,9 +44,9 @@ export class AdminPageComponent implements OnInit {
const adresseFc = this.signupForm.value['adresseFc'];
const telephoneFc = this.signupForm.value['telephoneFc'];
const websiteFc = this.signupForm.value['websiteFc'];
const surPlaceFc = this.signupForm.value['surPlaceFc'];
const aEmporterFc = this.signupForm.value['aEmporterFc'];
// const accesPMRFc = this.signupForm.value['accesPMRFc'];
// const surPlaceFc = this.signupForm.value['surPlaceFc'];
const accesPMRFc = this.signupForm.value['accesPMRFc'];
const restaurant: Restaurant = {
latitude: latitudeFc,
@ -54,9 +56,9 @@ export class AdminPageComponent implements OnInit {
adresse : adresseFc,
telephone : telephoneFc,
website : websiteFc,
surPlace : surPlaceFc,
aEmporter : aEmporterFc,
// accesPMR : accesPMRFc,
// surPlace : surPlaceFc
accesPMR : accesPMRFc
}
if( restaurant.latitude !== '' &&
restaurant.longitude !== '' &&
@ -68,6 +70,8 @@ export class AdminPageComponent implements OnInit {
this.router.navigate(['restaurants'])
);
}else{
console.log("hello");
this.errorMessage = "Renseigner les champs obligatoires **";
}