12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- @extends('layouts.app')
-
- @section('title', 'Cursos | Gerencia Docente')
-
- @section('content')
- <div class="mdc-layout-grid__inner">
- <div class="mdc-layout-grid__cell--span-12-desktop">
- <h1>Cursos</h1>
- </div>
- @auth
- <div class="mdc-layout-grid__cell--span-4">
- <button type="button" class="mdc-button mdc-button--outlined" data-toggle="modal" data-target="#modal-course-create">
- <span class="mdc-button__label">Añadir Curso</span>
- </button>
- </div>
- @endauth
- </div>
- @if ($errors->any())
- <div class="mdc-layout-grid__inner">
- <div class="alert alert-danger alert-dismissible fade show mdc-layout-grid__cell mdc-layout-grid__cell--span-12" role="alert">
- <button type="button" class="close" data-dismiss="modal" aria-label="close">
- <span aria-hidden="true">×</span>
- </button>
- <ul class="mdc-list">
- @foreach ($errors->all() as $error)
- <li class="mcd-list-item"><span class="mdc-list-item__text">{{ $error }}</span></li>
- @endforeach
- </ul>
- </div>
- </div>
- @endif
- <hr>
- <div class="mdc-layout-grid__inner">
- <div class="mdc-layout-grid__cell mdc-layout-grid__cell--span-12">
- <div class="mdc-data-table table-fixed-row-head table-fixed-col-head table--fit-screen">
- <table id="course-table" class="mdc-data-table__table">
- <thead>
- <tr class="mdc-data-table__header-row">
- <th class="mdc-data-table__header-cell mdc-elevation--z3" scope="col">Curso</th>
- <th class="mdc-data-table__header-cell mdc-elevation--z2" scope="col" @guest style="display:none;" @endguest>Edit</th>
- <th class="mdc-data-table__header-cell mdc-elevation--z2" scope="col">Title</th>
- <th class="mdc-data-table__header-cell mdc-elevation--z2" scope="col">Prontuario</th>
- @foreach ($semesters as $semester)
- <th class="mdc-data-table__header-cell mdc-elevation--z2" scope="col"># de Secciones<br>{{ $semester->alpha }}</th>
- @endforeach
- </tr>
- </thead>
- <tbody class="mdc-data-table__content">
- @foreach ($courses as $course)
- <tr class="mdc-data-table__row">
- <th scope="row" class="mdc-data-table__cell mdc-elevation--z1">
- <a href="{{ route('course.show', ['id' => $course->id]) }}">{{ $course->code }}</a>
- </th>
- <td class="mdc-data-table__cell" @guest style="display:none;" @endguest>
- <button class="mdc-icon-button material-icons" data-toggle="modal" data-target="#modal-course-edit" data-course-id="{{ $course->id }}">edit</button>
- </td>
- <td class="mdc-data-table__cell" data-toggle="tooltip" title="{{ $course->title }}">{{ substr($course->title, 0, 50) . (strlen($course->title) > 50 ? '...' : '') }}</td>
- <td class="mdc-data-table__cell">
- @if (!is_null($course->syllabus))
- <a href="{{ asset($course->syllabus) }}">PDF</a>
- @else
- @auth
- <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 }}">
- <span class="mdc-button__label">Subir</span>
- </button>
- @else
- n/a
- @endauth
- @endif
- </td>
- @foreach ($semesters as $semester)
- <td class="mdc-data-table__cell mdc-data-table__cell--numeric">
- {{ $course->getSemesterSectionCount($semester->code) }}
- @if (Auth::check() && $semesters->take(-6)->contains($semester->code))
- <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>
- @endif
- </td>
- @endforeach
- </tr>
- @endforeach
- </tbody>
- </table>
- </div>
- </div>
- </div>
- @endsection
-
- @section('modals')
- @include('modal.course.create')
- @include('modal.course.edit')
- @include('modal.course.syllabus')
- @include('modal.section.create')
- @endsection
-
- @section('scripts')
- <script type="text/javascript" src="/js/course.js"></script>
- @endsection
|