@extends('layouts.layout-2')
@section('content')


    <style type="text/css">
        .form-control.has-error {
            border: 1px solid #ea8e49;
        }
    </style>


    <div class="row">

        <div class="col-lg-3 col-xl-2">

            <div>
                @foreach($files as $fl)

                    <?php
                    $ae = substr($fl, 0, strrpos($fl,' ('));
                    ?>

                    <a href="{{ url('/admin/translation/file/'.substr($fl, 0, strrpos($fl,' (')).'/'.$language.'/'.$langsource.'/'.$show) }}" class="media align-items-center bg-lighter text-dark py-1 px-1 @if($ae === $edit) active @endif">
                        <div class="media-body ml-3">
                            {{ $fl }}
                        </div>
                    </a>



                @endforeach
            </div>

        </div>

            <div class="col">
                <div class="white-box p-0 min-height-500">
                    <!-- .left-right-aside-column-->
                    <div class="page-aside">
                        <!-- .left-aside-column-->

                    @if($translations)

                        {!! Form::open([ 'url' => route('admin_translate_file_update', [$file, $language, $langsource, $show]), 'method' => 'post', 'class' => 'form-horizontal' ]) !!}

                        <!-- /.left-aside-column-->
                            <div class="right-aside">


                                <div class="clearfix"></div>
                                <div class="scrollable">

                                    <div class="row">
                                        <div class="col-12">
                                           <!-- <div class="float-right">
                                                Translation from
                                                <select class="selectpicker" onchange="if (this.value) window.location.href=this.value" >
                                                    @foreach($langs as $source)
                                                        <option value="{{ url('/admin/translation/file/'.$file.'/'.$language.'/'.$source.'/'.$show) }}" @if($source == $langsource) selected @endif>{{ $source }}</option>
                                                    @endforeach
                                                </select>
                                            </div>

                                            <div class="float-right">
                                                Translation
                                                <select class="selectpicker" onchange="if (this.value) window.location.href=this.value" >
                                                    @foreach($langs as $lang)
                                                        <option value="{{ url('/admin/translation/file/'.$file.'/'.$lang.'/'.$langsource.'/'.$show) }}" @if($language == $lang) selected @endif>{{ $lang }}</option>
                                                    @endforeach

                                                </select>
                                            </div>
                                            -->
                                            <div class="">
                                                <br>
                                                <button type="submit" class="btn btn-primary">
                                                    Save
                                                </button>
                                            </div>


                                        </div>
                                    </div>
                                    <div class="clearfix"><br></div>

                                    <div class="table-responsive">


                                        <table class="table table-striped">

                                            <tbody>
                                            @foreach($translations as $key => $value)
                                                @include('translation.translation_row', [
                                                    'key' => $key,
                                                    'value' => $value,
                                                    'language'=> $language,
                                                    'parent' => null,
                                                    'prefix' => $prefix,
                                                    'langsource' => $langsource,
                                                    'show' => $show,
                                                ])
                                            @endforeach
                                            </tbody>
                                        </table>

                                    </div>
                                </div>


                                <div class="col-xs-12">
                                    <button type="submit" class="btn btn-primary">
                                        Save
                                    </button>
                                </div>
                            </div>
                        {!! Form::close() !!}
                    @endif

                    <!-- .left-aside-column-->
                    </div>
                    <!-- /.left-right-aside-column-->
                </div>
            </div>
        </div>
        <!-- /.row -->





@endsection
