web-mooc/resources/views/instructor/project/edit.blade.php
2026-01-30 14:48:46 +07:00

59 lines
2.5 KiB
PHP

@php
$project = App\Models\Lesson::join('sections', 'lessons.section_id', 'sections.id')
->join('courses', 'sections.course_id', 'courses.id')
->select('lessons.*', 'courses.id as course_id')
->where('lessons.id', $id)
->first();
@endphp
<form action="{{ route('instructor.course.project.update', $id) }}" method="post">@csrf
<div class="fpb7 mb-3">
<label class="form-label ol-form-label" for="title">
{{ get_phrase('Title') }}
<span class="text-danger ms-1">*</span>
</label>
<input class="form-control ol-form-control" type="text" id="title" name="title" value="{{ $project->title }}"
required>
</div>
<div class="row mb-3">
<div class="col-sm-12 fpb-7">
<label class="form-label ol-form-label">
{{ get_phrase('Section') }}
<span class="text-danger ms-1">*</span>
</label>
<select class="form-control ol-form-control ol-select2" data-toggle="select2" name="section">
<option value="">{{ get_phrase('Select an option') }}</option>
@foreach (App\Models\Section::where('course_id', $project->course_id)->get() as $section)
<option value="{{ $section->id }}" @if ($section->id == $project->section_id) selected @endif>
{{ $section->title }}</option>
@endforeach
</select>
</div>
</div>
<div class="fpb-7 mb-3">
<label for="description"
class="form-label ol-form-label col-form-label">{{ get_phrase('Project Assignment') }}</label>
<textarea name="description" rows="5" class="form-control ol-form-control text_editor">{!! $project->description !!}</textarea>
</div>
<div class="fpb-7 mb-3">
<label for="attachment"
class="form-label ol-form-label col-form-label">{{ get_phrase('Assessment Criteria') }}</label>
<textarea name="attachment" rows="5" class="form-control ol-form-control text_editor">{!! $project->attachment !!}</textarea>
</div>
<div class="fpb-7 mb-6">
<label for="summary"
class="form-label ol-form-label col-form-label">{{ get_phrase('Summary') }}</label>
<textarea name="summary" rows="5" class="form-control ol-form-control text_editor">{!! $project->summary !!}</textarea>
</div>
<div class="fpb7">
<button type="submit" class="btn ol-btn-primary">{{ get_phrase('Update Project') }}</button>
</div>
</form>
@include('instructor.init')