12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- @extends('layouts.app')
-
- @section('title', 'Profesores | Gerencia Docente')
-
- @section('content')
- <div class="mdc-layout-grid__inner">
- <div class="mdc-layout-grid__cell mdc-layout-grid__cell--span-12-desktop">
- <h1>Profesores</h1>
- </div>
- @auth
- <div class="mdc-layout-grid__cell mdc-layout-grid__cell--span-4">
- <button type="button" class="mdc-button mdc-button--outlined" data-toggle="modal" data-target="#modal-professor-create">
- <span class="mdc-button__label">Añadir Profesor</span>
- </button>
- </div>
- @endauth
- </div>
- @if ($errors->any())
- <div class="mdc-layout-grid__inner">
- <div class="alert alert-danger alert-dismissible fade show mdc-layout-grid__cell mdc-layout-grid__cell--span-12" role="alert">
- <button type="button" class="close" data-dismiss="modal" aria-label="close">
- <span aria-hidden="true">×</span>
- </button>
- <ul class="mdc-list">
- @foreach ($errors->all() as $error)
- <li class="mcd-list-item"><span class="mdc-list-item__text">{{ $error }}</span></li>
- @endforeach
- </ul>
- </div>
- </div>
- @endif
- <hr>
- <div class="mdc-layout-grid__inner">
- <div class="mdc-data-table mdc-layout-grid__cell--span-12 table-fixed-col-head table-fixed-row-head table--fit-screen">
- <table id="prof-table" class="mdc-data-table__table">
- <thead>
- <tr class="mdc-data-table__header-row">
- <th class="mdc-data-table__header-cell mdc-elevation--z3" scope="col">Profesor</th>
- <th class="mdc-data-table__header-cell mdc-elevation--z2" scope="col" @guest style="display:none;" @endguest>Edit</th>
- @foreach ($semesters as $semester)
- <th class="mdc-data-table__header-cell mdc-elevation--z2" scope="col">Carga Total<br>{{ $semester->alpha }}</th>
- @endforeach
- </tr>
- </thead>
- <tbody class="mdc-data-table__content">
- @foreach ($professors as $professor)
- <tr class="mdc-data-table__row">
- <th scope="row" class="mdc-data-table__cell mdc-elevation--z1">
- <a href="/professor/{{ $professor->id }}">{{ $professor->last_name . ', ' . $professor->first_name }}</a>
- </th>
- <td class="mdc-data-table__cell" @guest style="display:none;" @endguest>
- <button class="mdc-icon-button material-icons" data-toggle="modal" data-target="#modal-professor-edit" data-professor-id="{{ $professor->id }}">edit</button>
- </td>
- @foreach ($semesters as $semester)
- <td class="mdc-data-table__cell mdc-data-table__cell--numeric">
- @php
- $total_load = 0;
-
- $prof_sem = $professor->semesters->find($semester->code);
- $prof_sections = $professor->sections->where('semester_code', '=', $semester->code);
-
- if ($prof_sem) {
- $total_load += ($prof_sem->pivot->admin_load ?? 0) + ($prof_sem->pivot->investigative_load ?? 0);
- }
- $total_load += $professor->getAcademicLoad($semester);
- @endphp
- {{ $total_load }}
- </td>
- @endforeach
- </tr>
- @endforeach
- </tbody>
- </table>
- </div>
- </div>
- @endsection
-
- @section('modals')
- @include('modal.professor.create')
- @include('modal.professor.edit')
- @endsection
-
- @section('scripts')
- <script type="text/javascript" src="/js/prof.js"></script>
- @endsection
|