@extends('layouts.app')

@section('title', 'Grade Entry | Teacher')

@section('sidebar-menu')
    @include('teacher.partials.sidebar')
@endsection

@section('breadcrumb')
    Teacher / Grade Entry
@endsection

@section('content')
    <div class="card shadow-sm">
        <div class="card-header d-flex justify-content-between">
            <span>📝 Select Class & Subject to Enter Marks</span>
        </div>
        <div class="card-body">
            <div class="row">
                @foreach($myClasses as $class)
                <div class="col-md-6 mb-4">
                    <div class="card border">
                        <div class="card-body">
                            <h5>{{ $class->name }}</h5>
                            <p class="text-muted">Choose subject to enter grades</p>
                            
                            @foreach($class->subjects as $subject)
                            <a href="{{ route('teacher.grades.create', ['class' => $class->id, 'subject' => $subject->id]) }}" class="btn btn-outline-primary mb-2 d-block">
                                Enter Marks for {{ $subject->name }}
                            </a>
                            @endforeach
                        </div>
                    </div>
                </div>
                @endforeach
            </div>
        </div>
    </div>
@endsection