@extends('ui::layouts.app')

@section('content')

    <div class="ui menu top attached">
        <a href="{{ route('overide::roles.index') }}" class="item"><i class="icon angle left"></i></a>
        <h3 class="ui header item">@lang('overide::label.add_role')</h3>
    </div>

    <div class="ui segment very padded bottom attached">

        {!! Form::open()->post()->action(route('overide::roles.store')) !!}
        {!! Form::text('name', old('name'))->label(trans('overide::roles.name'))->required() !!}

        <table class="ui table">
            <thead>
            <tr>
                <th>
                    <div class="ui checkbox" data-toggle="checkall" data-selector=".checkbox[data-type='check-all-child']">
                        <input type="checkbox">
                        <label><strong>@lang('overide::label.permissions')</strong></label>
                    </div>
                </th>
            </tr>
            </thead>
            <tbody>
            @foreach($permissions as $permission)
                <tr>
                    <td>
                        <div class="ui checkbox" data-type="check-all-child">
                            <input type="checkbox" name="permissions[]" value="{{ $permission->id }}" {{ (false)?'checked=checked':'' }}>
                            <label>{{ $permission->name }}</label>
                        </div>
                    </td>
                </tr>
            @endforeach
            </tbody>
        </table>

        <div class="ui divider hidden"></div>

        <button class="ui button primary" type="submit" name="submit" value="1">@lang('overide::action.save')</button>
        <a href="{{ route('overide::roles.index') }}" class="ui button">@lang('overide::action.cancel')</a>
        {!! Form::close() !!}

    </div>
@endsection
