@extends('layouts.admin')

@section('content')

<!-- [ breadcrumb ] start -->
<div class="page-header">
    <div class="page-block">
        <div class="row align-items-center">
            <div class="col-md-12">
                <ul class="breadcrumb">
                    <li class="breadcrumb-item"><a href="{{ route('admin.dashboard') }}">হোম</a></li>
                    <li class="breadcrumb-item"><a href="javascript: void(0)">সিস্টেম</a></li>
                    <li class="breadcrumb-item" aria-current="page">Roles / Create</li>
                </ul>
            </div>
            <div class="col-md-12">
                <div class="page-header-title">
                    <h2 class="mb-0">Roles / Create</h2>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- [ breadcrumb ] end -->

<div class="card">
    <div class="card-body">
        @include('includes.admin.form-error')
        @include('includes.admin.form-success')
        <div class="gocover" style="background: url({{asset('assets/images/'.$gs->admin_loader)}}) no-repeat scroll center center rgba(45, 45, 45, 0.5);"></div>
        <form id="geniusform" action="{{route('admin.role.store')}}" method="POST" enctype="multipart/form-data">
            {{csrf_field()}}

            <div class="mb-3">
                <label class="form-label">{{ __("Name") }} <span class="text-danger">*</span></label>
                <input type="text" class="form-control" name="name" placeholder="{{ __('Name') }}">
                <small class="text-muted">{{ __("(In Any Language)") }}</small>
            </div>

            <hr>
            <h5 class="text-center mb-3">{{ __('Permissions') }}</h5>
            <hr>

            <div class="row g-3 justify-content-center">
                @php
                $permissions = [
                    'menu_builder' => 'Menu Builder',
                    'pages' => 'Pages',
                    'categories' => 'Categories',
                    'add_post' => 'Add Post',
                    'add_gallery' => 'Add Gallery',
                    'posts' => 'Posts',
                    'schedule_post' => 'Schedule Post',
                    'drafts' => 'Drafts',
                    'rss_feeds' => 'Rss Feeds',
                    'polls' => 'Polls',
                    'widgets' => 'Widgets',
                    'create_ads' => 'Create Ads',
                    'newsLetter' => 'NewsLetter',
                    'contact_messages' => 'Contact Messages',
                    'languages' => 'Languages',
                    'general_settings' => 'General Settings',
                    'social_settings' => 'Social Settings',
                    'seo_tools' => 'SEO Tools',
                    'emails_settings' => 'Email Settings',
                    'role_management' => 'Role Management',
                    'font_option' => 'Font Option',
                    'user_management' => 'User Management',
                    'cache_management' => 'Cache Management',
                    'administration_management' => 'Administration Management',
                ];
                @endphp

                @foreach ($permissions as $value => $label)
                <div class="col-lg-4">
                    <div class="d-flex justify-content-between align-items-center p-2 border rounded mb-2">
                        <label class="form-check-label">{{ __($label) }}</label>
                        <div class="form-check form-switch">
                            <input class="form-check-input" type="checkbox" name="section[]" value="{{ $value }}">
                        </div>
                    </div>
                </div>
                @endforeach
            </div>

            <div class="mt-4">
                <button class="btn btn-primary" type="submit">{{ __('Create Role') }}</button>
            </div>
        </form>
    </div>
</div>

@endsection