<div class="form-group {{ $errors->has('nom') ? 'has-error' : ''}}">
    <label for="nom" class="control-label">{{ 'Nom' }}</label>
    <input class="form-control" name="nom" type="text" id="nom" value="{{ isset($membrejury->nom) ? $membrejury->nom : ''}}" >
    {!! $errors->first('nom', '<p class="help-block">:message</p>') !!}
</div>
<div class="form-group {{ $errors->has('prenoms') ? 'has-error' : ''}}">
    <label for="prenoms" class="control-label">{{ 'Prenoms' }}</label>
    <input class="form-control" name="prenoms" type="text" id="prenoms" value="{{ isset($membrejury->prenoms) ? $membrejury->prenoms : ''}}" >
    {!! $errors->first('prenoms', '<p class="help-block">:message</p>') !!}
</div>
<div class="form-group {{ $errors->has('email') ? 'has-error' : ''}}">
    <label for="email" class="control-label">{{ 'Email' }}</label>
    <input class="form-control" name="email" type="email" id="email" value="{{ isset($membrejury->email) ? $membrejury->email : ''}}" >
    {!! $errors->first('email', '<p class="help-block">:message</p>') !!}
</div>
<div class="form-group {{ $errors->has('phone') ? 'has-error' : ''}}">
    <label for="phone" class="control-label">{{ 'Phone' }}</label>
    <input class="form-control" name="phone" type="text" id="phone" value="{{ isset($membrejury->phone) ? $membrejury->phone : ''}}" >
    {!! $errors->first('phone', '<p class="help-block">:message</p>') !!}
</div>
<div class="form-group {{ $errors->has('description') ? 'has-error' : ''}}">
    <label for="description" class="control-label">{{ 'Description' }}</label>
    <input class="form-control" name="description" type="text" id="description" value="{{ isset($membrejury->description) ? $membrejury->description : ''}}" >
    {!! $errors->first('description', '<p class="help-block">:message</p>') !!}
</div>
<div class="form-group {{ $errors->has('qualite') ? 'has-error' : ''}}">
    <label for="qualite" class="control-label">{{ 'Qualite' }}</label>
    <input class="form-control" name="qualite" type="text" id="qualite" value="{{ isset($membrejury->qualite) ? $membrejury->qualite : ''}}" >
    {!! $errors->first('qualite', '<p class="help-block">:message</p>') !!}
</div>
<div class="form-group {{ $errors->has('sexe') ? 'has-error' : ''}}">
    <label for="sexe" class="control-label">{{ 'Sexe' }}</label>
    <select name="sexe" class="form-control" id="sexe" >
        <option value="M" {{ (isset($membrejury->sexe) && $membrejury->sexe == "M") ? 'selected' : ''}}>M</option>
        <option value="F" {{ (isset($membrejury->sexe) && $membrejury->sexe == "F") ? 'selected' : ''}}>F</option>
    </select>
    {!! $errors->first('sexe', '<p class="help-block">:message</p>') !!}
</div>
<div class="form-group {{ $errors->has('id_grade') ? 'has-error' : ''}}" required="required">
    <label for="id_grade" class="control-label">{{ 'grade' }}</label>
    <select name="id_grade" class="form-control" id="id_grade"  required>
    @foreach ($grades as $grade)
        <option
            value="{{ $grade->idGrade }}"
            {{ (isset($membrejury->grade) && $membrejury->grade == $grade->idGrade) ? 'selected' : ''}}
        >
                {{ $grade->nomGrade }}
        </option>
    @endforeach
    </select>
    {!! $errors->first('id_grade', '<p class="help-block">:message</p>') !!}
</div>
<!--div class="form-group {{ $errors->has('type') ? 'has-error' : ''}}">
    <label for="type" class="control-label">{{ 'Type' }}</label>
    <select name="type" class="form-control" id="type" >
    @foreach (json_decode('{"interne":"interne","externe":"externe"}', true) as $optionKey => $optionValue)
        <option value="{{ $optionKey }}" {{ (isset($membrejury->type) && $membrejury->type == $optionKey) ? 'selected' : ''}}>{{ $optionValue }}</option>
    @endforeach
    </select>
    {!! $errors->first('type', '<p class="help-block">:message</p>') !!}
</div>
<div-- class="form-group {{ $errors->has('matricule') ? 'has-error' : ''}}">
    <label for="matricule" class="control-label">{{ 'Matricule' }}</label>
    <input class="form-control" name="matricule" type="number" id="matricule" value="{{ isset($membrejury->matricule) ? $membrejury->matricule : ''}}" >
    {!! $errors->first('matricule', '<p class="help-block">:message</p>') !!}
</div-->

<div class="form-group">
    <input class="btn btn-primary" type="submit" value="{{ $formMode === 'edit' ? 'Modifier' : 'Créer' }}">
</div>
