123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- @extends('layouts.app')
-
- @section('title', $course->title . ' | Gerencia Docente', 'Curso | Gerencia Docente')
-
- @section('content')
- <div class="mdc-layout-grid__inner">
- <h1 class="mdc-layout-grid__cell mdc-layout-grid__cell--span-12">{{ $course->code }}</h1>
- <h3 class="mdc-layout-grid__cell mdc-layout-grid__cell--span-12">{{ $course->title }}</h3>
- <div class="mdc-layout-grid__cell mdc-layout-grid__cell--span-12">
- <h5>
- Prontuario:
- @if (!is_null($course->syllabus))
- <a href="{{ $course->syllabus }}">PDF</a>
- @else
- @auth
- {{-- TODO: Button for adding syllabus --}}
-
- @else
- n/a
- @endauth
- @endif
- </h5>
- </div>
- </div>
- <hr>
- <div class="mdc-layout-grid__inner">
- <div class="mdc-layout-grid__cell">
- <h2>Semestres</h2>
- </div>
- </div>
- {{-- TODO: Add button for new section if admin --}}
- <div class="mdc-layout-grid__inner">
- <div class="mdc-layout-grid__cell--span-12">
- @foreach ($course->semesters->unique()->sortByDesc('code') as $semester)
- {{-- @dd($semester_code) --}}
- <div class="mdc-layout-grid__inner">
- <div class="mdc-layout-grid__cell mdc-layout-grid__cell--span-12">
- <h4>{{ $semester->alpha }}</h4>
- </div>
- <div class="mdc-data-table mdc-layout-grid__cell--span-12 course-sections-table">
- <table class="mdc-data-table__table">
- <thead class="thead-light">
- <tr class="mdc-data-table__header-row">
- <th scope="col" class="mdc-data-table__header-cell" @guest style="display:none;" @endguest>Edit</th>
- <th scope="col" class="mdc-data-table__header-cell">Sección</th>
- <th scope="col" class="mdc-data-table__header-cell">Profesor</th>
- <th scope="col" class="mdc-data-table__header-cell">Prontuario</th>
- <th scope="col" class="mdc-data-table__header-cell">Creditos</th>
- <th scope="col" class="mdc-data-table__header-cell"># de Estudiantes</th>
- </tr>
- </thead>
- <tbody class="mdc-data-table__content">
- @foreach ($semester->sections->where('course_id', '=', $course->id)->sortBy('code') as $section)
- <tr class="mdc-data-table__row">
- <td class="mdc-data-table__cell" @guest style="display:none;" @endguest>
- <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>
- </td>
- <td class="mdc-data-table__cell">{{ $section->code }}</td>
- <td class="mdc-data-table__cell">
- @foreach ($section->professors->sortBy('last_name') as $professor)
- <a href="{{ route('professor.show', ['id' => $professor->id]) }}">{{ $professor->first_name . ' ' . $professor->last_name }}</a>
- @if (!$loop->last)
- <br>
- @endif
- @endforeach
- </td>
- <td class="mdc-data-table__cell">
- {{-- TODO: Add buton for uploading syllabus if admin --}}
- @if (!is_null($section->syllabus))
- <a href="{{ asset($section->syllabus) }}">PDF</a>
- @else
- @auth
- <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 }}">
- <span class="mdc-button__label">Subir</span>
- </button>
- @else
- n/a
- @endauth
- @endif
- </td>
- <td class="mdc-data-table__cell mdc-data-table__cell--numeric">
- @if (!is_null($section->credits))
- {{ $section->credits }}
- @else
- n/a
- @endif
- </td>
- <td class="mdc-data-table__cell mdc-data-table__cell--numeric">
- @if (!is_null($section->student_count))
- {{ $section->student_count }}
- @else
- n/a
- @endif
- </td>
- </tr>
- @endforeach
- </tbody>
- </table>
- </div>
- </div>
- @if (!$loop->last)
- <br>
- <br>
- @endif
- @endforeach
- </div>
- </div>
- @endsection
-
- @section('modals')
- @include('modal.course.edit')
- @include('modal.section.edit')
- @include('modal.section.syllabus')
- @endsection
-
- @section('scripts')
- <script src="/js/course.js"></script>
- @endsection
|