@extends('backend.layouts.app') @section('title', __('labels.backend.lessons.title').' | '.app_name()) @push('after-styles') @endpush @section('content') {!! Form::model($lesson, ['method' => 'PUT', 'route' => ['admin.lessons.update', $lesson->id], 'files' => true,]) !!}

@lang('labels.backend.lessons.edit')

{!! Form::label('course_id', trans('labels.backend.lessons.fields.course'), ['class' => 'control-label']) !!} {!! Form::select('course_id', $courses, old('course_id'), ['class' => 'form-control select2']) !!}
{!! Form::label('title', trans('labels.backend.lessons.fields.title').'*', ['class' => 'control-label']) !!} {!! Form::text('title', old('title'), ['class' => 'form-control', 'placeholder' => trans('labels.backend.lessons.fields.title'), 'required' => '']) !!}
{!! Form::label('slug', trans('labels.backend.lessons.fields.slug'), ['class' => 'control-label']) !!} {!! Form::text('slug', old('slug'), ['class' => 'form-control', 'placeholder' => trans('labels.backend.lessons.slug_placeholder')]) !!}
@if ($lesson->lesson_image)
{!! Form::label('lesson_image', trans('labels.backend.lessons.fields.lesson_image').' '.trans('labels.backend.lessons.max_file_size'), ['class' => 'control-label']) !!} {!! Form::file('lesson_image', ['class' => 'form-control', 'accept' => 'image/jpeg,image/gif,image/png', 'style' => 'margin-top: 4px;']) !!} {!! Form::hidden('lesson_image_max_size', 8) !!} {!! Form::hidden('lesson_image_max_width', 4000) !!} {!! Form::hidden('lesson_image_max_height', 4000) !!}
@else
{!! Form::label('lesson_image', trans('labels.backend.lessons.fields.lesson_image').' '.trans('labels.backend.lessons.max_file_size'), ['class' => 'control-label']) !!} {!! Form::file('lesson_image', ['class' => 'form-control']) !!} {!! Form::hidden('lesson_image_max_size', 8) !!} {!! Form::hidden('lesson_image_max_width', 4000) !!} {!! Form::hidden('lesson_image_max_height', 4000) !!}
@endif
{!! Form::label('short_text', trans('labels.backend.lessons.fields.short_text'), ['class' => 'control-label']) !!} {!! Form::textarea('short_text', old('short_text'), ['class' => 'form-control ', 'placeholder' => trans('labels.backend.lessons.short_description_placeholder')]) !!}
{!! Form::label('full_text', trans('labels.backend.lessons.fields.full_text'), ['class' => 'control-label']) !!} {!! Form::textarea('full_text', old('full_text'), ['class' => 'form-control editor', 'placeholder' => '']) !!}
{!! Form::label('downloadable_files', trans('labels.backend.lessons.fields.downloadable_files').' '.trans('labels.backend.lessons.max_file_size'), ['class' => 'control-label']) !!} {!! Form::file('downloadable_files[]', [ 'multiple', 'class' => 'form-control file-upload', 'id' => 'downloadable_files', 'accept' => "image/jpeg,image/gif,image/png,application/msword,audio/mpeg,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.ms-powerpoint,application/pdf,video/mp4" ]) !!}
@if(count($lesson->downloadableMedia) > 0) @foreach($lesson->downloadableMedia as $media)

{{ $media->name }} ({{ $media->size }} KB) @lang('labels.backend.lessons.remove')

@endforeach @endif
{!! Form::label('pdf_files', trans('labels.backend.lessons.fields.add_pdf'), ['class' => 'control-label']) !!} {!! Form::file('add_pdf', [ 'class' => 'form-control file-upload', 'id' => 'add_pdf', 'accept' => "application/pdf" ]) !!}
{!! Form::label('pdf_files', trans('labels.backend.lessons.fields.add_audio'), ['class' => 'control-label']) !!} {!! Form::file('add_audio', [ 'class' => 'form-control file-upload', 'id' => 'add_audio', 'accept' => "audio/mpeg3" ]) !!}
{!! Form::label('add_video', trans('labels.backend.lessons.fields.add_video'), ['class' => 'control-label']) !!} {!! Form::select('media_type', ['youtube' => 'Youtube','vimeo' => 'Vimeo','upload' => 'Upload','embed' => 'Embed'],($lesson->mediavideo) ? $lesson->mediavideo->type : null,['class' => 'form-control', 'placeholder' => 'Select One','id'=>'media_type' ]) !!} {!! Form::text('video', ($lesson->mediavideo) ? $lesson->mediavideo->url : null, ['class' => 'form-control mt-3 d-none', 'placeholder' => trans('labels.backend.lessons.enter_video_url'),'id'=>'video' ]) !!} {!! Form::file('video_file', ['class' => 'form-control mt-3 d-none', 'placeholder' => trans('labels.backend.lessons.enter_video_url'),'id'=>'video_file','accept' =>'video/mp4' ]) !!} @if($lesson->mediavideo && ($lesson->mediavideo->type == 'upload')) @endif @lang('labels.backend.lessons.video_guide')
{!! Form::hidden('published', 0) !!} {!! Form::checkbox('published', 1, old('published'), []) !!} {!! Form::label('published', trans('labels.backend.lessons.fields.published'), ['class' => 'control-label control-label font-weight-bold']) !!}
{!! Form::submit(trans('strings.backend.general.app_update'), ['class' => 'btn btn-primary']) !!}
{!! Form::close() !!} @stop @push('after-scripts') @endpush