@include('console.server.header')
<div class="{{ $_W['isajax'] ?'unpadding':'layui-fluid' }}">
    <div class="main-content fui-content">
        @if(!$_W['isajax'])
        <h2>@lang('lang.languagePackage')</h2>
        <div class="layui-tab fui-tab margin-bottom-xl">
            <ul class="layui-tab-title title_tab">
                <li>
                    <a href="{{ $inService->url() }}">@lang('lang.languagePackage')</a>
                </li>
                <li>
                    <a href="{{ $inService->url('locales') }}">@lang('lang.languages')</a>
                </li>
                <li class="layui-this">
                    <a href="javascript:">{{ $title }}</a>
                </li>
            </ul>
        </div>
        @endif

        <div class="fui-card layui-card">
            <div class="layui-card-body">
                <form class="layui-form" method="post" action="{{ $inService->url('locales/post') }}" lay-filter="component-form-element">
                    <input type="hidden" name="_token" value="{{ $_W['token'] }}" />
                    <div class="layui-form-item must">
                        <label class="layui-form-label">ID</label>
                        <div class="layui-input-block">
                            <input type="text" name="id" value="{{ $language['code'] }}"{{ $language ? ' readonly' : '' }} lay-verify="required" placeholder="@lang('lang.localePlaceholder')" autocomplete="off" class="layui-input{{ $language ? ' layui-bg-gray':'' }}" />
                        </div>
                    </div>
                    <div class="layui-form-item must">
                        <label class="layui-form-label">@lang('language')</label>
                        <div class="layui-input-block">
                            <input type="text" name="data[name]" value="{{ $language['name'] }}" lay-verify="required" placeholder="@lang('lang.packageNamePlaceholder')" autocomplete="off" class="layui-input" />
                        </div>
                    </div>
                    <div class="layui-form-item must">
                        <label class="layui-form-label">@lang('lang.country')</label>
                        <div class="layui-input-block">
                            <input type="text" name="data[country]" value="{{ $language['country'] }}" lay-verify="required" placeholder="@lang('lang.countryPlaceholder')" autocomplete="off" class="layui-input" />
                        </div>
                    </div>
                    <div class="layui-form-item must">
                        <label class="layui-form-label">@lang('state')</label>
                        <div class="layui-input-block">
                            <input type="radio" name="data[status]" value="1" title="@lang('open')"{{ empty($language)||$language['status']?' checked' : '' }} />
                            <input type="radio" name="data[status]" value="0" title="@lang('close')"{{ $language['code']==$appLocale ? ' disabled':'' }}{{ $language&&!$language['status']?' checked' : '' }} />
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn layui-btn-normal" lay-submit type="submit" value="true" name="savedata">@lang('save')</button>
                            <button type="reset" class="layui-btn layui-btn-primary">@lang('reset')</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
@include('common.footer')
