@extends('layouts.landing')

@section('title', 'Materias del grupo')

@section('content')
<div class="container-fluid">
    <div class="card shadow mb-4">
        <div class="card-header py-3">
            <div class="d-sm-flex align-items-center justify-content-between">
                <h6 class="m-0 font-weight-bold text-primary">
                    Materias &mdash; Grupo: {{ $grupo->clave }}
                </h6>
                <a href="{{ route('grupo.index') }}" class="btn btn-sm btn-secondary shadow-sm">
                    <i class="fas fa-arrow-left fa-sm"></i> Regresar
                </a>
            </div>
        </div>

        <div class="card-body">

            @if ($asignaciones->isEmpty())
                <div class="alert alert-warning">Este grupo no tiene materias asignadas.</div>
            @else
                <div class="row">
                    @foreach ($asignaciones as $asig)
                        <div class="col-md-4 mb-4">
                            <div class="card border-left-info shadow h-100">
                                <div class="card-body">
                                    <div class="text-xs font-weight-bold text-info text-uppercase mb-1">
                                        {{ $asig->material_clave }}
                                    </div>
                                    <div class="h5 mb-1 font-weight-bold text-gray-800">
                                        {{ $asig->material_name }}
                                    </div>
                                    <p class="text-muted small mb-1">
                                        Ciclo: {{ $asig->ciclo }} &middot; {{ $asig->horas }} hrs
                                    </p>
                                    <p class="small mb-3">
                                        <i class="fas fa-chalkboard-teacher fa-sm text-gray-500"></i>
                                        <span class="text-gray-700">
                                            {{ $asig->apellidoPaterno }} {{ $asig->apellidoMaterno }} {{ $asig->docente_nombre }}
                                        </span>
                                    </p>
                                    <a href="{{ route('grupo.material.tareas', [$grupo->id, $asig->material_id]) }}"
                                       class="btn btn-info btn-sm btn-block">
                                        <i class="fas fa-tasks fa-sm"></i> Ver Tareas
                                    </a>
                                </div>
                            </div>
                        </div>
                    @endforeach
                </div>
            @endif

        </div>
    </div>
</div>
@endsection
