@extends('admin.layouts.container')

@section('content')
    @if (session('message'))
        <div class="alert alert-success email_success">{{session('message')}}</div>
    @endif
    <div class="side-title">
        <h3>{{ $head ?? '' }}</h3>
    </div>

    <div class="border-item">
        <form class="form-row" method="post" action="{{ $action }}" enctype="multipart/form-data">

            @if ($settings)
                <input type="hidden" name="update" value="true">
            @endif
            @CSRF
            <ul class="nav nav-tabs container" role="tablist">
                <li class="nav-item">
                    <a class="nav-link active" data-toggle="tab" href="#main">{{ __('settings.main') }}</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" data-toggle="tab" href="#score"> {{ __('settings.score') }} </a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" data-toggle="tab" href="#financial"> {{ __('settings.financial') }} </a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" data-toggle="tab" href="#others"> {{ __('settings.others') }} </a>
                </li>
            </ul>

            <!-- Tab panes -->
            <div class="tab-content container ">
                <div id="main" class="tab-pane active"><br/>
                    <div class="form-row">@include('admin.settings.main', ['settings', $settings])</div>
                </div>
                <div id="score" class="tab-pane"><br/>
                    <div class="form-row">@include('admin.settings.score')</div>
                </div>
                <div id="financial" class="tab-pane"><br/>
                    <div class="form-row"> @include('admin.settings.financial') </div>
                </div>
                <div id="others" class="tab-pane"><br/>
                    <div class="form-row">@include('admin.settings.others')</div>
                </div>
            </div>
            <div class="text-center mt-5 col-12">
                <button class="butn"><span>{{ __('dashboard.save') }}</span></button>
            </div>
        </form>
    </div>

@endsection

@section('inner_js')
    <!-- Editor JS files -->
    <script src="{{ asset('/assets/admin/js/lib/tinymce.min.js') }}"></script>
    {{--    <script src="//cdn.tinymce.com/4/tinymce.min.js"></script>--}}
    <script>
        var route_prefix = "{{ url(config('lfm.prefix')) }}";
        var url = "{{url('/')}}/";
    </script>
    <script src="{{ asset('assets/admin/js/editor.js') }}"></script>
    <script src="{{ asset('assets/admin/js/lfm.js') }}"></script>
    <script>
        $(document).ready(function () {
            let interVal = setInterval(function () {
                $('.email_success').slideUp();
                clearInterval(interVal);
            }, 2000)
        })
    </script>
@endsection
