task-5 (Lessons and Scores) #5

Merged
klllst merged 16 commits from feature/task-5 into develop 2024-05-27 18:42:11 +04:00
8 changed files with 47 additions and 30 deletions
Showing only changes of commit c269765c39 - Show all commits

View File

@ -0,0 +1,10 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class ScoreController extends Controller
{
//
}

View File

@ -0,0 +1,30 @@
<?php
namespace App\Services;
use App\Models\Lesson;
use Illuminate\Database\Eloquent\Model;
class ScoreService implements ServiceInterface
{
public function getAll(?Lesson $lesson = null)
{
return $lesson->grade->students;
}
public function create(array $data): Model
{
}
public function update(Model $model, array $data): Model
{
// TODO: Implement update() method.
}
public function delete(Model $model)
{
// TODO: Implement delete() method.
}
}

View File

@ -1,22 +0,0 @@
@extends('layouts.app')
@section('content')
<div class="container col-md-4">
<div class="row justify-content-center">
<div class="card mt-4">
<div class="card-header">{{__('Классы')}}</div>
<div class="card-body">
@if (count($grades))
<div class="list-group">
@foreach ($grades as $grade)
<a href="{{ route('grades.lessons.index', $grade) }}" class="list-group-item list-group-item-action d-flex justify-content-center">{{ $grade->name }}</a>
@endforeach
</div>
@else
<p>Классы отсутствуют</p>
@endif
</div>
</div>
</div>
</div>
@endsection

View File

@ -20,6 +20,7 @@
</div>
</div>
<div class="card-footer">
<a href="{{ route('lessons.students.index', $lesson) }}" class="btn btn-success">Оценки</a>
<a href="{{ route('grades.lessons.edit', [$grade, $lesson]) }}" class="btn btn-primary">Редактировать</a>
</div>
</div>

View File

@ -36,16 +36,16 @@
class="btn btn-block col-8">{{ $grade->name }}</a>
</div>
</td>
<td>
<div>
<a href="{{ route('grades.lessons.index', $grade) }}" class="btn btn-primary">Занятия</a>
</div>
</td>
<td>
<div>
<a href="{{ route('grades.edit', $grade) }}" class="btn btn-warning">Редактировать</a>
</div>
</td>
{{-- <td>--}}
{{-- <div>--}}
{{-- <a href="{{ route('journals.index', $grade) }}" class="btn btn-primary">Журнал</a>--}}
{{-- </div>--}}
{{-- </td>--}}
<td>
<form action="{{ route('grades.destroy', $grade) }}" method="POST"
style="display: inline-block;">

View File

@ -3,7 +3,6 @@
<ul class="nav justify-content-center pb-3 mb-3">
<li class="nav-item"><a href="{{ route('grades.index') }}" class="nav-link px-2 text-muted">Классы</a></li>
<li class="nav-item"><a href="{{ route('subjects.index') }}" class="nav-link px-2 text-muted">Предметы</a></li>
<li class="nav-item"><a href="{{ route('grades.lessons.grades-list') }}" class="nav-link px-2 text-muted">Занятия</a></li>
<li class="nav-item"><a href="{{ route('students.index') }}" class="nav-link px-2 text-muted">Студенты</a></li>
<li class="nav-item"><a href="{{ route('teachers.index') }}" class="nav-link px-2 text-muted">Учителя</a></li>
</ul>

View File

@ -3,7 +3,6 @@
<ul class="nav nav-pills">
<li class="nav-item"><a href="{{ route('grades.index') }}" class="nav-link @if(request()->is('grades*')) active @endif" aria-current="page">Классы</a></li>
<li class="nav-item"><a href="{{ route('subjects.index') }}" class="nav-link @if(request()->is('subjects*')) active @endif">Предметы</a>
<li class="nav-item"><a href="{{ route('grades.lessons.grades-list') }}" class="nav-link @if(request()->is('grades/{grade}/lessons*')) active @endif">Занятия</a></li>
<li class="nav-item"><a href="{{ route('students.index') }}" class="nav-link @if(request()->is('students*')) active @endif">Ученики</a></li>
<li class="nav-item"><a href="{{ route('teachers.index') }}" class="nav-link @if(request()->is('teachers*')) active @endif">Учителя</a></li>
</ul>

View File

@ -25,4 +25,4 @@ Route::resources([
Route::resource('teachers.subjects', SubjectTeacherController::class)->except('index');
Route::resource('teachers.subjects.grades', GradeTeacherController::class)->except('index', 'show');
Route::resource('grades.subjects', GradeSubjectController::class)->except('index', 'show');
Route::get('lessons/grade-list', [LessonController::class, 'gradeList'])->name('grades.lessons.grades-list');
Route::resource('lessons.students', ScoreController::class)->except('show');