설명 없음

index.blade.php 5.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. @extends('layouts.app')
  2. @section('title', 'Cursos | Gerencia Docente')
  3. @section('content')
  4. <div class="mdc-layout-grid__inner">
  5. <div class="mdc-layout-grid__cell--span-12-desktop">
  6. <h1>Cursos</h1>
  7. </div>
  8. @auth
  9. <div class="mdc-layout-grid__cell--span-4">
  10. <button type="button" class="mdc-button mdc-button--outlined" data-toggle="modal" data-target="#modal-course-create">
  11. <span class="mdc-button__label">Añadir Curso</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-layout-grid__cell mdc-layout-grid__cell--span-12">
  33. <div class="mdc-data-table table-fixed-row-head table-fixed-col-head table--fit-screen">
  34. <table id="course-table" class="mdc-data-table__table">
  35. <thead>
  36. <tr class="mdc-data-table__header-row">
  37. <th class="mdc-data-table__header-cell mdc-elevation--z3" scope="col">Curso</th>
  38. <th class="mdc-data-table__header-cell mdc-elevation--z2" scope="col" @guest style="display:none;" @endguest>Edit</th>
  39. <th class="mdc-data-table__header-cell mdc-elevation--z2" scope="col">Title</th>
  40. <th class="mdc-data-table__header-cell mdc-elevation--z2" scope="col">Prontuario</th>
  41. @foreach ($semesters as $semester)
  42. <th class="mdc-data-table__header-cell mdc-elevation--z2" scope="col"># de Secciones<br>{{ $semester->alpha }}</th>
  43. @endforeach
  44. </tr>
  45. </thead>
  46. <tbody class="mdc-data-table__content">
  47. @foreach ($courses as $course)
  48. <tr class="mdc-data-table__row">
  49. <th scope="row" class="mdc-data-table__cell mdc-elevation--z1">
  50. <a href="{{ route('course.show', ['id' => $course->id]) }}">{{ $course->code }}</a>
  51. </th>
  52. <td class="mdc-data-table__cell" @guest style="display:none;" @endguest>
  53. <button class="mdc-icon-button material-icons" data-toggle="modal" data-target="#modal-course-edit" data-course-id="{{ $course->id }}">edit</button>
  54. </td>
  55. <td class="mdc-data-table__cell" data-toggle="tooltip" title="{{ $course->title }}">{{ substr($course->title, 0, 50) . (strlen($course->title) > 50 ? '...' : '') }}</td>
  56. <td class="mdc-data-table__cell">
  57. @if (!is_null($course->syllabus))
  58. <a href="{{ asset($course->syllabus) }}">PDF</a>
  59. @else
  60. @auth
  61. <button type="button" class="mdc-button mdc-button--dense mdc-button--unelevated" data-toggle="modal" data-target="#modal-course-syllabus" data-course-id="{{ $course->id }}">
  62. <span class="mdc-button__label">Subir</span>
  63. </button>
  64. @else
  65. n/a
  66. @endauth
  67. @endif
  68. </td>
  69. @foreach ($semesters as $semester)
  70. <td class="mdc-data-table__cell mdc-data-table__cell--numeric">
  71. {{ $course->getSemesterSectionCount($semester->code) }}
  72. @if (Auth::check() && $semesters->take(-6)->contains($semester->code))
  73. <button class="mdc-icon-button material-icons" data-toggle="modal" data-target="#modal-section-create" data-course-id="{{ $course->id }}" data-semester-code="{{ $semester->code }}">add</button>
  74. @endif
  75. </td>
  76. @endforeach
  77. </tr>
  78. @endforeach
  79. </tbody>
  80. </table>
  81. </div>
  82. </div>
  83. </div>
  84. @endsection
  85. @section('modals')
  86. @include('modal.course.create')
  87. @include('modal.course.edit')
  88. @include('modal.course.syllabus')
  89. @include('modal.section.create')
  90. @endsection
  91. @section('scripts')
  92. <script type="text/javascript" src="/js/course.js"></script>
  93. @endsection