Skip to content

Commit

Permalink
change kabeng permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
akechi17 committed Aug 14, 2024
1 parent b4053a8 commit 6f6fb29
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 22 deletions.
2 changes: 1 addition & 1 deletion resources/views/components/sidebar.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
class="icon icon-shape icon-sm shadow border-radius-md bg-white text-center me-2 d-flex align-items-center justify-content-center text-white">
<iconify-icon icon="{{ $item->icon }}"></iconify-icon>
</div>
<span class="nav-link-text ms-1">{{ $item->name }}</span>
<span class="nav-link-text ms-1">{{ auth()->user()->hasRole('kepala bengkel') && $item->name == "User" ? "Mentor" : $item->name }}</span>
</a>
</li>
@endif
Expand Down
2 changes: 1 addition & 1 deletion resources/views/teachers/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@extends('layouts.dashboard')

@section('dashboard-content')
<x-table pageName="Data Guru" routeCreate="{{ route('users.create') }}" :pagination="$teachers" :tableData="$teachers">
<x-table pageName="Data Guru" :pagination="$teachers" :tableData="$teachers">

<x-slot:thead>
<th class="text-center text-uppercase text-secondary text-xxs font-weight-bolder opacity-7 w-15">
Expand Down
20 changes: 0 additions & 20 deletions resources/views/users/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,6 @@
</x-slot:options>
</x-form.select>
</div>

<div id="student-wrapper" class="form-group d-none">
<label class="form-label">Siswa Bimbingan *</label>

<select class="form-select" style="width: 100%" name="student_ids[]" id="input-student" multiple="multiple">
@foreach ($students as $student)
<option value="{{ $student->id }}">{{ $student->name }} - {{ $student->courses()->first()?->name }}</option>
@endforeach
</select>
</div>
</x-slot:formBody>
</x-form.form>
@endsection
Expand All @@ -72,7 +62,6 @@
const departmentWrapper = document.getElementById('department-wrapper');
const courseWrapper = document.getElementById('course-wrapper');
const companyWrapper = document.getElementById('company-wrapper');
const studentWrapper = document.getElementById('student-wrapper');
if (roleSelect && departmentWrapper) {
roleSelect.addEventListener('change', function() {
Expand All @@ -82,36 +71,27 @@
departmentWrapper.classList.remove('d-none');
courseWrapper.classList.add('d-none');
companyWrapper.classList.add('d-none');
studentWrapper.classList.add('d-none');
} else if (selectedRole === 'mentor') {
departmentWrapper.classList.add('d-none');
companyWrapper.classList.remove('d-none');
courseWrapper.classList.add('d-none');
studentWrapper.classList.add('d-none');
} else if (selectedRole === 'student') {
departmentWrapper.classList.add('d-none');
companyWrapper.classList.add('d-none');
courseWrapper.classList.remove('d-none');
studentWrapper.classList.add('d-none');
} else if (selectedRole === 'teacher') {
departmentWrapper.classList.add('d-none');
companyWrapper.classList.add('d-none');
courseWrapper.classList.add('d-none');
studentWrapper.classList.remove('d-none');
} else {
departmentWrapper.classList.add('d-none');
courseWrapper.classList.add('d-none');
companyWrapper.classList.add('d-none');
studentWrapper.classList.add('d-none');
}
});
} else {
console.error('Elements not found');
}
});
$(document).ready(function() {
$("#input-student").select2();
});
</script>
@endpush

0 comments on commit 6f6fb29

Please sign in to comment.