@extends('layouts.yellow')
@section('content')   
    <div class="container-fluid">
        <div class="row">
            <div class="col-12 p-3">
                <div class="card">
                    <div class="card-header">
                        <h2>{{ __('view-config.view') }}</h2>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-12">
                <div style="margin-left:100px">
                    <img class="w-40" src="{{asset('img/settings.png')}}" alt="">
                </div>
            </div>
        </div>
    </div>
   
    <form class="form-control" method="POST" action="{{URL::to('/admin/create-config')}}">
        <div id="configContainer" class="container-fluid container-config p-5">
            <div id="rowSettings" class="row">
                @foreach($settings as $setting)
                    <div class="col-12">
                        <input type="hidden" name="id[]" value="{{$setting->id}}">
                        <div class="container-fluid p-2">
                            <div class="row">
                                <div class="col-6">
                                    <input name="key[]" class="form-control" type="text" value="{{$setting->key}}">
                                </div>
                                <div class="col-6">
                                    <input name="value[]" class="form-control" type="text" value="{{$setting->value}}">
                                </div>
                            </div>
                        </div>
                    </div>
                @endforeach
            </div>
            <div class="row">
                <div class="col-12">
                    <div class="p-5">
                        <button type="button" class="btn btn-primary" id="add-config">
                            {{__('view-config.add')}}
                        </button>
                        <div class="float-right">
                            <button type="submit" class="btn btn-success">
                                {{__('view-config.save')}}
                            </button>
                            <button  type="button" class="btn btn-light">
                                {{__('view-config.cancel')}}
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
@endsection
@section("javascript")
    <script src="{{ asset('js/view-config.js') }}"></script>
@endsection