Perbaikan modul data karyawan dan staff + modul SOP import
This commit is contained in:
@@ -62,7 +62,6 @@
|
||||
|
||||
<div class="bg-white p-5 rounded-2xl border border-slate-200 shadow-sm mb-6">
|
||||
<form action="{{ route('admin.exams.questions') }}" method="GET">
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-3 lg:grid-cols-6 gap-4 mb-4">
|
||||
<div>
|
||||
<label class="block text-xs font-semibold text-slate-500 mb-1">Departemen</label>
|
||||
@@ -75,7 +74,7 @@
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-xs font-semibold text-slate-500 mb-1">Posisi</label>
|
||||
<label class="block text-xs font-semibold text-slate-500 mb-1">Posisi / Jabatan</label>
|
||||
<select name="position_id" class="select2 w-full text-sm">
|
||||
<option value="">Semua</option>
|
||||
@foreach($positions as $pos)
|
||||
@@ -85,8 +84,13 @@
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-xs font-semibold text-slate-500 mb-1">Materi / Modul</label>
|
||||
|
||||
<label class="block text-xs font-semibold text-slate-500 mb-1">Subject / Materi</label>
|
||||
<select name="subject_id" class="select2 w-full text-sm">
|
||||
<option value="">Semua Materi</option>
|
||||
@foreach($subjects as $subj)
|
||||
<option value="{{ $subj->id }}" {{ request('subject_id') == $subj->id ? 'selected' : '' }}>{{ $subj->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
@@ -115,7 +119,7 @@
|
||||
<select name="created_by" class="select2 w-full text-sm">
|
||||
<option value="">Semua</option>
|
||||
@foreach($creators as $creator)
|
||||
<option value="{{ $creator->id }}" {{ request('created_by') == $creator->id ? 'selected' : '' }}>{{ $creator->first_name }}</option>
|
||||
<option value="{{ $creator->id }}" {{ request('created_by') == $creator->id ? 'selected' : '' }}>{{ $creator->first_name }} {{ $creator->last_name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
@@ -126,7 +130,7 @@
|
||||
<input type="text" name="search" value="{{ request('search') }}" placeholder="Cari teks pertanyaan..." class="w-full px-4 py-2 bg-slate-50 border border-slate-200 rounded-lg text-sm focus:ring-blue-500">
|
||||
</div>
|
||||
<div class="flex gap-2 w-full md:w-auto">
|
||||
@if(request()->hasAny(['search', 'department_id', 'position_id', 'question_type', 'question_level', 'created_by']))
|
||||
@if(request()->hasAny(['search', 'department_id', 'position_id', 'subject_id', 'question_type', 'question_level', 'created_by']))
|
||||
<a href="{{ route('admin.exams.questions') }}" class="px-5 py-2 bg-slate-100 text-slate-600 rounded-lg text-sm font-semibold hover:bg-slate-200 transition-all text-center w-full md:w-auto">Reset</a>
|
||||
@endif
|
||||
<button type="submit" class="px-5 py-2 bg-blue-600 text-white rounded-lg text-sm font-semibold hover:bg-blue-700 transition-all text-center w-full md:w-auto">
|
||||
@@ -145,8 +149,9 @@
|
||||
<th class="px-4 py-4 w-10 text-center">
|
||||
<input type="checkbox" x-model="selectAll" @change="toggleAll" class="w-4 h-4 text-blue-600 border-slate-300 rounded focus:ring-blue-500 cursor-pointer">
|
||||
</th>
|
||||
<th class="px-4 py-4 font-semibold">Q.ID</th>
|
||||
<th class="px-4 py-4 font-semibold">Materi / Modul</th>
|
||||
<th class="px-4 py-4 font-semibold w-12">Q.ID</th>
|
||||
<th class="px-4 py-4 font-semibold w-1/5">Subject / Materi</th>
|
||||
<th class="px-4 py-4 font-semibold w-1/5">Penempatan</th>
|
||||
<th class="px-4 py-4 font-semibold">Tipe & Level</th>
|
||||
<th class="px-4 py-4 font-semibold w-1/3">Pertanyaan</th>
|
||||
<th class="px-4 py-4 font-semibold">Pembuat</th>
|
||||
@@ -161,28 +166,37 @@
|
||||
</td>
|
||||
<td class="px-4 py-3 font-mono font-bold text-slate-500">{{ $q->id }}</td>
|
||||
<td class="px-4 py-3">
|
||||
<span class="font-semibold text-slate-800">{{ $q->matrix->title ?? 'Umum' }}</span>
|
||||
<div class="text-[11px] text-slate-500 mt-0.5">{{ $q->department->name ?? 'All Dept' }}</div>
|
||||
<div class="font-bold text-slate-800 max-w-[200px] truncate" title="{{ $q->subject->name ?? 'Materi Umum' }}">
|
||||
{{ $q->subject->name ?? 'Materi Umum' }}
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-4 py-3">
|
||||
<span class="px-2 py-0.5 bg-indigo-50 text-indigo-700 rounded text-[10px] font-bold uppercase tracking-wider border border-indigo-100">{{ str_replace('_', ' ', $q->type) }}</span>
|
||||
<span class="font-semibold text-slate-700 block">{{ $q->department->name ?? 'Semua Dept' }}</span>
|
||||
<span class="text-[11px] text-slate-400 block mt-0.5">{{ $q->position->name ?? 'Semua Jabatan' }}</span>
|
||||
</td>
|
||||
<td class="px-4 py-3 whitespace-nowrap">
|
||||
<span class="px-2 py-0.5 bg-indigo-50 text-indigo-700 rounded text-[10px] font-bold uppercase tracking-wider border border-indigo-100">
|
||||
{{ str_replace('_', ' ', $q->question_type) }}
|
||||
</span>
|
||||
<div class="mt-1">
|
||||
@if($q->level == 'mudah') <span class="text-[11px] font-bold text-emerald-500">Mudah</span>
|
||||
@elseif($q->level == 'sedang') <span class="text-[11px] font-bold text-amber-500">Sedang</span>
|
||||
@if($q->question_level == 'mudah') <span class="text-[11px] font-bold text-emerald-500">Mudah</span>
|
||||
@elseif($q->question_level == 'sedang') <span class="text-[11px] font-bold text-amber-500">Sedang</span>
|
||||
@else <span class="text-[11px] font-bold text-red-500">Sulit</span> @endif
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-4 py-3">
|
||||
<p class="text-sm text-slate-800 line-clamp-2">{{ strip_tags($q->question_text) }}</p>
|
||||
</td>
|
||||
<td class="px-4 py-3">
|
||||
<div class="text-sm font-semibold">{{ $q->creator->first_name ?? 'Sistem' }}</div>
|
||||
<div class="text-[11px] text-slate-400">@if($q->creator && $q->creator->hasRole('trainer')) Trainer @else Admin @endif</div>
|
||||
<td class="px-4 py-3 whitespace-nowrap">
|
||||
<div class="text-sm font-semibold text-slate-800">{{ $q->creator->first_name ?? 'ID: '.$q->created_by }}</div>
|
||||
<div class="text-[11px] text-slate-400">
|
||||
@if($q->creator && $q->creator->hasRole('trainer')) Trainer @else Staf / Admin @endif
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-right space-x-2 whitespace-nowrap">
|
||||
<a href="#" class="text-slate-400 hover:text-blue-600"><svg class="w-5 h-5 inline" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"></path></svg></a>
|
||||
<a href="#" class="text-slate-400 hover:text-amber-500"><svg class="w-5 h-5 inline" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"></path></svg></a>
|
||||
<form action="#" method="POST" class="inline-block" onsubmit="return confirm('Hapus soal ini?');">
|
||||
<a href="{{ url('admin/exams/questions/'.$q->id) }}" class="text-slate-400 hover:text-blue-600"><svg class="w-5 h-5 inline" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"></path></svg></a>
|
||||
<a href="{{ url('admin/exams/questions/'.$q->id.'/edit') }}" class="text-slate-400 hover:text-amber-500"><svg class="w-5 h-5 inline" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"></path></svg></a>
|
||||
<form action="{{ url('admin/exams/questions/'.$q->id) }}" method="POST" class="inline-block" onsubmit="return confirm('Hapus soal ini secara permanen?');">
|
||||
@csrf @method('DELETE')
|
||||
<button type="submit" class="text-slate-400 hover:text-red-500"><svg class="w-5 h-5 inline" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"></path></svg></button>
|
||||
</form>
|
||||
@@ -190,9 +204,8 @@
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="7" class="px-4 py-12 text-center">
|
||||
<svg class="w-12 h-12 text-slate-300 mx-auto mb-3" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path></svg>
|
||||
<p class="text-slate-500 font-medium">Belum ada data soal yang sesuai filter.</p>
|
||||
<td colspan="8" class="px-4 py-12 text-center text-slate-500 font-medium">
|
||||
Belum ada data soal yang sesuai kriteria filter.
|
||||
</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
@@ -210,7 +223,6 @@
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// Inisialisasi Select2 untuk semua filter
|
||||
$('.select2').select2({ width: '100%' });
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user