MyHomeCollection/resources/views/homes/update.blade.php

131 lines
8.4 KiB
PHP
Raw Normal View History

@extends('layouts.app')
@section('content')
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">{{ $home->title }}</div>
<div class="card-body">
@if (session('status'))
<div class="alert alert-success" role="alert">
{{ session('status') }}
</div>
@endif
<form method="post">
@csrf
<div class="row">
<div class="form-group mx-sm-3 mb-2">
<label for="url" class="sr-only">URL</label>
<input type="text" name="url" class="form-control" id="url" placeholder="URL" value="{{ $home->url }}">
</div>
</div>
<div class="form-group">
<label for="title">Titre</label>
<input type="text" class="form-control" name="title" id="title" value="{{ $home->title }}" readonly>
</div>
<div class="form-group">
<label for="lat">Latitude</label>
<input type="text" name="map[lat]" id="lat" value="{{ $home->map['lat'] }}">
<label for="lng">Longitude</label>
<input type="text" name="map[lng]" id="lng" value="{{ $home->map['lng'] }}">
</div>
<div class="form-group">
<label for="description">Description</label>
<textarea class="form-control" name="description" id="description" rows="6">{{ $home->description }}</textarea>
</div>
<div class="form-group">
<label for="comment">Mon commentaire</label>
<textarea class="form-control" name="comment" id="comment" rows="3">{{ $home->comment }}</textarea>
</div>
<div class="form-group" id="photo-wrapper"></div>
<div class="row">
<div class="col-lg-4">
<div class="form-group">
<label for="city">Ville</label>
<input type="text" class="form-control" name="city" id="city" value="{{ $home->city }}">
</div>
</div>
<div class="col-lg-4">
<div class="form-group">
<label for="price">Prix</label>
<input type="number" class="form-control" name="price" id="price" value="{{ $home->price }}">
</div>
</div>
<div class="col-lg-4">
<div class="form-group">
<label for="surface">Surface</label>
<input type="number" class="form-control" id="surface" name="surface" value="{{ $home->surface }}">
</div>
</div>
<div class="col-lg-4">
<div class="form-group">
<label for="garden_surface">Surface de jardin</label>
<input type="number" class="form-control" id="garden_surface" name="garden_surface" value="{{ $home->garden_surface }}">
</div>
</div>
<div class="col-lg-4">
<div class="form-group">
<label for="rooms">Nombre de pièces</label>
<input type="number" class="form-control" id="rooms" name="rooms" value="{{ $home->rooms }}">
</div>
</div>
<div class="col-lg-4">
<div class="form-group">
<label for="energy">Énergie</label>
<select class="form-control" id="energy" name="energy">
<option @if($home->energy === "A") selected @endif>A</option>
<option @if($home->energy === "B") selected @endif>B</option>
<option @if($home->energy === "C") selected @endif>C</option>
<option @if($home->energy === "D") selected @endif>D</option>
<option @if($home->energy === "E") selected @endif>E</option>
<option @if($home->energy === "F") selected @endif>F</option>
<option @if($home->energy === "G") selected @endif>G</option>
</select>
</div>
</div>
<div class="col-lg-4">
<div class="form-group">
<label for="ges">GES</label>
<select class="form-control" id="ges" name="ges">
<option @if($home->ges === "A") selected @endif>A</option>
<option @if($home->ges === "B") selected @endif>B</option>
<option @if($home->ges === "C") selected @endif>C</option>
<option @if($home->ges === "D") selected @endif>D</option>
<option @if($home->ges === "E") selected @endif>E</option>
<option @if($home->ges === "F") selected @endif>F</option>
<option @if($home->ges === "G") selected @endif>G</option>
</select>
</div>
</div>
2020-07-24 13:11:21 +02:00
<div class="col-lg-4">
<fieldset class="form-group row">
<legend class="col-form-label col-sm-6 pt-0">URL publique</legend>
<div class="col-sm-3">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="slug" id="slug-non" value="" checked>
<label class="form-check-label" for="slug-non">Non</label>
</div>
</div>
<div class="col-sm-3">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="slug" id="slug-oui" value="{{ \Illuminate\Support\Str::uuid() }}">
<label class="form-check-label" for="slug-oui">Oui</label>
</div>
</div>
</fieldset>
2020-07-24 13:11:21 +02:00
</div>
<div class="col-lg-4">
<button type="submit" class="btn btn-primary">Enregistrer</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
@endsection