@extends('layouts.landing')

@section('head')
    @include('layouts._partials.tablaStyle')
@endsection

@section('title', 'Administrar 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 asignadas &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 (session('info'))
                <div class="alert alert-success"><strong>{{ session('info') }}</strong></div>
            @endif

            @if ($materiales->isEmpty())
                <div class="alert alert-warning">No tienes materias asignadas en este grupo.</div>
            @else
                <div class="row">
                    @foreach ($materiales as $material)
                        <div class="col-md-4 mb-4">
                            <div class="card border-left-primary shadow h-100">
                                <div class="card-body">
                                    <div class="text-xs font-weight-bold text-primary text-uppercase mb-1">
                                        {{ $material->clave }}
                                    </div>
                                    <div class="h5 mb-2 font-weight-bold text-gray-800">
                                        {{ $material->name }}
                                    </div>
                                    <p class="text-muted small mb-3">
                                        Ciclo: {{ $material->ciclo }} &middot; {{ $material->horas }} hrs
                                    </p>
                                    <a href="{{ route('grupo.material.tareas', [$grupo, $material]) }}"
                                       class="btn btn-primary btn-sm btn-block">
                                        <i class="fas fa-tasks fa-sm"></i> Gestionar Tareas
                                    </a>
                                </div>
                            </div>
                        </div>
                    @endforeach
                </div>
            @endif

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