@extends('layouts.load')

@section('content')

<div class="card shadow-none border-0 mb-0">
    <div class="card-body p-3">
        @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="geniusformdata" action="{{ route('rss.update',$data->id)}}" method="POST" enctype="multipart/form-data">
            {{csrf_field()}}
            <input type="hidden" name="rssId" id="rssId" value="{{ $data->id}}">

            <div class="mb-3">
                <label class="form-label">{{ __('Language') }} <span class="text-danger">*</span></label>
                <select name="language_id" id="rss_language_update_id" class="form-select">
                    <option value="">{{__('Please Select a Language')}}</option>
                    @foreach ($languages as $language)
                        <option value="{{$language->id}}" {{$data->language_id == $language->id ? 'selected' : ''}}>{{$language->language}}</option>
                    @endforeach
                </select>
            </div>

            <div class="mb-3">
                <label class="form-label">{{ __('Category') }} <span class="text-danger">*</span></label>
                <select name="category_id" id="category_id" class="form-select">
                    <option value="">{{__('Please Select a Category')}}</option>
                </select>
            </div>

            <div class="mb-3">
                <label class="form-label">{{ __('Feed Name') }} <span class="text-danger">*</span></label>
                <input type="text" name="feed_name" id="feed_name" class="form-control" value="{{ $data->feed_name}}">
            </div>

            <div class="mb-3">
                <label class="form-label">{{ __('Feed Url') }} <span class="text-danger">*</span></label>
                <input type="text" name="feed_url" id="feed_url" class="form-control" value="{{ $data->feed_url}}">
            </div>

            <div class="mb-3">
                <label class="form-label">{{ __('Number of Posts to Import') }} <span class="text-danger">*</span></label>
                <input type="number" name="post_limit" id="post_limit" class="form-control" value="{{ $data->post_limit}}">
            </div>

            <div class="mb-3">
                <label class="form-label d-block">{{__('Auto Update')}} <span class="text-danger">*</span></label>
                <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="auto_update" id="auto_update1" value="1" {{$data->auto_update==1 ? 'checked' : ''}}>
                    <label class="form-check-label" for="auto_update1">{{__('Yes')}}</label>
                </div>
                <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio" name="auto_update" id="auto_update0" value="0" {{$data->auto_update==0 ? 'checked' : ''}}>
                    <label class="form-check-label" for="auto_update0">{{__('No')}}</label>
                </div>
            </div>

            <button class="btn btn-primary w-100" type="submit">{{ __('Import Rss Feed') }}</button>
        </form>
    </div>
</div>

@endsection

@section('scripts')
<script src="{{asset('assets/admin/js/rss_update.js')}}"></script>
@endsection
