Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing edit pages #126

Merged
merged 2 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions app/Http/Controllers/CourseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,6 @@ public function update(UpdateCourseRequest $request, Course $course): RedirectRe
'description' => 'required',
'courseNumber' => 'required',
'departmentCode' => 'required',
'creditsLecture' => 'nullable',
'creditsLab' => 'nullable',
'creditsTotal' => 'required',
'syllabusLink' => 'nullable',
]);

$course->update($validated);
Expand Down
1 change: 0 additions & 1 deletion app/Http/Controllers/ProfessorController.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ public function update(UpdateProfessorRequest $request, Professor $professor): R
$validated = $request->validate([
'firstName' => 'required',
'lastName' => 'required',
'department' => 'required',
]);

$professor->update($validated);
Expand Down
21 changes: 3 additions & 18 deletions resources/views/courses/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,13 @@
<label class="mr-2">Course Number</label>
<input class="border-2 border-black" name="courseNumber" type="text" value="{{$course->courseNumber}}" required>
</div>
<label>Course Description</label>

<div class="m-4">
<textarea class="border-2 border-black" name="description" cols="30" rows="10" required>{{$course->description}}</textarea>
<label>Course Description</label>
</div>
<div class="m-4">
<label class="mr-2">Syllabus Link</label>
<input class="border-2 border-black" name="syllabusLink" type="text" value="{{$course->syllabusLink}}" >
</div>
<div class="m-4">
<label class="mr-2">Lab Hours Per Week</label>
<input class="border-2 border-black" name="creditsLab" type="number" value="{{$course->creditsLab}}" >
</div>
<div class="m-4">
<label class="mr-2">Lecture Hours Per Week</label>
<input class="border-2 border-black" name="creditsLecture" type="number" value="{{$course->creditsLecture}}" >
</div>
<div class="m-4">
<label class="mr-2">Credit Hours</label>
<input class="border-2 border-black" name="creditsTotal" type="number" value="{{$course->creditsTotal}}" required>
<textarea class="border-2 border-black" name="description" cols="30" rows="10" required>{{$course->description}}</textarea>
</div>
<button class="bg-gray-200 hover:bg-blue-900 hover:text-white rounded p-1" type="submit">Update</button>
<button class="m-2 border-4 border-yellow-400 hover:text-gray-300 bg-yellow-400 rounded font-bold px-1" type="submit">Update</button>
@if ($errors->any())
<div class="alert alert-danger">
<ul>
Expand Down
9 changes: 2 additions & 7 deletions resources/views/professors/edit.blade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<x-header>
<x-subHeader title="edit professor"/>
<div class="flex justify-center ">
<form method="POST" action="{{route("professors.update",$professor->id)}}" >
<form method="POST" action="{{route("professors.update",$professor->id)}}">
@csrf
@method('put')

Expand All @@ -13,12 +13,7 @@
<label class="mr-2">Last Name</label>
<input class="border-2 border-black" value='{{$professor->lastName}}'name="lastName" type="text" required>
</div>

<div class="m-4">
<label class="mr-2">Department Code</label>
<input class="border-2 border-black" value='{{$professor->department}}' name="department" type="text" required>
</div>
<button class="bg-gray-200 hover:bg-blue-900 hover:text-white rounded p-1" type="submit">Submit</button>
<button class="self-end m-2 border-4 border-yellow-400 hover:text-gray-300 bg-yellow-400 rounded font-bold px-1" type="submit">Submit</button>
</form>
</div>
</x-header>
Loading