Geen omschrijving

index.blade.php 4.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. @extends('layouts.app')
  2. @section('title', 'Profesores | Gerencia Docente')
  3. @section('content')
  4. <div class="mdc-layout-grid__inner">
  5. <div class="mdc-layout-grid__cell mdc-layout-grid__cell--span-12-desktop">
  6. <h1>Profesores</h1>
  7. </div>
  8. @auth
  9. <div class="mdc-layout-grid__cell mdc-layout-grid__cell--span-4">
  10. <button type="button" class="mdc-button mdc-button--outlined" data-toggle="modal" data-target="#modal-professor-create">
  11. <span class="mdc-button__label">Añadir Profesor</span>
  12. </button>
  13. </div>
  14. @endauth
  15. </div>
  16. @if ($errors->any())
  17. <div class="mdc-layout-grid__inner">
  18. <div class="alert alert-danger alert-dismissible fade show mdc-layout-grid__cell mdc-layout-grid__cell--span-12" role="alert">
  19. <button type="button" class="close" data-dismiss="modal" aria-label="close">
  20. <span aria-hidden="true">&times;</span>
  21. </button>
  22. <ul class="mdc-list">
  23. @foreach ($errors->all() as $error)
  24. <li class="mcd-list-item"><span class="mdc-list-item__text">{{ $error }}</span></li>
  25. @endforeach
  26. </ul>
  27. </div>
  28. </div>
  29. @endif
  30. <hr>
  31. <div class="mdc-layout-grid__inner">
  32. <div class="mdc-data-table mdc-layout-grid__cell--span-12 table-fixed-col-head table-fixed-row-head table--fit-screen">
  33. <table id="prof-table" class="mdc-data-table__table">
  34. <thead>
  35. <tr class="mdc-data-table__header-row">
  36. <th class="mdc-data-table__header-cell mdc-elevation--z3" scope="col">Profesor</th>
  37. <th class="mdc-data-table__header-cell mdc-elevation--z2" scope="col" @guest style="display:none;" @endguest>Edit</th>
  38. @foreach ($semesters as $semester)
  39. <th class="mdc-data-table__header-cell mdc-elevation--z2" scope="col">Carga Total<br>{{ $semester->alpha }}</th>
  40. @endforeach
  41. </tr>
  42. </thead>
  43. <tbody class="mdc-data-table__content">
  44. @foreach ($professors as $professor)
  45. <tr class="mdc-data-table__row">
  46. <th scope="row" class="mdc-data-table__cell mdc-elevation--z1">
  47. <a href="/professor/{{ $professor->id }}">{{ $professor->last_name . ', ' . $professor->first_name }}</a>
  48. </th>
  49. <td class="mdc-data-table__cell" @guest style="display:none;" @endguest>
  50. <button class="mdc-icon-button material-icons" data-toggle="modal" data-target="#modal-professor-edit" data-professor-id="{{ $professor->id }}">edit</button>
  51. </td>
  52. @foreach ($semesters as $semester)
  53. <td class="mdc-data-table__cell mdc-data-table__cell--numeric">
  54. @php
  55. $total_load = 0;
  56. $prof_sem = $professor->semesters->find($semester->code);
  57. $prof_sections = $professor->sections->where('semester_code', '=', $semester->code);
  58. if ($prof_sem) {
  59. $total_load += ($prof_sem->pivot->admin_load ?? 0) + ($prof_sem->pivot->investigative_load ?? 0);
  60. }
  61. $total_load += $professor->getAcademicLoad($semester);
  62. @endphp
  63. {{ $total_load }}
  64. </td>
  65. @endforeach
  66. </tr>
  67. @endforeach
  68. </tbody>
  69. </table>
  70. </div>
  71. </div>
  72. @endsection
  73. @section('modals')
  74. @include('modal.professor.create')
  75. @include('modal.professor.edit')
  76. @endsection
  77. @section('scripts')
  78. <script type="text/javascript" src="/js/prof.js"></script>
  79. @endsection