Нема описа

show.blade.php 6.6KB

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