No Description

show.blade.php 5.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. @extends('layouts.app')
  2. @section('title', $course->title, 'Curso')
  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()->sort() 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) 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-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. <a href="{{ $section->syllabus }}">PDF</a>
  74. </td>
  75. <td class="mdc-data-table__cell mdc-data-table__cell--numeric">
  76. @if (!is_null($section->credits))
  77. {{ $section->credits }}
  78. @else
  79. n/a
  80. @endif
  81. </td>
  82. <td class="mdc-data-table__cell mdc-data-table__cell--numeric">
  83. @if (!is_null($section->student_count))
  84. {{ $section->student_count }}
  85. @else
  86. n/a
  87. @endif
  88. </td>
  89. </tr>
  90. @endforeach
  91. </tbody>
  92. </table>
  93. </div>
  94. </div>
  95. @if (!$loop->last)
  96. <br>
  97. @endif
  98. @endforeach
  99. </div>
  100. </div>
  101. @endsection
  102. @section('modals')
  103. @include('modal.course.edit')
  104. @include('modal.section.edit')
  105. @include('modal.syllabus')
  106. @endsection
  107. @section('scripts')
  108. <script src="/js/course.js"></script>
  109. @endsection