Без опису

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. @extends('layouts.app')
  2. @section('title', $course->title . ' | Gerencia Docente', 'Curso | Gerencia Docente')
  3. @section('content')
  4. <div class="mdc-layout-grid__inner">
  5. <h1 class="mdc-layout-grid__cell mdc-layout-grid__cell--span-12">{{ $course->code }}</h1>
  6. <h3 class="mdc-layout-grid__cell mdc-layout-grid__cell--span-12">{{ $course->title }}</h3>
  7. <div class="mdc-layout-grid__cell mdc-layout-grid__cell--span-12">
  8. <h5>
  9. Prontuario:
  10. @if (!is_null($course->syllabus))
  11. <a href="{{ $course->syllabus }}">PDF</a>
  12. @else
  13. @auth
  14. {{-- TODO: Button for adding syllabus --}}
  15. @else
  16. n/a
  17. @endauth
  18. @endif
  19. </h5>
  20. </div>
  21. </div>
  22. <hr>
  23. <div class="mdc-layout-grid__inner">
  24. <div class="mdc-layout-grid__cell">
  25. <h2>Semestres</h2>
  26. </div>
  27. </div>
  28. {{-- TODO: Add button for new section if admin --}}
  29. <div class="mdc-layout-grid__inner">
  30. <div class="mdc-layout-grid__cell--span-12">
  31. @foreach ($course->semesters->unique()->sortByDesc('code') as $semester)
  32. {{-- @dd($semester_code) --}}
  33. <div class="mdc-layout-grid__inner">
  34. <div class="mdc-layout-grid__cell mdc-layout-grid__cell--span-12">
  35. <h4>{{ $semester->alpha }}</h4>
  36. </div>
  37. <div class="mdc-data-table mdc-layout-grid__cell--span-12 course-sections-table">
  38. <table class="mdc-data-table__table">
  39. <thead class="thead-light">
  40. <tr class="mdc-data-table__header-row">
  41. <th scope="col" class="mdc-data-table__header-cell" @guest style="display:none;" @endguest>Edit</th>
  42. <th scope="col" class="mdc-data-table__header-cell">Sección</th>
  43. <th scope="col" class="mdc-data-table__header-cell">Profesor</th>
  44. <th scope="col" class="mdc-data-table__header-cell">Prontuario</th>
  45. <th scope="col" class="mdc-data-table__header-cell">Creditos</th>
  46. <th scope="col" class="mdc-data-table__header-cell"># de Estudiantes</th>
  47. </tr>
  48. </thead>
  49. <tbody class="mdc-data-table__content">
  50. @foreach ($semester->sections->where('course_id', '=', $course->id)->sortBy('code') as $section)
  51. <tr class="mdc-data-table__row">
  52. <td class="mdc-data-table__cell" @guest style="display:none;" @endguest>
  53. <button class="mdc-data-table__cell--checkbox mdc-icon-button material-icons" data-toggle="modal" data-target="#modal-section-edit" data-section-id="{{ $section->id }}">edit</button>
  54. </td>
  55. <td class="mdc-data-table__cell">{{ $section->code }}</td>
  56. <td class="mdc-data-table__cell">
  57. @foreach ($section->professors->sortBy('last_name') as $professor)
  58. <a href="{{ route('professor.show', ['id' => $professor->id]) }}">{{ $professor->first_name . ' ' . $professor->last_name }}</a>
  59. @if (!$loop->last)
  60. <br>
  61. @endif
  62. @endforeach
  63. </td>
  64. <td class="mdc-data-table__cell">
  65. {{-- TODO: Add buton for uploading syllabus if admin --}}
  66. @if (!is_null($section->syllabus))
  67. <a href="{{ asset($section->syllabus) }}">PDF</a>
  68. @else
  69. @auth
  70. <button type="button" class="mdc-button mdc-button--dense mdc-button--unelevated" data-toggle="modal" data-target="#modal-section-syllabus" data-section-id="{{ $section->id }}">
  71. <span class="mdc-button__label">Subir</span>
  72. </button>
  73. @else
  74. n/a
  75. @endauth
  76. @endif
  77. </td>
  78. <td class="mdc-data-table__cell mdc-data-table__cell--numeric">
  79. @if (!is_null($section->credits))
  80. {{ $section->credits }}
  81. @else
  82. n/a
  83. @endif
  84. </td>
  85. <td class="mdc-data-table__cell mdc-data-table__cell--numeric">
  86. @if (!is_null($section->student_count))
  87. {{ $section->student_count }}
  88. @else
  89. n/a
  90. @endif
  91. </td>
  92. </tr>
  93. @endforeach
  94. </tbody>
  95. </table>
  96. </div>
  97. </div>
  98. @if (!$loop->last)
  99. <br>
  100. <br>
  101. @endif
  102. @endforeach
  103. </div>
  104. </div>
  105. @endsection
  106. @section('modals')
  107. @include('modal.course.edit')
  108. @include('modal.section.edit')
  109. @include('modal.section.syllabus')
  110. @endsection
  111. @section('scripts')
  112. <script src="/js/course.js"></script>
  113. @endsection