diff --git a/src/app/attendance/attendance.component.html b/src/app/attendance/attendance.component.html index 20a087c..79e7951 100644 --- a/src/app/attendance/attendance.component.html +++ b/src/app/attendance/attendance.component.html @@ -9,263 +9,443 @@ - - - -
- - -
+
+
-
  • +
    + + +
    + +
    + + + + -
  • - + + + + + + + diff --git a/src/app/attendance/attendance.component.scss b/src/app/attendance/attendance.component.scss index 916adcd..7437227 100644 --- a/src/app/attendance/attendance.component.scss +++ b/src/app/attendance/attendance.component.scss @@ -118,6 +118,7 @@ background-color: transparent; color: var(--light-grey); border-radius: 7px; + flex-grow: 1; &.active { background-color: var(--teal-green); diff --git a/src/app/attendance/attendance.component.ts b/src/app/attendance/attendance.component.ts index c1aac8b..d38a547 100644 --- a/src/app/attendance/attendance.component.ts +++ b/src/app/attendance/attendance.component.ts @@ -1,5 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { Location } from '@angular/common'; +import { DemoService } from '../services/demo.service'; @Component({ selector: 'app-attendance', @@ -8,15 +9,33 @@ import { Location } from '@angular/common'; }) export class AttendanceComponent implements OnInit { selectedList: number = 1; - selectedSegment: string = 'ALL'; - selectedSegmentTab: string = 'report'; - selectedReportYear: number = 2020; + selectedSegment: any; + selectedSegmentTab: any; + selectedReportYear: any; + demoType: string; + attendanceList = []; constructor( - private location: Location + private location: Location, + private demoService: DemoService ) { } ngOnInit(): void { + this.demoType = localStorage.demoType; + + this.attendanceList = this.demoService.attendanceList; + + if (this.demoType === 'Teacher') { + this.selectedList = 1; + this.selectedSegment = this.attendanceList[0]; + this.selectedSegmentTab = this.attendanceList[0].subjects[0]; + this.selectedReportYear = this.attendanceList[0].subjects[0].attendance[0].year; + } else { + this.selectedList = 1; + this.selectedSegment = 'ALL'; + this.selectedSegmentTab = 'report'; + this.selectedReportYear = 2020; + } } back() { diff --git a/src/app/services/demo.service.ts b/src/app/services/demo.service.ts index 3f4e3e6..53dad3c 100644 --- a/src/app/services/demo.service.ts +++ b/src/app/services/demo.service.ts @@ -323,6 +323,103 @@ export class DemoService { }] }]; + attendanceList = [{ + classLevel: '10', + subjects: [{ + name: 'MAT', + attendance: [{ + year: '2020', + totalClasses: 30, + students: [{ + name: 'Anand', + present: 25, + }, { + name: 'Bhagya', + present: 24, + }, { + name: 'Chintu', + present: 20 + }, { + name: 'Dinesh', + present: 30, + }] + }, { + year: '2019', + totalClasses: 50, + students: [{ + name: 'Anand', + present: 45, + }, { + name: 'Bhagya', + present: 44, + }, { + name: 'Chintu', + present: 40 + }, { + name: 'Dinesh', + present: 40, + }] + }] + }, { + name: 'EVS', + attendance: [{ + year: '2020', + totalClasses: 30, + students: [{ + name: 'Anand', + present: 25, + }, { + name: 'Bhagya', + present: 24, + }, { + name: 'Chintu', + present: 20 + }, { + name: 'Dinesh', + present: 30, + }] + }] + }] + }, { + classLevel: '8', + subjects: [{ + name: 'MAT', + attendance: [{ + year: '2020', + totalClasses: 20, + students: [{ + name: 'Meghana', + present: 15, + }, { + name: 'Sandhya', + present: 14, + }, { + name: 'Zaid', + present: 10 + }, { + name: 'Tchalabala', + present: 10, + }] + }, { + year: '2019', + totalClasses: 30, + students: [{ + name: 'Meghana', + present: 25, + }, { + name: 'Sandhya', + present: 24, + }, { + name: 'Zaid', + present: 20 + }, { + name: 'Tchalabala', + present: 30, + }] + }] + }] + }] + constructor() { } } diff --git a/src/app/tabs/more/more.component.html b/src/app/tabs/more/more.component.html index db2ca48..e7e1360 100644 --- a/src/app/tabs/more/more.component.html +++ b/src/app/tabs/more/more.component.html @@ -29,7 +29,7 @@
    -
    +