<div class="form-group row">
    <div class="col-md-6">
        {!! html()->label( 'Nom','name') !!}
        {!! html()->text('name', null)->attributes([($mode=="show"?'disabled':''), 'placeholder' => 'Nom','class' => 'form-control  text-uppercase']) !!}
    </div>
</div>

<div class="form-group row">
    <div class="col-md-6">
        {!! html()->label( 'Nom affiché','display_name') !!}
        {!! html()->text('display_name', null)->attributes([($mode=="show"?'disabled':''), 'placeholder' => 'Nom affiché','class' => 'form-control']) !!}
    </div>
</div>


<div class="row">
    <div class="col-md-5">
        <div class="form-group">
            {!! html()->label( 'Groupe','id_groupe') !!}
            {!! html()->select('id_groupe',null)
                ->options($liste_groupes)
                ->placeholder("A définir")
                ->attributes([($mode=="show"?'disabled':''),'class' => 'form-control selectpicker'])
            !!}
        </div>
    </div>


    @if($mode!="show")
        <div class="col-md-3">
            {!! html()->label( 'ou Nouveau Groupe','new_groupe') !!}
            {!! html()->text('new_groupe', null)->attributes(['placeholder' => 'Nom du groupe','class' => 'form-control text-uppercase']) !!}
        </div>
    @endif
</div>


<div class='row form-group'>
    @if($mode=="show")
        @if($permission->IsModifiable) <a class="btn btn-primary" href="{!! url('permissions/'.$permission->id.'/edit') !!}" id="btn_modifier">Modifier</a>@endif
    @else
        {!! html()->button('Enregistrer')->value('Enregistrer')->type('submit')->attributes(['class' => 'btn btn-primary']) !!}
    @endif

    @if(($mode=="show") && $permission->IsSupprimable)
        {{ html()->form('DELETE', url('/permissions/'. $permission->id))->open() }}
        &nbsp;<button class="btn btn-danger" onclick="if(!confirm('Voulez-vous vraiment supprimer cette permission ?')) return false;">Supprimer</button>
        {{ html()->form()->close() }}
    @endif
    &nbsp;<a class="btn btn-warning"  href="{!! url('permissions/') !!}">Retour</a>
</div>
