Skip to content

Commit

Permalink
Student Lesson Registration Screens | SIS-113 (#61)
Browse files Browse the repository at this point in the history
* Student Lesson Registration Done Screen design and lessons listed

* Student Component Fields Have Been Updated for Student Lesson Registration Page && Unused Buttons Have Been Deleted

* Student Lesson Registration Page Has Been Updated and Fixed

* Student Component Fields Have Been Updated and Fixed for Student Lesson Registration Page

* Done Student Lesson Registration Save Transaction

* Done Student Registration Lesson List page and Api Connection

* Done Registration Lesson List Page and Api Connection

* Done Lesson Registration approved and rejected transaction.

* Done Student My Lesson Page and Api Connection.

* Student My Lessons and My Notes Screen Updated.

* Student My Lessons Screen Updated.

* Student Lesson Registration, Teacher Lesson Registration and Lesson Registration Detail Page Updated.

* Teacher Lesson Registration and Lesson Registration Detail Page Updated.

* Teacher Viewing Lesson Registration and Lesson Registration Detail Page Updated.

* Registration Status Page Updated and Fixed

* Student Lesson Registration Controller Page Updated and Fixed.

* Student Controller Page Updated and Fixed.

* Registration Detail Page Updated and Fixed

* Teacher Component Page Updated and Fixed

Co-authored-by: Agit Rubar Demir <demiragitrubar@gmail.com>
  • Loading branch information
berinkrktt and agitrubard authored Apr 3, 2022
1 parent 7a86995 commit cbaab8b
Show file tree
Hide file tree
Showing 10 changed files with 1,315 additions and 80 deletions.
144 changes: 144 additions & 0 deletions pages/student/lesson/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
import SISTitle from "../../../public/components/page-titles";
import LessonSemester from "../../../public/constants/lesson/LessonSemester";
import UnauthorizedAccessPage from "../../401";
import LessonCompulsoryOrElective from "../../../public/constants/lesson/LessonCompulsoryOrElective";
import SisStudentStorage from "../../../public/storage/student/SisStudentStorage";
import StudentNavbar from "../../../public/components/navbar/student/student-navbar";
import StudentLessonController from "../../../public/api/student/lesson/StudentLessonController";

export async function getServerSideProps(context) {
const studentId = SisStudentStorage.getNumberWithContext(context);
if (studentId === undefined) {
return {
props: {
isPagePermissionSuccess: false,
}
}
}

const studentLessonsData = await StudentLessonController.getAllStudentLessonsByStudentId(studentId);
if (studentLessonsData.success) {
return {
props: {
lessons: studentLessonsData.response,
isPagePermissionSuccess: true
}
}
}
}
export default function StudentLessonsList({isPagePermissionSuccess, lessons}) {
if (!isPagePermissionSuccess) {
return (
<UnauthorizedAccessPage user="student"/>
)
}
return (
<div>
<SISTitle/>
<StudentNavbar/>
{(
lessons.length !== 0
?
<div className="max-w-7xl select-none py-5 mx-auto space-y-6">
<div className="px-12 py-10 text-left bg-gray-50 rounded-2xl shadow-xl">
<a className="select-none font-phenomenaExtraBold text-left text-4xl text-sis-darkblue">
DERSLERİM
</a>
</div>
<div className="flex flex-col">
<div className="-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8">
<div className="py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8">
<div className="shadow overflow-hidden border-b border-gray-200 sm:rounded-lg">
<table className="bg-gray-50 min-w-full divide-y divide-gray-200">
<thead className="font-phenomenaBold text-xl text-gray-500 text-left">
<tr>
<th
scope="col"
className="select-none px-6 py-3 tracking-wider"
>
DERS
</th>
<th
scope="col"
className="select-none px-6 py-3 tracking-wider"
>
AKADEMİK BİLGİLER
</th>
<th
scope="col"
className="select-none px-6 py-3 tracking-wider"
>
KREDİ
</th>
<th
scope="col"
className="select-none px-6 py-3 tracking-wider"
>
DERS DURUMU
</th>
</tr>
</thead>
<tbody className="bg-white divide-y divide-gray-200">
{lessons.lessonsResponses.map((lesson) => (
<tr key={lesson.lessonId}>
<td className="px-6 py-4 whitespace-nowrap">
<div className="flex items-center">
<div className="ml-0.5">
<div
className="font-phenomenaBold text-xl text-sis-darkblue">{lesson.name}</div>
<div
className="select-all font-phenomenaRegular text-lg text-gray-500">{lesson.lessonId}</div>
{LessonSemester.getAll.map((lSemester) => (
lesson.semester === lSemester.enum
?
<div
className="font-phenomenaBold text-xl text-gray-500">{lSemester.tr}</div>
:
null
))}
</div>
</div>
</td>
<td className="px-6 py-4 whitespace-nowrap">
<div
className="font-phenomenaBold text-xl text-sis-darkblue">{lesson.departmentResponse.facultyResponse.name}</div>

<div
className="font-phenomenaRegular text-xl text-sis-darkblue">{lesson.departmentResponse.name}</div>
</td>
<td className="px-6 py-4 whitespace-nowrap">
<div
className="font-phenomenaBold text-xl text-sis-darkblue">{lesson.credit}</div>

</td>
<td className="px-6 py-4 whitespace-nowrap">
{LessonCompulsoryOrElective.getAll.map((lCompulsory) => (
lesson.compulsoryOrElective === lCompulsory.enum
?
<div
className="font-phenomenaBold text-xl text-sis-darkblue">{lCompulsory.tr}</div>
:
null
))}
</td>
</tr>
))}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
:
<div
className="max-w-7xl mx-auto px-12 py-10 text-center bg-gray-50 rounded-2xl shadow-xl">
<a className="select-none font-phenomenaExtraBold text-4xl text-sis-fail">
Henüz Ders Kaydınız Yapılmadı!

</a>
</div>
)}
</div>
)
}
38 changes: 22 additions & 16 deletions pages/student/lesson/notes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export async function getServerSideProps(context) {
}

export default function StudentLessonsNotesList({isPagePermissionSuccess, studentLessonsNotes}) {

if (!isPagePermissionSuccess) {
return (
<UnauthorizedAccessPage user="student"/>
Expand All @@ -38,15 +37,15 @@ export default function StudentLessonsNotesList({isPagePermissionSuccess, studen
<div>
<SISTitle/>
<StudentNavbar/>
<div className="max-w-7xl select-none py-5 mx-auto space-y-6">
<div className="px-12 py-10 text-left bg-gray-50 rounded-2xl shadow-xl">
<a className="select-none font-phenomenaExtraBold text-left text-4xl text-sis-darkblue">
NOTLARIM
</a>
</div>
{(
studentLessonsNotes.length !== 0
?
{(
studentLessonsNotes.length !== 0
?
<div className="max-w-7xl select-none py-5 mx-auto space-y-6">
<div className="px-12 py-10 text-left bg-gray-50 rounded-2xl shadow-xl">
<a className="select-none font-phenomenaExtraBold text-left text-4xl text-sis-darkblue">
NOTLARIM
</a>
</div>
<div className="flex flex-col">
<div className="-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8">
<div className="py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8">
Expand Down Expand Up @@ -104,8 +103,10 @@ export default function StudentLessonsNotesList({isPagePermissionSuccess, studen
<td className="px-2 py-4 whitespace-nowrap">
<div className="flex items-center">
<div className="ml-4">
<div className="font-phenomenaBold text-xl text-sis-darkblue">{studentLessonNotes.teacherResponse.name} {studentLessonNotes.teacherResponse.surname}</div>
<div className="select-all font-phenomenaRegular text-lg text-gray-500">{studentLessonNotes.teacherResponse.teacherId}</div>
<div
className="font-phenomenaBold text-xl text-sis-darkblue">{studentLessonNotes.teacherResponse.name} {studentLessonNotes.teacherResponse.surname}</div>
<div
className="select-all font-phenomenaRegular text-lg text-gray-500">{studentLessonNotes.teacherResponse.teacherId}</div>
</div>
</div>
</td>
Expand Down Expand Up @@ -170,10 +171,15 @@ export default function StudentLessonsNotesList({isPagePermissionSuccess, studen
</div>
</div>
</div>
:
null
)}
</div>
</div>
:
<div
className="max-w-7xl mt-8 mx-auto px-12 py-10 text-center bg-gray-50 rounded-2xl shadow-xl">
<a className="select-none font-phenomenaExtraBold text-4xl text-sis-fail">
Ders Kaydınız Yapılmadığı için Notlarınızı Görüntüleyemiyorsunuz!
</a>
</div>
)}
</div>
)
}
Loading

0 comments on commit cbaab8b

Please sign in to comment.