Penambahan Akses Laman Dosen dab perbaikan fix
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
{{--
|
||||
Tabel berformat SATU: bilah cari, tabel, keadaan kosong, dan footer ("Halaman x dari y", 10/25 data, pager lima nomor).
|
||||
Slot = <table class="table"> dengan baris di <tbody>; cari dan halaman bekerja di sisi klien (Alpine satuDom) pada baris
|
||||
yang sudah dirender, jadi tabel boleh berada di dalam <form> (Enter pada kolom cari tidak mengirim formulir).
|
||||
Props: label (nama tabel untuk aksesibilitas), placeholder (teks kolom cari), heading (judul panel, opsional), per (data per halaman).
|
||||
Slot bernama "tools" = tombol di kanan bilah cari.
|
||||
--}}
|
||||
@props(['label', 'placeholder' => 'Cari data', 'heading' => null, 'per' => 10])
|
||||
|
||||
@php
|
||||
$uid = 'dt-'.\Illuminate\Support\Str::random(6);
|
||||
@endphp
|
||||
|
||||
<x-glass.panel padding="none" as="section" :aria-label="$label" x-data="satuDom({ per: {{ (int) $per }} })">
|
||||
@if ($heading)
|
||||
<div class="panel__head"><h2 class="panel__title">{{ $heading }}</h2></div>
|
||||
@endif
|
||||
|
||||
<div class="satu-bar">
|
||||
<div class="satu-bar__search field">
|
||||
<label class="visually-hidden" for="{{ $uid }}-q">Cari di {{ \Illuminate\Support\Str::lower($label) }}</label>
|
||||
<div class="field__control">
|
||||
<span class="field__icon" aria-hidden="true"><x-heroicon-o-magnifying-glass /></span>
|
||||
<input id="{{ $uid }}-q" type="search" class="field__input" style="--pad-start: 2.5rem" placeholder="{{ $placeholder }}" autocomplete="off" x-model.debounce.200ms="dtQ" x-on:keydown.enter.prevent>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@isset($tools)
|
||||
<div class="satu-bar__tools">{{ $tools }}</div>
|
||||
@endisset
|
||||
</div>
|
||||
|
||||
<x-ui.table :label="$label">
|
||||
{{ $slot }}
|
||||
</x-ui.table>
|
||||
<p class="satu-empty" x-show="dtTotal === 0 && dtItems.length > 0" x-cloak>Tidak ada data yang cocok dengan pencarian.</p>
|
||||
|
||||
<div class="satu-foot">
|
||||
<p class="satu-foot__info" aria-live="polite">Halaman <span x-text="dtPage">1</span> dari <span x-text="dtPages">1</span> (<span x-text="dtTotal">0</span> data)</p>
|
||||
|
||||
<label class="satu-foot__per">
|
||||
<span class="visually-hidden">Jumlah data per halaman</span>
|
||||
<select class="field__input field__select" data-no-clear x-model.number="dtPer">
|
||||
<option value="10">10 data</option>
|
||||
<option value="25">25 data</option>
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<nav class="satu-pager" aria-label="Halaman data">
|
||||
<button type="button" class="satu-pager__btn" aria-label="Halaman sebelumnya" x-bind:disabled="dtPage === 1" x-on:click="dtGo(dtPage - 1)"><x-heroicon-m-chevron-left /></button>
|
||||
<template x-for="n in dtWindow" x-bind:key="n">
|
||||
<button type="button" class="satu-pager__btn" x-text="n" x-bind:aria-current="n === dtPage ? 'page' : false" x-on:click="dtGo(n)"></button>
|
||||
</template>
|
||||
<button type="button" class="satu-pager__btn" aria-label="Halaman berikutnya" x-bind:disabled="dtPage === dtPages" x-on:click="dtGo(dtPage + 1)"><x-heroicon-m-chevron-right /></button>
|
||||
</nav>
|
||||
</div>
|
||||
</x-glass.panel>
|
||||
@@ -1,4 +1,4 @@
|
||||
{{-- Pemilih peran di bilah atas: menampilkan peran aktif; menu hanya berisi daftar peran milik akun (prototipe: peralihan belum aktif). --}}
|
||||
{{-- Pemilih peran di bilah atas: peran aktif dan daftar peran milik akun. Akun DB lama beralih sungguhan (POST peran.ganti); akun demo masih prototipe. --}}
|
||||
@props(['user'])
|
||||
|
||||
@php
|
||||
@@ -31,6 +31,16 @@
|
||||
<span class="role-switch__item-text">{{ $role->label() }}</span>
|
||||
<x-heroicon-s-check class="role-switch__check" />
|
||||
</span>
|
||||
@elseif ($user instanceof \App\Models\Legacy\Account)
|
||||
{{-- Akun DB lama: peralihan sungguhan; peran baru dipakai setelah halaman dimuat ulang. --}}
|
||||
<form method="POST" action="{{ route('peran.ganti') }}">
|
||||
@csrf
|
||||
<input type="hidden" name="role" value="{{ $role->value }}">
|
||||
<button type="submit" class="role-switch__item" data-no-busy>
|
||||
<x-dynamic-component :component="'heroicon-o-'.$role->roleIcon()" class="role-switch__icon" />
|
||||
<span class="role-switch__item-text">{{ $role->label() }}</span>
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
<button
|
||||
type="button"
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
{{-- Daftar berformat SATU dengan paginasi server (untuk data yang barisnya mahal dihitung): filter, cari, dan halaman lewat GET. --}}
|
||||
@php
|
||||
$query = request()->query('q');
|
||||
$query = is_string($query) ? $query : '';
|
||||
$last = $rows->lastPage();
|
||||
$current = $rows->currentPage();
|
||||
$start = max(1, min($current - 2, $last - 4));
|
||||
$window = range($start, $start + min(5, $last) - 1);
|
||||
$per = $rows->perPage();
|
||||
@endphp
|
||||
|
||||
<x-layouts.app :title="$names['plural']">
|
||||
<x-ui.page-header
|
||||
:title="$names['plural']"
|
||||
:description="$names['description'] ?? null"
|
||||
/>
|
||||
|
||||
{{-- Kontrol memakai atribut form="satu-form" agar tabel (dengan tautan dan formulir aksi) tidak berada di dalam formulir pencarian. --}}
|
||||
<div class="stack" x-data x-on:change="$refs.satuForm.requestSubmit()">
|
||||
<form id="satu-form" x-ref="satuForm" method="GET" action="{{ url()->current() }}" role="search" aria-label="Pencarian dan filter"></form>
|
||||
|
||||
@if ($filters)
|
||||
<x-glass.panel padding="sm" as="section" aria-label="Filter data">
|
||||
<div class="filter-bar">
|
||||
@foreach ($filters as $filter)
|
||||
<x-form.select
|
||||
:name="$filter['name']"
|
||||
:label="$filter['label']"
|
||||
:options="$filter['options']"
|
||||
:value="request($filter['name'])"
|
||||
placeholder=""
|
||||
:id="'filter-'.$filter['name']"
|
||||
form="satu-form"
|
||||
/>
|
||||
@endforeach
|
||||
</div>
|
||||
</x-glass.panel>
|
||||
@endif
|
||||
|
||||
<x-glass.panel padding="none" as="section" :aria-label="'Daftar '.Str::lower($names['plural'])">
|
||||
<div class="satu-bar">
|
||||
@if ($searchable)
|
||||
<div class="satu-bar__search field">
|
||||
<label class="visually-hidden" for="satu-q">Cari data</label>
|
||||
<div class="field__control">
|
||||
<span class="field__icon" aria-hidden="true"><x-heroicon-o-magnifying-glass /></span>
|
||||
<input id="satu-q" type="search" name="q" form="satu-form" value="{{ $query }}" class="field__input" style="--pad-start: 2.5rem" placeholder="Cari {{ Str::lower($names['plural']) }}" autocomplete="off" enterkeyhint="search">
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<x-ui.table :label="'Tabel '.Str::lower($names['plural'])">
|
||||
<table class="table satu-table">
|
||||
<thead>
|
||||
<tr>
|
||||
@foreach ($columns as $col)
|
||||
<th scope="col" @class(['num' => ($col['class'] ?? null) === 'num'])>{{ $col['label'] }}</th>
|
||||
@endforeach
|
||||
<th scope="col" class="table__actions"><span class="visually-hidden">Aksi</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($rows as $row)
|
||||
@php $id = $keyOf($row); @endphp
|
||||
<tr>
|
||||
@foreach ($columns as $col)
|
||||
@php
|
||||
$val = isset($col['value']) ? $col['value']($row) : data_get($row, $col['key']);
|
||||
$tone = isset($col['badge']) ? $col['badge']($row) : null;
|
||||
@endphp
|
||||
<td @class(['num' => ($col['class'] ?? null) === 'num', 'table__title' => $loop->first])>
|
||||
@if ($tone !== null && $val !== null && $val !== '')
|
||||
<x-ui.badge :tone="$tone">{{ $val }}</x-ui.badge>
|
||||
@else
|
||||
{{ $val === null || $val === '' ? '-' : $val }}
|
||||
@endif
|
||||
</td>
|
||||
@endforeach
|
||||
<td class="table__actions">
|
||||
@foreach ($rowActions($row) as $action)
|
||||
<x-ui.button variant="ghost" size="sm" :href="$action['href']" :icon="$action['icon'] ?? null">{{ $action['label'] }}</x-ui.button>
|
||||
@endforeach
|
||||
@if ($abilities['show'])
|
||||
<x-ui.button variant="ghost" size="sm" :href="route($base.'.show', $id)" icon="eye" :icon-only="true" :aria-label="'Lihat '.Str::lower($names['singular'])" />
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@if ($rows->isEmpty())
|
||||
<p class="satu-empty">{{ request()->query() ? 'Tidak ada data yang cocok dengan pencarian atau filter.' : 'Belum ada data '.Str::lower($names['plural']).'.' }}</p>
|
||||
@endif
|
||||
</x-ui.table>
|
||||
|
||||
<div class="satu-foot">
|
||||
<p class="satu-foot__info" aria-live="polite">Halaman {{ $current }} dari {{ $last }} ({{ $rows->total() }} data)</p>
|
||||
|
||||
<label class="satu-foot__per">
|
||||
<span class="visually-hidden">Jumlah data per halaman</span>
|
||||
<select name="per" form="satu-form" class="field__input field__select" data-no-clear>
|
||||
<option value="10" @selected($per === 10)>10 data</option>
|
||||
<option value="25" @selected($per === 25)>25 data</option>
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<nav class="satu-pager" aria-label="Halaman data">
|
||||
@if ($current > 1)
|
||||
<a class="satu-pager__btn" href="{{ $rows->url($current - 1) }}" aria-label="Halaman sebelumnya"><x-heroicon-m-chevron-left /></a>
|
||||
@else
|
||||
<span class="satu-pager__btn" aria-hidden="true" style="opacity: 0.4"><x-heroicon-m-chevron-left /></span>
|
||||
@endif
|
||||
@foreach ($window as $n)
|
||||
<a class="satu-pager__btn" href="{{ $rows->url($n) }}" @if ($n === $current) aria-current="page" @endif>{{ $n }}</a>
|
||||
@endforeach
|
||||
@if ($current < $last)
|
||||
<a class="satu-pager__btn" href="{{ $rows->url($current + 1) }}" aria-label="Halaman berikutnya"><x-heroicon-m-chevron-right /></a>
|
||||
@else
|
||||
<span class="satu-pager__btn" aria-hidden="true" style="opacity: 0.4"><x-heroicon-m-chevron-right /></span>
|
||||
@endif
|
||||
</nav>
|
||||
</div>
|
||||
</x-glass.panel>
|
||||
</div>
|
||||
</x-layouts.app>
|
||||
@@ -0,0 +1,58 @@
|
||||
{{-- Detail mahasiswa bimbingan akademik dari DB lama. --}}
|
||||
@php
|
||||
$badge = match ($mhs['status']) { 'Aktif' => 'success', 'Lulus' => 'accent', default => 'danger' };
|
||||
@endphp
|
||||
|
||||
<x-layouts.app :title="$mhs['nama']">
|
||||
<x-ui.page-header
|
||||
:title="$mhs['nama']"
|
||||
:description="$mhs['nim'].', '.$mhs['prodi'].($mhs['angkatan'] ? ', angkatan '.$mhs['angkatan'] : '')"
|
||||
:breadcrumbs="['Mahasiswa bimbingan' => route('dosen.bimbingan.index'), $mhs['nama'] => null]"
|
||||
>
|
||||
<x-slot:actions>
|
||||
<x-ui.button variant="secondary" :href="route('dosen.bimbingan.index')" icon="arrow-left">Kembali</x-ui.button>
|
||||
<x-ui.badge :tone="$badge">{{ $mhs['status'] }}</x-ui.badge>
|
||||
</x-slot:actions>
|
||||
</x-ui.page-header>
|
||||
|
||||
<div class="stack">
|
||||
<x-ui.stats>
|
||||
<x-ui.stat label="IPK" :value="$mhs['ipk'] === null ? '-' : number_format($mhs['ipk'], 2, ',', '.')" icon="academic-cap" />
|
||||
<x-ui.stat label="SKS ditempuh" :value="$mhs['sks']" icon="book-open" />
|
||||
<x-ui.stat label="Semester ditempuh" :value="count($ips)" icon="calendar-days" />
|
||||
</x-ui.stats>
|
||||
|
||||
<div class="split split--even">
|
||||
@if (count($ips) > 0)
|
||||
<x-ui.chart
|
||||
title="Indeks prestasi per semester"
|
||||
type="line"
|
||||
:labels="$labels"
|
||||
:datasets="[['label' => 'IPS', 'data' => $ips]]"
|
||||
/>
|
||||
@endif
|
||||
|
||||
<x-glass.panel padding="lg" class="grid gap-3">
|
||||
<h2 class="text-title">Data akademik</h2>
|
||||
<dl class="ledger">
|
||||
<div class="ledger__row"><dt>NIM</dt><dd>{{ $mhs['nim'] }}</dd></div>
|
||||
<div class="ledger__row"><dt>Program studi</dt><dd>{{ $mhs['prodi'] }}</dd></div>
|
||||
<div class="ledger__row"><dt>Angkatan</dt><dd>{{ $mhs['angkatan'] ?? '-' }}</dd></div>
|
||||
</dl>
|
||||
</x-glass.panel>
|
||||
</div>
|
||||
|
||||
@if ($krs)
|
||||
<x-glass.panel padding="lg" class="grid gap-3">
|
||||
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||
<h2 class="text-title">KRS semester {{ $krs['periode'] }}</h2>
|
||||
<x-ui.badge :tone="$krs['tone']">{{ $krs['status'] }}</x-ui.badge>
|
||||
</div>
|
||||
<p class="text-ink-2">{{ $krs['sks_diambil'] }} SKS diambil pada {{ $krs['mata_kuliah'] }} mata kuliah.</p>
|
||||
<div>
|
||||
<x-ui.button variant="secondary" size="sm" :href="route('dosen.persetujuan-krs.show', $krs['id'])" icon="document-check">Buka KRS</x-ui.button>
|
||||
</div>
|
||||
</x-glass.panel>
|
||||
@endif
|
||||
</div>
|
||||
</x-layouts.app>
|
||||
@@ -7,7 +7,7 @@
|
||||
/>
|
||||
|
||||
<x-ui.stats>
|
||||
<x-ui.stat label="Kelas diampu" :value="$jumlahKelas" icon="rectangle-stack" hint="Semester berjalan" :href="route('dosen.kelas.index')" />
|
||||
<x-ui.stat label="Kelas diampu" :value="$jumlahKelas" icon="rectangle-stack" :hint="$periodeLabel ?? 'Semester berjalan'" :href="route('dosen.kelas.index')" />
|
||||
<x-ui.stat label="Mahasiswa diajar" :value="$jumlahMahasiswa" icon="users" hint="Seluruh kelas Anda" :href="route('dosen.presensi')" />
|
||||
<x-ui.stat label="Mahasiswa bimbingan" :value="$jumlahBimbingan" icon="user-group" hint="Bimbingan akademik" :href="route('dosen.bimbingan.index')" />
|
||||
<x-ui.stat label="KRS menunggu" :value="$krsMenunggu" icon="clipboard-document-list" hint="Perlu persetujuan Anda" :href="route('dosen.persetujuan-krs.index', ['status' => 'Menunggu persetujuan'])" />
|
||||
@@ -49,21 +49,27 @@
|
||||
</x-glass.panel>
|
||||
</div>
|
||||
|
||||
<div class="split--even split">
|
||||
<x-ui.chart
|
||||
title="Kehadiran per kelas"
|
||||
description="Persentase kehadiran mahasiswa pada pertemuan yang sudah berlangsung."
|
||||
type="bar"
|
||||
:labels="$kehadiranLabels"
|
||||
:datasets="[['label' => 'Kehadiran (%)', 'data' => $kehadiranData]]"
|
||||
/>
|
||||
<x-ui.chart
|
||||
title="Sebaran nilai sementara"
|
||||
description="Rata-rata tugas dan UTS pada kelas Kecerdasan Buatan."
|
||||
type="doughnut"
|
||||
:labels="array_keys($distribusi)"
|
||||
:datasets="[['label' => 'Mahasiswa', 'data' => array_values($distribusi)]]"
|
||||
/>
|
||||
</div>
|
||||
@if (count($kehadiranLabels) > 0 || count($distribusi) > 0)
|
||||
<div class="split--even split">
|
||||
@if (count($kehadiranLabels) > 0)
|
||||
<x-ui.chart
|
||||
title="Kehadiran per kelas"
|
||||
:description="$periodeLabel ? 'Persentase kehadiran mahasiswa per kelas semester '.$periodeLabel.' (presensi yang sudah diisi).' : 'Persentase kehadiran mahasiswa pada pertemuan yang sudah berlangsung.'"
|
||||
type="bar"
|
||||
:labels="$kehadiranLabels"
|
||||
:datasets="[['label' => 'Kehadiran (%)', 'data' => $kehadiranData]]"
|
||||
/>
|
||||
@endif
|
||||
@if (count($distribusi) > 0)
|
||||
<x-ui.chart
|
||||
:title="$periodeLabel ? 'Sebaran nilai' : 'Sebaran nilai sementara'"
|
||||
:description="$periodeLabel ? 'Huruf nilai peserta seluruh kelas Anda semester '.$periodeLabel.' yang sudah dinilai.' : 'Rata-rata tugas dan UTS pada kelas Kecerdasan Buatan.'"
|
||||
type="doughnut"
|
||||
:labels="array_keys($distribusi)"
|
||||
:datasets="[['label' => 'Mahasiswa', 'data' => array_values($distribusi)]]"
|
||||
/>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</x-layouts.app>
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
{{-- Jadwal mengajar asli dari DB lama (LecturerClasses::classes). --}}
|
||||
<x-layouts.app title="Jadwal mengajar">
|
||||
<x-ui.page-header
|
||||
title="Jadwal mengajar"
|
||||
:description="$periode ? 'Jadwal kuliah Anda pada semester '.$periode['label'].'.' : 'Jadwal kuliah Anda.'"
|
||||
>
|
||||
@if ($kelas->isNotEmpty())
|
||||
<x-slot:actions>
|
||||
<x-ui.badge tone="accent">{{ $kelas->count() }} kelas</x-ui.badge>
|
||||
<x-ui.badge tone="gold">{{ $totalSks }} SKS</x-ui.badge>
|
||||
</x-slot:actions>
|
||||
@endif
|
||||
</x-ui.page-header>
|
||||
|
||||
@if ($kelas->isEmpty())
|
||||
<x-glass.panel padding="lg">
|
||||
<x-ui.empty icon="calendar-days" title="Belum ada kelas yang diampu" description="Jadwal tampil setelah Anda ditugaskan sebagai pengajar pada sebuah kelas." />
|
||||
</x-glass.panel>
|
||||
@else
|
||||
<div class="stack">
|
||||
<div class="week">
|
||||
@foreach ($hari as $nama)
|
||||
<x-glass.panel class="week__day">
|
||||
<div class="flex items-center justify-between gap-2">
|
||||
<span class="week__name">{{ $nama }}</span>
|
||||
@if ($nama === $hariIni) <x-ui.badge tone="accent">Hari ini</x-ui.badge> @endif
|
||||
</div>
|
||||
@forelse ($perHari->get($nama, collect()) as $slot)
|
||||
<a class="slot no-underline" href="{{ route('dosen.kelas.show', $slot['kelas']['id']) }}">
|
||||
<span class="slot__time">{{ $slot['jam'] }}</span>
|
||||
<span class="slot__name">{{ $slot['kelas']['matkul'] }} ({{ $slot['kelas']['kelas'] }})</span>
|
||||
<span class="slot__meta">{{ $slot['ruang'] ?? 'Ruang belum ditetapkan' }}, {{ $slot['kelas']['sks'] }} SKS, {{ $slot['kelas']['peserta'] }} mahasiswa</span>
|
||||
</a>
|
||||
@empty
|
||||
<p class="text-sm text-muted">Tidak ada kelas.</p>
|
||||
@endforelse
|
||||
</x-glass.panel>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
<x-satu.datatable label="Daftar kelas yang diampu" placeholder="Cari kelas">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Kode</th>
|
||||
<th scope="col">Mata kuliah</th>
|
||||
<th scope="col">Hari dan jam</th>
|
||||
<th scope="col">Ruang</th>
|
||||
<th scope="col" class="num">SKS</th>
|
||||
<th scope="col" class="num">Peserta</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($kelas as $k)
|
||||
<tr>
|
||||
<td class="table__title"><a href="{{ route('dosen.kelas.show', $k['id']) }}">{{ $k['kode'] }}</a></td>
|
||||
<td>{{ $k['matkul'] }} ({{ $k['kelas'] }})</td>
|
||||
<td>{{ $k['jadwal'] }}</td>
|
||||
<td>{{ $k['ruang'] }}</td>
|
||||
<td class="num">{{ $k['sks'] }}</td>
|
||||
<td class="num">{{ $k['peserta'] }}@if ($k['kapasitas']) / {{ $k['kapasitas'] }}@endif</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</x-satu.datatable>
|
||||
</div>
|
||||
@endif
|
||||
</x-layouts.app>
|
||||
@@ -0,0 +1,67 @@
|
||||
{{-- Detail kelas asli dari DB lama: peserta (KRS disetujui) dengan komponen nilai. --}}
|
||||
@php
|
||||
$judul = "{$kelas['matkul']} ({$kelas['kelas']})";
|
||||
$angka = fn (?float $n): string => $n === null ? '-' : number_format($n, fmod($n, 1.0) === 0.0 ? 0 : 2, ',', '.');
|
||||
@endphp
|
||||
|
||||
<x-layouts.app :title="$judul">
|
||||
<x-ui.page-header
|
||||
:title="$judul"
|
||||
:description="$kelas['kode'].', '.$kelas['sks'].' SKS, '.$kelas['jadwal'].', ruang '.$kelas['ruang']"
|
||||
:breadcrumbs="['Kelas saya' => route('dosen.kelas.index'), $judul => null]"
|
||||
>
|
||||
<x-slot:actions>
|
||||
<x-ui.button variant="secondary" :href="route('dosen.presensi', ['kelas' => $kelas['id']])" icon="clipboard-document-check">Presensi</x-ui.button>
|
||||
<x-ui.button :href="route('dosen.penilaian', ['kelas' => $kelas['id']])" icon="pencil-square">Input nilai</x-ui.button>
|
||||
</x-slot:actions>
|
||||
</x-ui.page-header>
|
||||
|
||||
<div class="stack">
|
||||
<x-ui.stats>
|
||||
<x-ui.stat label="Peserta terdaftar" :value="$kelas['peserta']" icon="users" :hint="$kelas['kapasitas'] ? 'Kapasitas '.$kelas['kapasitas'] : 'Kapasitas tidak dibatasi'" />
|
||||
<x-ui.stat label="Jumlah pertemuan" :value="$kelas['pertemuan'] ?? '-'" icon="calendar-days" />
|
||||
<x-ui.stat label="Rata-rata kehadiran" :value="$rataHadir === null ? '-' : $rataHadir.'%'" icon="clipboard-document-check" :hint="'Batas minimal '.$batas.'%'" />
|
||||
</x-ui.stats>
|
||||
|
||||
@if ($kelas['dikunci'])
|
||||
<x-ui.alert tone="info" title="Nilai sudah dikunci">Nilai kelas ini sudah diterbitkan ke mahasiswa dan tidak dapat diubah dari sini.</x-ui.alert>
|
||||
@endif
|
||||
|
||||
<x-satu.datatable label="Daftar peserta kelas" placeholder="Cari NIM atau nama">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">NIM</th>
|
||||
<th scope="col">Nama</th>
|
||||
<th scope="col" class="num">Hadir</th>
|
||||
<th scope="col" class="num">Tugas</th>
|
||||
<th scope="col" class="num">UTS</th>
|
||||
<th scope="col" class="num">UAS</th>
|
||||
<th scope="col">Nilai</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse ($peserta as $p)
|
||||
<tr>
|
||||
<td class="table__title">{{ $p['nim'] }}</td>
|
||||
<td>{{ $p['nama'] }}</td>
|
||||
<td class="num">{{ $p['hadir'] ?? '-' }}@if ($kelas['pertemuan'] && $p['hadir'] !== null) / {{ $kelas['pertemuan'] }}@endif</td>
|
||||
<td class="num">{{ $angka($p['tugas']) }}</td>
|
||||
<td class="num">{{ $angka($p['uts']) }}</td>
|
||||
<td class="num">{{ $angka($p['uas']) }}</td>
|
||||
<td>
|
||||
@if ($p['huruf'])
|
||||
<x-ui.badge tone="accent">{{ $p['huruf'] }}</x-ui.badge>
|
||||
@else
|
||||
<span class="text-muted">-</span>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr><td colspan="7"><x-ui.empty icon="users" title="Belum ada peserta" description="Peserta tampil setelah KRS mahasiswa disetujui dosen pembimbing akademik." /></td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</x-satu.datatable>
|
||||
</div>
|
||||
</x-layouts.app>
|
||||
@@ -0,0 +1,206 @@
|
||||
{{-- Penilaian asli: tugas, UTS, UAS per peserta (t_kst). Nilai akhir = kehadiran + komponen berbobot kelas. --}}
|
||||
@php
|
||||
$kelasOpsi = $daftar->mapWithKeys(fn (array $k): array => [$k['id'] => $k['label']])->all();
|
||||
$angka = fn (?float $n): string => $n === null ? '' : (string) $n;
|
||||
$awal = $rows->map(fn (array $r): array => [
|
||||
'idkst' => $r['idkst'],
|
||||
'hadir' => $r['hadir'],
|
||||
'tugas' => old('nilai.'.$r['idkst'].'.tugas', $angka($r['tugas'])),
|
||||
'uts' => old('nilai.'.$r['idkst'].'.uts', $angka($r['uts'])),
|
||||
'uas' => old('nilai.'.$r['idkst'].'.uas', $angka($r['uas'])),
|
||||
])->values()->all();
|
||||
$window = $kelas['jendela_nilai'] ?? null;
|
||||
$tanggal = fn ($d): string => $d->locale('id')->isoFormat('D MMM YYYY');
|
||||
@endphp
|
||||
|
||||
<x-layouts.app title="Penilaian">
|
||||
<x-ui.page-header
|
||||
title="Penilaian"
|
||||
:description="$kelas
|
||||
? 'Masukkan nilai tugas, UTS, dan UAS. Nilai akhir dihitung otomatis: kehadiran '.$kelas['bobot']['kehadiran'].'%, tugas '.$kelas['bobot']['tugas'].'%, UTS '.$kelas['bobot']['uts'].'%, UAS '.$kelas['bobot']['uas'].'%.'
|
||||
: 'Masukkan nilai tugas, UTS, dan UAS.'"
|
||||
/>
|
||||
|
||||
@if (! $kelas)
|
||||
<x-glass.panel padding="lg">
|
||||
<x-ui.empty icon="pencil-square" title="Belum ada kelas yang diampu" description="Penilaian tersedia setelah Anda ditugaskan sebagai pengajar pada sebuah kelas." />
|
||||
</x-glass.panel>
|
||||
@else
|
||||
<div class="stack">
|
||||
<x-glass.panel padding="sm">
|
||||
<form method="GET" action="{{ route('dosen.penilaian') }}" class="filter-bar" x-data x-on:change="$el.requestSubmit()" role="search" aria-label="Pilih kelas">
|
||||
<x-form.select name="kelas" label="Kelas" :options="$kelasOpsi" :value="$kelas['id']" id="pilih-kelas" />
|
||||
</form>
|
||||
</x-glass.panel>
|
||||
|
||||
@error('nilai_aksi')
|
||||
<x-ui.alert tone="danger" title="Tidak dapat diproses">{{ $message }}</x-ui.alert>
|
||||
@enderror
|
||||
@if (collect($errors->keys())->contains(fn ($key) => str_starts_with($key, 'nilai.')))
|
||||
<x-ui.alert tone="danger" title="Nilai belum dapat dikirim">Pastikan setiap nilai berupa angka 0 sampai 100.</x-ui.alert>
|
||||
@endif
|
||||
|
||||
@if ($kelas['dikunci'])
|
||||
<x-ui.alert tone="info" title="Nilai sudah dikunci">Nilai kelas ini sudah diterbitkan ke mahasiswa dan hanya dapat dilihat.</x-ui.alert>
|
||||
@elseif (! $bisaUbah)
|
||||
<x-ui.alert tone="warning" title="Masa penilaian ditutup">
|
||||
@if ($window)
|
||||
Masa penilaian program studi untuk kelas ini {{ $tanggal($window['mulai']) }} sampai {{ $tanggal($window['akhir']) }}. Nilai hanya dapat dilihat.
|
||||
@else
|
||||
Program studi belum membuka masa penilaian untuk periode ini. Nilai hanya dapat dilihat.
|
||||
@endif
|
||||
</x-ui.alert>
|
||||
@elseif ($kelas['pertemuan'] === null)
|
||||
<x-ui.alert tone="warning" title="Jumlah pertemuan belum ditetapkan">Nilai akhir baru dapat dihitung setelah jumlah pertemuan kelas ditetapkan di bagian Pengaturan penilaian dan presensi diisi.</x-ui.alert>
|
||||
@endif
|
||||
|
||||
@error('pengaturan_aksi')
|
||||
<x-ui.alert tone="danger" title="Pengaturan tidak dapat disimpan">{{ $message }}</x-ui.alert>
|
||||
@enderror
|
||||
|
||||
@unless ($kelas['dikunci'])
|
||||
<x-glass.panel as="section" padding="lg" aria-labelledby="judul-pengaturan">
|
||||
<div class="panel-title"><h2 id="judul-pengaturan">Pengaturan penilaian</h2></div>
|
||||
<form method="POST" action="{{ route('dosen.penilaian.pengaturan', $kelas['id']) }}" novalidate>
|
||||
@csrf
|
||||
<x-form.section title="Pertemuan dan bobot" description="Total bobot harus 100%. Mengubah bobot menghitung ulang nilai yang sudah lengkap." :columns="3">
|
||||
<x-form.field name="pertemuan" label="Jumlah pertemuan" type="number" min="1" max="40" :value="$kelas['pertemuan']" required />
|
||||
@foreach (['kehadiran' => 'kehadiran', 'tugas' => 'tugas', 'uts' => 'UTS', 'uas' => 'UAS'] as $key => $nama)
|
||||
<x-form.field
|
||||
:name="'bobot['.$key.']'"
|
||||
:id="'bobot-'.$key"
|
||||
:label="'Bobot '.$nama.' (%)'"
|
||||
type="number" min="0" max="100"
|
||||
:value="old('bobot.'.$key, $kelas['bobot'][$key])"
|
||||
:error="$errors->first('bobot.'.$key)"
|
||||
required
|
||||
/>
|
||||
@endforeach
|
||||
</x-form.section>
|
||||
<x-form.actions>
|
||||
<x-ui.button type="submit" variant="secondary" icon="check">Simpan pengaturan</x-ui.button>
|
||||
</x-form.actions>
|
||||
</form>
|
||||
</x-glass.panel>
|
||||
@endunless
|
||||
|
||||
<script>
|
||||
document.addEventListener('alpine:init', () => {
|
||||
Alpine.data('penilaianLegacy', (rows, bobot, pertemuan, skala) => ({
|
||||
rows, bobot, pertemuan, skala,
|
||||
num(v) { const n = parseFloat(v); return Number.isFinite(n) ? n : null; },
|
||||
akhir(r) {
|
||||
const t = this.num(r.tugas), u = this.num(r.uts), a = this.num(r.uas);
|
||||
if (t === null || u === null || a === null || r.hadir === null || ! this.pertemuan) return null;
|
||||
const hadir = Math.min(r.hadir / this.pertemuan * 100, 100);
|
||||
return Math.round((hadir * this.bobot.kehadiran + t * this.bobot.tugas + u * this.bobot.uts + a * this.bobot.uas) / 100 * 1000) / 1000;
|
||||
},
|
||||
rentang(r) { const v = this.akhir(r); return v === null ? null : (this.skala.find((s) => v >= s.dari) ?? null); },
|
||||
huruf(r) { return this.rentang(r)?.huruf ?? '-'; },
|
||||
bobotNilai(r) { const s = this.rentang(r); return s ? s.mutu.toFixed(2).replace('.', ',') : '-'; },
|
||||
tampil(v) { return v === null ? '-' : String(v).replace('.', ','); },
|
||||
get lengkap() { return this.rows.filter((r) => this.akhir(r) !== null).length; },
|
||||
}));
|
||||
});
|
||||
</script>
|
||||
|
||||
<form
|
||||
method="POST"
|
||||
action="{{ route('dosen.penilaian.store') }}"
|
||||
class="stack"
|
||||
novalidate
|
||||
x-data="penilaianLegacy(@js($awal), @js($kelas['bobot']), @js($kelas['pertemuan']), @js($skala))"
|
||||
>
|
||||
@csrf
|
||||
<input type="hidden" name="kelas" value="{{ $kelas['id'] }}">
|
||||
|
||||
<x-glass.panel padding="none">
|
||||
<div class="flex flex-wrap items-center justify-between gap-3 p-4">
|
||||
<div class="grid gap-1">
|
||||
<h2 class="text-title">{{ $kelas['matkul'] }} ({{ $kelas['kelas'] }})</h2>
|
||||
<span class="text-sm text-muted">{{ $kelas['kode'] }}, {{ $kelas['sks'] }} SKS, {{ $kelas['jadwal'] }}</span>
|
||||
</div>
|
||||
<x-ui.badge tone="gold"><span x-text="lengkap">0</span> dari {{ $rows->count() }} nilai lengkap</x-ui.badge>
|
||||
</div>
|
||||
</x-glass.panel>
|
||||
|
||||
<x-satu.datatable label="Input nilai peserta" placeholder="Cari NIM atau nama">
|
||||
<table class="table table--compact">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">NIM</th>
|
||||
<th scope="col">Nama</th>
|
||||
<th scope="col" class="num">Hadir</th>
|
||||
<th scope="col" class="num">Tugas ({{ $kelas['bobot']['tugas'] }}%)</th>
|
||||
<th scope="col" class="num">UTS ({{ $kelas['bobot']['uts'] }}%)</th>
|
||||
<th scope="col" class="num">UAS ({{ $kelas['bobot']['uas'] }}%)</th>
|
||||
<th scope="col" class="num">Akhir</th>
|
||||
<th scope="col">Huruf</th>
|
||||
<th scope="col" class="num">Bobot</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse ($rows as $i => $r)
|
||||
<tr>
|
||||
<td class="table__title">{{ $r['nim'] }}</td>
|
||||
<td>{{ $r['nama'] }}</td>
|
||||
<td class="num">{{ $r['hadir'] ?? '-' }}@if ($kelas['pertemuan'] && $r['hadir'] !== null) / {{ $kelas['pertemuan'] }}@endif</td>
|
||||
@foreach (['tugas', 'uts', 'uas'] as $komponen)
|
||||
<td class="num">
|
||||
<label class="visually-hidden" for="n-{{ $r['idkst'] }}-{{ $komponen }}">Nilai {{ $komponen }} {{ $r['nama'] }}</label>
|
||||
<input
|
||||
type="number"
|
||||
id="n-{{ $r['idkst'] }}-{{ $komponen }}"
|
||||
name="nilai[{{ $r['idkst'] }}][{{ $komponen }}]"
|
||||
min="0"
|
||||
max="100"
|
||||
step="0.01"
|
||||
inputmode="decimal"
|
||||
class="field__input"
|
||||
style="min-width: 5.5rem; text-align: end"
|
||||
x-model="rows[{{ $i }}].{{ $komponen }}"
|
||||
@disabled(! $bisaUbah)
|
||||
@error('nilai.'.$r['idkst'].'.'.$komponen) aria-invalid="true" @enderror
|
||||
>
|
||||
</td>
|
||||
@endforeach
|
||||
<td class="num"><span x-text="tampil(akhir(rows[{{ $i }}]))">{{ $r['total'] === null ? '-' : number_format($r['total'], 2, ',', '.') }}</span></td>
|
||||
<td><x-ui.badge tone="accent"><span x-text="huruf(rows[{{ $i }}])">{{ $r['huruf'] ?? '-' }}</span></x-ui.badge></td>
|
||||
<td class="num"><span x-text="bobotNilai(rows[{{ $i }}])">{{ $r['mutu'] === null ? '-' : number_format($r['mutu'], 2, ',', '.') }}</span></td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr><td colspan="9"><x-ui.empty icon="users" title="Belum ada peserta" description="Peserta tampil setelah KRS mahasiswa disetujui dosen pembimbing akademik." /></td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</x-satu.datatable>
|
||||
|
||||
@if ($bisaUbah && $rows->isNotEmpty())
|
||||
<x-form.actions>
|
||||
<x-ui.button type="submit" variant="secondary" icon="check">Simpan nilai</x-ui.button>
|
||||
</x-form.actions>
|
||||
@endif
|
||||
</form>
|
||||
|
||||
@if ($bisaUbah && $rows->isNotEmpty())
|
||||
<x-glass.panel padding="lg" class="grid gap-3">
|
||||
<h2 class="text-title">Kunci nilai</h2>
|
||||
<p class="text-ink-2">Setelah dikunci, nilai diterbitkan ke mahasiswa dan masuk transkrip. Kunci hanya dapat dilakukan bila nilai seluruh peserta lengkap, jadi simpan nilai terlebih dahulu.</p>
|
||||
<div>
|
||||
<x-ui.confirm
|
||||
:action="route('dosen.penilaian.kunci', $kelas['id'])"
|
||||
title="Kunci nilai kelas ini?"
|
||||
message="Nilai yang dikunci diterbitkan ke mahasiswa dan tidak dapat diubah lagi oleh dosen."
|
||||
confirm-label="Ya, kunci nilai"
|
||||
trigger-label="Kunci nilai"
|
||||
variant="secondary"
|
||||
icon="check-circle"
|
||||
/>
|
||||
</div>
|
||||
</x-glass.panel>
|
||||
@endif
|
||||
|
||||
<p class="text-sm text-muted">Huruf dan bobot memakai skala nilai yang paling umum di DB akademik ({{ collect($skala)->take(7)->map(fn (array $s): string => $s['huruf'].' mulai '.rtrim(rtrim(number_format($s['dari'], 2, ',', ''), '0'), ',')) ->implode(', ') }}). Presensi diisi di menu Presensi.</p>
|
||||
</div>
|
||||
@endif
|
||||
</x-layouts.app>
|
||||
@@ -0,0 +1,104 @@
|
||||
{{-- KRS mahasiswa bimbingan dari DB lama; setujui = stat 0 menjadi 1, kembalikan = hapus lewat f_hapuslirs. --}}
|
||||
@php
|
||||
$menunggu = $krs['status'] === 'Menunggu persetujuan';
|
||||
$judul = 'KRS '.$krs['nama'];
|
||||
$tanggal = $krs['diajukan'] ? \App\Support\Prototype\DosenData::tanggal($krs['diajukan']) : null;
|
||||
@endphp
|
||||
|
||||
<x-layouts.app :title="$judul">
|
||||
<x-ui.page-header
|
||||
:title="$judul"
|
||||
:description="$krs['nim'].', semester '.($krs['semester_ke'] ?? '-').' ('.$krs['periode'].')'.($tanggal ? ', diajukan '.$tanggal : '')"
|
||||
:breadcrumbs="['Persetujuan KRS' => route('dosen.persetujuan-krs.index'), $judul => null]"
|
||||
>
|
||||
<x-slot:actions>
|
||||
<x-ui.button variant="secondary" :href="route('dosen.persetujuan-krs.index')" icon="arrow-left">Kembali</x-ui.button>
|
||||
<x-ui.badge :tone="$krs['tone']">{{ $krs['status'] }}</x-ui.badge>
|
||||
</x-slot:actions>
|
||||
</x-ui.page-header>
|
||||
|
||||
<div class="stack">
|
||||
<x-ui.stats>
|
||||
<x-ui.stat label="SKS diambil" :value="$krs['sks_diambil']" icon="book-open" :hint="$krs['maks_sks'] ? 'Maksimal '.$krs['maks_sks'].' SKS' : 'Batas SKS belum ditentukan'" />
|
||||
<x-ui.stat label="Mata kuliah" :value="$krs['items']->count()" icon="rectangle-stack" />
|
||||
<x-ui.stat label="IPK" :value="$krs['ipk'] === null ? '-' : number_format($krs['ipk'], 2, ',', '.')" icon="academic-cap" />
|
||||
</x-ui.stats>
|
||||
|
||||
<x-glass.panel padding="none">
|
||||
<x-ui.table label="Mata kuliah dalam KRS">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Kode</th>
|
||||
<th scope="col">Mata kuliah</th>
|
||||
<th scope="col">Jadwal</th>
|
||||
<th scope="col" class="num">SKS</th>
|
||||
<th scope="col">Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($krs['items'] as $k)
|
||||
<tr>
|
||||
<td class="table__title">{{ $k['kode'] }}</td>
|
||||
<td>{{ $k['matkul'] }} ({{ $k['kelas'] }})</td>
|
||||
<td>{{ $k['jadwal'] }}</td>
|
||||
<td class="num">{{ $k['sks'] }}</td>
|
||||
<td>
|
||||
@if ($k['menunggu'])
|
||||
<x-ui.badge tone="gold" icon="clock">Menunggu</x-ui.badge>
|
||||
@else
|
||||
<x-ui.badge tone="success" icon="check-circle">Disetujui</x-ui.badge>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th scope="row" colspan="3">Total SKS</th>
|
||||
<td class="num">{{ $krs['sks_diambil'] }}</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</x-ui.table>
|
||||
</x-glass.panel>
|
||||
|
||||
@if ($menunggu)
|
||||
<div class="split split--even">
|
||||
<x-glass.panel padding="lg" class="grid gap-3">
|
||||
<h2 class="text-title">Setujui KRS</h2>
|
||||
<p class="text-ink-2">Pastikan beban studi dan mata kuliah sesuai dengan rencana studi mahasiswa.</p>
|
||||
<div>
|
||||
<x-ui.confirm
|
||||
:action="route('dosen.persetujuan-krs.setujui', $krs['id'])"
|
||||
title="Setujui KRS ini?"
|
||||
:message="'KRS '.$krs['nama'].' dengan '.$krs['sks_diambil'].' SKS akan disetujui.'"
|
||||
confirm-label="Ya, setujui"
|
||||
trigger-label="Setujui KRS"
|
||||
variant="secondary"
|
||||
icon="check-circle"
|
||||
/>
|
||||
</div>
|
||||
</x-glass.panel>
|
||||
|
||||
<x-glass.panel padding="lg" class="grid gap-3">
|
||||
<h2 class="text-title">Kembalikan KRS</h2>
|
||||
<p class="text-ink-2">Mata kuliah yang masih menunggu dihapus dari KRS supaya mahasiswa dapat mengisinya ulang selama masa pengisian. DB akademik tidak menyimpan catatan penolakan, jadi sampaikan alasannya langsung kepada mahasiswa.</p>
|
||||
<div>
|
||||
<x-ui.confirm
|
||||
:action="route('dosen.persetujuan-krs.tolak', $krs['id'])"
|
||||
title="Kembalikan KRS ini?"
|
||||
:message="'Mata kuliah KRS '.$krs['nama'].' yang menunggu persetujuan akan dihapus.'"
|
||||
confirm-label="Ya, kembalikan"
|
||||
trigger-label="Kembalikan KRS"
|
||||
variant="secondary"
|
||||
tone="danger"
|
||||
icon="x-circle"
|
||||
/>
|
||||
</div>
|
||||
</x-glass.panel>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</x-layouts.app>
|
||||
@@ -0,0 +1,120 @@
|
||||
{{-- Rekap kehadiran asli: jumlah pertemuan hadir per peserta (t_kst.absen) terhadap t_jadwal.jmlpertemuan. --}}
|
||||
@php
|
||||
$kelasOpsi = $daftar->mapWithKeys(fn (array $k): array => [$k['id'] => $k['label']])->all();
|
||||
$total = $kelas['pertemuan'] ?? null;
|
||||
$awal = $kelas ? $peserta->mapWithKeys(fn (array $p): array => [$p['idkst'] => old('hadir.'.$p['idkst'], $p['hadir'])])->all() : [];
|
||||
@endphp
|
||||
|
||||
<x-layouts.app title="Presensi">
|
||||
<x-ui.page-header
|
||||
title="Presensi"
|
||||
:description="$periode ? 'Catat jumlah pertemuan hadir setiap mahasiswa semester '.$periode['label'].'.' : 'Catat kehadiran mahasiswa.'"
|
||||
/>
|
||||
|
||||
@if (! $kelas)
|
||||
<x-glass.panel padding="lg">
|
||||
<x-ui.empty icon="clipboard-document-check" title="Belum ada kelas yang diampu" description="Presensi tersedia setelah Anda ditugaskan sebagai pengajar pada sebuah kelas." />
|
||||
</x-glass.panel>
|
||||
@else
|
||||
<div class="stack">
|
||||
<x-glass.panel padding="sm">
|
||||
<form method="GET" action="{{ route('dosen.presensi') }}" class="filter-bar" x-data x-on:change="$el.requestSubmit()" role="search" aria-label="Pilih kelas">
|
||||
<x-form.select name="kelas" label="Kelas" :options="$kelasOpsi" :value="$kelas['id']" id="pilih-kelas" />
|
||||
</form>
|
||||
</x-glass.panel>
|
||||
|
||||
@error('presensi')
|
||||
<x-ui.alert tone="danger" title="Presensi tidak dapat disimpan">{{ $message }}</x-ui.alert>
|
||||
@enderror
|
||||
@if ($errors->has('hadir.*') || collect($errors->keys())->contains(fn ($k) => str_starts_with($k, 'hadir')))
|
||||
<x-ui.alert tone="danger" title="Presensi belum dapat dikirim">Jumlah hadir harus berupa bilangan bulat 0 sampai {{ $total }}.</x-ui.alert>
|
||||
@endif
|
||||
|
||||
@if ($kelas['dikunci'])
|
||||
<x-ui.alert tone="info" title="Nilai sudah dikunci">Presensi kelas ini hanya dapat dilihat.</x-ui.alert>
|
||||
@elseif ($total === null)
|
||||
<x-ui.alert tone="warning" title="Jumlah pertemuan belum ditetapkan">
|
||||
Presensi belum dapat diisi sebelum jumlah pertemuan kelas ditetapkan.
|
||||
<a href="{{ route('dosen.penilaian', ['kelas' => $kelas['id']]) }}">Atur di Pengaturan penilaian</a>.
|
||||
</x-ui.alert>
|
||||
@endif
|
||||
|
||||
<form
|
||||
method="POST"
|
||||
action="{{ route('dosen.presensi.store') }}"
|
||||
class="stack"
|
||||
novalidate
|
||||
x-data="{ hadir: @js($awal), total: @js($total), persen(v) { return v === '' || v === null || ! this.total ? null : Math.min(Math.round(v / this.total * 1000) / 10, 100); } }"
|
||||
>
|
||||
@csrf
|
||||
<input type="hidden" name="kelas" value="{{ $kelas['id'] }}">
|
||||
|
||||
<x-glass.panel padding="none">
|
||||
<div class="flex flex-wrap items-center justify-between gap-3 p-4">
|
||||
<div class="grid gap-1">
|
||||
<h2 class="text-title">{{ $kelas['matkul'] }} ({{ $kelas['kelas'] }})</h2>
|
||||
<span class="text-sm text-muted">{{ $kelas['kode'] }}, {{ $kelas['jadwal'] }}@if ($total), {{ $total }} pertemuan @endif</span>
|
||||
</div>
|
||||
@if (! $kelas['dikunci'] && $total)
|
||||
<x-ui.button variant="secondary" size="sm" icon="check-circle" x-on:click="for (const k in hadir) hadir[k] = total">Semua hadir penuh</x-ui.button>
|
||||
@endif
|
||||
</div>
|
||||
</x-glass.panel>
|
||||
|
||||
<x-satu.datatable label="Presensi peserta kelas" placeholder="Cari NIM atau nama">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">NIM</th>
|
||||
<th scope="col">Nama</th>
|
||||
<th scope="col" class="num">Jumlah hadir{{ $total ? ' (maks '.$total.')' : '' }}</th>
|
||||
<th scope="col" class="num">Kehadiran</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse ($peserta as $p)
|
||||
<tr>
|
||||
<td class="table__title">{{ $p['nim'] }}</td>
|
||||
<td>{{ $p['nama'] }}</td>
|
||||
<td class="num">
|
||||
<label class="visually-hidden" for="h-{{ $p['idkst'] }}">Jumlah hadir {{ $p['nama'] }}</label>
|
||||
<input
|
||||
type="number"
|
||||
id="h-{{ $p['idkst'] }}"
|
||||
name="hadir[{{ $p['idkst'] }}]"
|
||||
min="0"
|
||||
@if ($total) max="{{ $total }}" @endif
|
||||
step="1"
|
||||
inputmode="numeric"
|
||||
class="field__input"
|
||||
style="min-width: 5.5rem; text-align: end"
|
||||
x-model="hadir[{{ $p['idkst'] }}]"
|
||||
@disabled($kelas['dikunci'] || ! $total)
|
||||
>
|
||||
</td>
|
||||
<td class="num">
|
||||
<template x-if="persen(hadir[{{ $p['idkst'] }}]) !== null">
|
||||
<x-ui.badge tone="neutral"><span x-text="String(persen(hadir[{{ $p['idkst'] }}])).replace('.', ',')"></span>%</x-ui.badge>
|
||||
</template>
|
||||
<template x-if="persen(hadir[{{ $p['idkst'] }}]) === null"><span class="text-muted">Belum diisi</span></template>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr><td colspan="4"><x-ui.empty icon="users" title="Belum ada peserta" description="Peserta tampil setelah KRS mahasiswa disetujui dosen pembimbing akademik." /></td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</x-satu.datatable>
|
||||
|
||||
@if (! $kelas['dikunci'] && $total && $peserta->isNotEmpty())
|
||||
<x-form.actions>
|
||||
<x-ui.button type="submit" icon="check">Simpan presensi</x-ui.button>
|
||||
<x-ui.button variant="secondary" :href="route('dosen.kelas.show', $kelas['id'])">Lihat kelas</x-ui.button>
|
||||
</x-form.actions>
|
||||
@endif
|
||||
</form>
|
||||
|
||||
<p class="text-sm text-muted">DB akademik hanya menyimpan jumlah pertemuan yang dihadiri, bukan kehadiran per pertemuan. Mahasiswa dengan kehadiran di bawah {{ $batas }}% berisiko tidak dapat mengikuti ujian.</p>
|
||||
</div>
|
||||
@endif
|
||||
</x-layouts.app>
|
||||
@@ -1,49 +1,59 @@
|
||||
<x-layouts.app title="Riwayat mengajar">
|
||||
<x-ui.page-header title="Riwayat mengajar" description="Rekap kelas yang pernah Anda ampu pada semester-semester sebelumnya." />
|
||||
|
||||
<div class="stack">
|
||||
<x-ui.stats>
|
||||
<x-ui.stat label="Total kelas diampu" :value="$totalKelas" icon="rectangle-stack" :hint="$riwayat->count().' semester'" />
|
||||
<x-ui.stat label="Total mahasiswa" :value="$totalMahasiswa" icon="users" />
|
||||
<x-ui.stat label="Rata-rata kehadiran" :value="$rataKehadiran.'%'" icon="clipboard-document-check" />
|
||||
</x-ui.stats>
|
||||
|
||||
<x-ui.chart
|
||||
title="Jumlah mahasiswa per semester"
|
||||
type="bar"
|
||||
:labels="$labels"
|
||||
:datasets="[['label' => 'Mahasiswa', 'data' => $mahasiswaData]]"
|
||||
/>
|
||||
|
||||
<x-glass.panel padding="none">
|
||||
<x-ui.table label="Riwayat mengajar per semester">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Semester</th>
|
||||
<th scope="col">Mata kuliah</th>
|
||||
<th scope="col" class="num">Kelas</th>
|
||||
<th scope="col" class="num">Mahasiswa</th>
|
||||
<th scope="col" class="num">SKS</th>
|
||||
<th scope="col" class="num">Rata-rata nilai</th>
|
||||
<th scope="col" class="num">Kehadiran</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($riwayat as $r)
|
||||
<tr>
|
||||
<td class="table__title">{{ $r['semester'] }}</td>
|
||||
<td style="min-width: 16rem">{{ $r['matkul'] }}</td>
|
||||
<td class="num">{{ $r['kelas'] }}</td>
|
||||
<td class="num">{{ $r['mahasiswa'] }}</td>
|
||||
<td class="num">{{ $r['sks'] }}</td>
|
||||
<td class="num">{{ \App\Support\Prototype\DosenData::angka($r['rata_nilai']) }}</td>
|
||||
<td class="num"><x-ui.badge :tone="$r['kehadiran'] >= \App\Support\Prototype\DosenData::BATAS_HADIR ? 'success' : 'danger'">{{ $r['kehadiran'] }}%</x-ui.badge></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</x-ui.table>
|
||||
@if ($riwayat->isEmpty())
|
||||
<x-glass.panel padding="lg">
|
||||
<x-ui.empty icon="clock" title="Belum ada riwayat mengajar" description="Riwayat tampil setelah Anda pernah ditugaskan sebagai pengajar pada sebuah kelas." />
|
||||
</x-glass.panel>
|
||||
</div>
|
||||
@else
|
||||
<div class="stack">
|
||||
<x-ui.stats>
|
||||
<x-ui.stat label="Total kelas diampu" :value="$totalKelas" icon="rectangle-stack" :hint="$riwayat->count().' semester'" />
|
||||
<x-ui.stat label="Total mahasiswa" :value="$totalMahasiswa" icon="users" />
|
||||
<x-ui.stat label="Rata-rata kehadiran" :value="$rataKehadiran === null ? '-' : $rataKehadiran.'%'" icon="clipboard-document-check" />
|
||||
</x-ui.stats>
|
||||
|
||||
<x-ui.chart
|
||||
title="Jumlah mahasiswa per semester"
|
||||
type="bar"
|
||||
:labels="$labels"
|
||||
:datasets="[['label' => 'Mahasiswa', 'data' => $mahasiswaData]]"
|
||||
/>
|
||||
|
||||
<x-satu.datatable label="Riwayat mengajar per semester" placeholder="Cari semester atau mata kuliah">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Semester</th>
|
||||
<th scope="col">Mata kuliah</th>
|
||||
<th scope="col" class="num">Kelas</th>
|
||||
<th scope="col" class="num">Mahasiswa</th>
|
||||
<th scope="col" class="num">SKS</th>
|
||||
<th scope="col" class="num">Rata-rata nilai</th>
|
||||
<th scope="col" class="num">Kehadiran</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($riwayat as $r)
|
||||
<tr>
|
||||
<td class="table__title">{{ $r['semester'] }}</td>
|
||||
<td style="min-width: 16rem">{{ $r['matkul'] }}</td>
|
||||
<td class="num">{{ $r['kelas'] }}</td>
|
||||
<td class="num">{{ $r['mahasiswa'] }}</td>
|
||||
<td class="num">{{ $r['sks'] }}</td>
|
||||
<td class="num">{{ $r['rata_nilai'] === null ? '-' : \App\Support\Prototype\DosenData::angka($r['rata_nilai']) }}</td>
|
||||
<td class="num">
|
||||
@if ($r['kehadiran'] === null)
|
||||
<span class="text-muted">-</span>
|
||||
@else
|
||||
<x-ui.badge :tone="$r['kehadiran'] >= \App\Support\Prototype\DosenData::BATAS_HADIR ? 'success' : 'danger'">{{ $r['kehadiran'] }}%</x-ui.badge>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</x-satu.datatable>
|
||||
</div>
|
||||
@endif
|
||||
</x-layouts.app>
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
{{-- Skripsi yang dibimbing dosen, dari t_skripsi (pembimbing 1 atau 2). Hanya baca. --}}
|
||||
@php
|
||||
$tanggal = fn (?string $d): string => $d === null ? '-' : \App\Support\Prototype\DosenData::tanggal($d);
|
||||
@endphp
|
||||
|
||||
<x-layouts.app title="Bimbingan skripsi">
|
||||
<x-ui.page-header title="Bimbingan skripsi" description="Skripsi mahasiswa yang Anda bimbing sebagai pembimbing 1 atau pembimbing 2." />
|
||||
|
||||
@if ($berjalan->isEmpty() && $selesai->isEmpty())
|
||||
<x-glass.panel padding="lg">
|
||||
<x-ui.empty icon="book-open" title="Belum ada skripsi yang dibimbing" description="Skripsi tampil di sini setelah Anda ditetapkan sebagai pembimbing." />
|
||||
</x-glass.panel>
|
||||
@else
|
||||
<div class="stack">
|
||||
<x-ui.stats>
|
||||
<x-ui.stat label="Sedang dibimbing" :value="$berjalan->count()" icon="users" />
|
||||
<x-ui.stat label="Selesai" :value="$selesai->count()" icon="check-circle" hint="Telah lulus sidang" />
|
||||
</x-ui.stats>
|
||||
|
||||
@foreach ([['judul-berjalan', 'Sedang dibimbing', $berjalan], ['judul-selesai', 'Selesai dibimbing', $selesai]] as [$id, $judul, $daftar])
|
||||
@if ($daftar->isNotEmpty())
|
||||
<x-satu.datatable :label="$judul" :heading="$judul" placeholder="Cari mahasiswa atau judul">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Mahasiswa</th>
|
||||
<th scope="col">Judul</th>
|
||||
<th scope="col">Peran</th>
|
||||
<th scope="col">Mulai</th>
|
||||
<th scope="col">Lulus</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($daftar as $t)
|
||||
<tr>
|
||||
<td class="table__title">{{ $t['nama'] }} <span class="table__meta block">{{ $t['nim'] }}</span></td>
|
||||
<td style="min-width: 18rem">{{ $t['judul'] }}</td>
|
||||
<td><x-ui.badge tone="accent">{{ $t['peran'] }}</x-ui.badge></td>
|
||||
<td>{{ $tanggal($t['mulai']) }}</td>
|
||||
<td>{{ $tanggal($t['lulus']) }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</x-satu.datatable>
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
<p class="text-sm text-muted">DB akademik tidak menyimpan catatan sesi bimbingan, sehingga halaman ini hanya memuat judul, peran, dan tanggal. Daftar dibatasi 200 skripsi terbaru.</p>
|
||||
</div>
|
||||
@endif
|
||||
</x-layouts.app>
|
||||
@@ -45,8 +45,7 @@
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
<x-glass.panel padding="none">
|
||||
<x-ui.table label="Daftar jadwal kuliah">
|
||||
<x-satu.datatable label="Daftar jadwal kuliah" placeholder="Cari mata kuliah">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -85,8 +84,7 @@
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</x-ui.table>
|
||||
</x-glass.panel>
|
||||
</x-satu.datatable>
|
||||
</div>
|
||||
@endif
|
||||
</x-layouts.app>
|
||||
|
||||
@@ -39,8 +39,7 @@
|
||||
@endif
|
||||
|
||||
<div class="split">
|
||||
<x-glass.panel padding="none" aria-label="Nilai {{ $aktif['label'] }}">
|
||||
<x-ui.table :label="'Nilai '.$aktif['label']">
|
||||
<x-satu.datatable :label="'Nilai '.$aktif['label']" placeholder="Cari mata kuliah">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -83,8 +82,7 @@
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</x-ui.table>
|
||||
</x-glass.panel>
|
||||
</x-satu.datatable>
|
||||
|
||||
<x-ui.chart title="Perkembangan IPS" type="line" :labels="$ipsLabels" :datasets="[['label' => 'IPS', 'data' => $ipsData]]" />
|
||||
</div>
|
||||
|
||||
@@ -76,11 +76,7 @@
|
||||
</x-glass.panel>
|
||||
@endforeach
|
||||
|
||||
<x-glass.panel as="section" padding="none" aria-labelledby="judul-riwayat">
|
||||
<div class="panel__head">
|
||||
<h2 id="judul-riwayat" class="panel__title">Riwayat pembayaran</h2>
|
||||
</div>
|
||||
<x-ui.table label="Riwayat pembayaran">
|
||||
<x-satu.datatable label="Riwayat pembayaran" heading="Riwayat pembayaran" placeholder="Cari pembayaran">
|
||||
<table class="table table--compact">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -105,8 +101,7 @@
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</x-ui.table>
|
||||
</x-glass.panel>
|
||||
</x-satu.datatable>
|
||||
</div>
|
||||
@endif
|
||||
</x-layouts.app>
|
||||
|
||||
@@ -38,8 +38,7 @@
|
||||
</x-glass.panel>
|
||||
@endunless
|
||||
|
||||
<x-glass.panel padding="none">
|
||||
<x-ui.table label="Daftar nilai seluruh mata kuliah">
|
||||
<x-satu.datatable label="Daftar nilai seluruh mata kuliah" placeholder="Cari mata kuliah">
|
||||
<table class="table table--compact">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -72,8 +71,7 @@
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</x-ui.table>
|
||||
</x-glass.panel>
|
||||
</x-satu.datatable>
|
||||
</div>
|
||||
@endif
|
||||
</x-layouts.app>
|
||||
|
||||
@@ -29,8 +29,7 @@
|
||||
@endunless
|
||||
|
||||
<div class="split">
|
||||
<x-glass.panel padding="none">
|
||||
<x-ui.table label="Jadwal ujian">
|
||||
<x-satu.datatable label="Jadwal ujian" placeholder="Cari mata kuliah">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -51,8 +50,7 @@
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</x-ui.table>
|
||||
</x-glass.panel>
|
||||
</x-satu.datatable>
|
||||
|
||||
<x-glass.panel as="section" padding="lg" aria-labelledby="judul-syarat">
|
||||
<div class="panel-title"><h2 id="judul-syarat">Syarat umum</h2></div>
|
||||
|
||||
Reference in New Issue
Block a user