Skip to content

Commit

Permalink
Display student_surname in lists
Browse files Browse the repository at this point in the history
Move Reports to main menu and remove reports menu
Don't display curriculums in menu if ignoreCurriculumsForTracking is set.
  • Loading branch information
chrisekelley committed Oct 26, 2023
1 parent 08e7a92 commit 8e43f7d
Show file tree
Hide file tree
Showing 14 changed files with 289 additions and 136 deletions.
4 changes: 4 additions & 0 deletions client/src/app/class/_services/dashboard.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1027,12 +1027,14 @@ export class DashboardService {
list.push(studentResult)
} else {
const student_name = this.getValue('student_name', student.doc)
const student_surname = this.getValue('student_surname', student.doc)
const phone = this.getValue('phone', student.doc);
const classId = this.getValue('classId', student.doc)

studentResult = {}
studentResult['id'] = studentId
studentResult['name'] = student_name
studentResult['surname'] = student_surname
studentResult['phone'] = phone
studentResult['classId'] = classId
studentResult['forms'] = {}
Expand Down Expand Up @@ -1079,12 +1081,14 @@ export class DashboardService {
list.push(studentResult)
} else {
const student_name = this.getValue('student_name', student.doc)
const student_surname = this.getValue('student_surname', student.doc)
const phone = this.getValue('phone', student.doc);
const classId = this.getValue('classId', student.doc)

studentResult = {}
studentResult['id'] = studentId
studentResult['name'] = student_name
studentResult['surname'] = student_surname
studentResult['phone'] = phone
studentResult['classId'] = classId
studentResult['forms'] = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<th>{{'Attendance'|translate}}</th>
</tr>
<tr *ngFor="let element of attendanceList">
<td (click)="$event ? selectStudentName(element) : null" class="student-name"> {{element["name"]}} </td>
<td (click)="$event ? selectStudentName(element) : null" class="student-name"> {{element["name"]}} {{element["surname"]}} </td>
<td style="padding-right: 1em;">
<mat-chip-list class="absent">
<ng-container *ngIf="element['absent']; then absent; else present"></ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ mat-card-title {

.number-cell {
width: 20px;
padding-right: 1em;
padding-left: 1em;
}

/*.student-name-column {*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,17 @@
</mat-toolbar>
<mat-card *ngIf="selectedClass">
<!-- <div class="selectedClassLabel">{{'Student Dashboard'|translate}}<br/>{{getClassTitle(selectedClass)}} : <ng-container *ngIf="!ignoreCurriculumsForTracking">{{curriculum?.label}} : </ng-container>{{reportDate}}</div>-->
<div class="selectedClassLabel">{{'Student Dashboard'|translate}}<br/>{{getClassTitle(selectedClass)}} : {{curriculum?.label}} : {{reportDate}}</div>
<div class="selectedClassLabel">{{'Student Dashboard'|translate}}<br/>{{getClassTitle(selectedClass)}} : {{curriculum?.label}} : {{reportLocaltime}}</div>
<div>
<table class="dashboard-table">
<tr>
<th class="student-name-column">{{'Stud.'|translate}}</th>
<th class="student-name-column">
<mat-checkbox (change)="setEnableContactChoosing($event.checked)">
{{'Open Contacts'|translate}}
</mat-checkbox>
</th>
<th colspan="2" class="student-name-column">{{'Stud.'|translate}}</th>
<th colspan="2">{{'Attend.'|translate}}</th>
<th colspan="2">{{'Behav.'|translate}}</th>
<th>{{'Score.'|translate}}</th>
</tr>
<tr *ngFor="let student of attendanceReport?.attendanceList">
<!-- <tr *ngFor="let student of attendanceReport?.attendanceList">-->
<td (click)="$event ? selectStudentName(student) : null" class="student-name"> {{student["name"]}} </td>
<td (click)="$event ? selectStudentName(student) : null" class="student-name"> {{student["name"]}} {{student["surname"]}} </td>
<td class="sms-button-column">
<button mat-mini-fab color="accent" aria-label="SMS button with an sms icon" (click)="sendText(student)"
[ngStyle]="{transform: 'scale(0.6)'}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export class AttendanceDashboardComponent implements OnInit {
units: string[] = []
ignoreCurriculumsForTracking: boolean = false
enableContactChoosing: boolean = false
reportLocaltime: string;

constructor(
private dashboardService: DashboardService,
Expand All @@ -41,6 +42,7 @@ export class AttendanceDashboardComponent implements OnInit {
let classIndex
this.getValue = this.dashboardService.getValue
this.reportDate = DateTime.local().toISODate()
this.reportLocaltime = DateTime.now().toLocaleString(DateTime.DATE_FULL)
const enabledClasses = await this.dashboardService.getEnabledClasses();
const appConfig = await this.appConfigService.getAppConfig()
this.units = appConfig.teachProperties?.units
Expand Down Expand Up @@ -138,10 +140,12 @@ export class AttendanceDashboardComponent implements OnInit {
studentsWithoutAttendance.forEach((student) => {
const studentResult = {}
const student_name = this.getValue('student_name', student.doc, false)
const student_surname = this.getValue('student_surname', student.doc, false)
const phone = this.getValue('phone', student.doc, false);
const classId = this.getValue('classId', student.doc, false)
studentResult['id'] = student.id
studentResult['name'] = student_name
studentResult['surname'] = student_surname
studentResult['phone'] = phone
studentResult['classId'] = classId
studentResult['forms'] = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,16 @@ input[type=number] {
.mat-form-field-appearance-fill .mat-form-field-flex {
background-color: rgba(0,0,0,.04);
}

.selectedClassLabel {
font-size: larger;
font-weight: bold;
padding-bottom: 5px;
padding-left: 5px;
padding-right: 5px;
text-align: center;
}

.selectedClassLabel p {
text-align: center;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<mat-card>
<div class="selectedClassLabel"><p>{{curriculum?.label}} {{'Student Scores'|translate}}</p></div>
<div class="selectedClassLabel">{{'Student Scores'|translate}}<br/>{{getClassTitle(selectedClass)}} : {{curriculum?.label}}</div>
<div>
<mat-tab-group>
<mat-tab *ngFor="let unit of units; index as unitIndex" label="{{unit}}">
Expand All @@ -10,7 +10,7 @@
<th>{{'Score'|translate}}</th>
</tr>
<tr *ngFor="let student of scoreList">
<td (click)="$event ? selectStudentName(student) : null" class="student-name"> {{student["name"]}} </td>
<td (click)="$event ? selectStudentName(student) : null" class="student-name"> {{student["name"]}} {{student["surname"]}} </td>
<!-- <td style="text-align: center">{{student['score_'+unit]}}</td>-->
<td style="text-align: center">
<mat-form-field class="example-full-width">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,4 +201,6 @@ export class AttendanceScoresComponent implements OnInit {
{ curriculum: 'student-registration', studentId: studentId, classId: classId, responseId: studentId, viewRecord: true }
});
}

getClassTitle = this.dashboardService.getClassTitle
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<mat-card>
<div class="selectedClassLabel"><p>{{curriculum?.label}} {{'Behavior'|translate}} <ng-template [ngIf]="reportLocaltime">: {{reportLocaltime}}</ng-template></p></div>
<div class="selectedClassLabel">{{'Behavior'|translate}}<br/>{{getClassTitle(selectedClass)}} : {{curriculum?.label}} : {{reportLocaltime}}</div>
<div>
<table class="dashboard-table">
<tr>
<th>{{'Student'|translate}}</th>
<th>{{'Behavior'|translate}}</th>
</tr>
<tr *ngFor="let student of studentBehaviorList">
<td (click)="$event ? selectStudentName(student) : null" class="student-name"> {{student["name"]}} </td>
<td (click)="$event ? selectStudentName(student) : null" class="student-name"> {{student["name"]}} {{student["surname"]}} </td>
<td class="checkbox-response" *ngIf="student['behavior'] !==null ; else elseBlock ">
<input type="checkbox"
(change)="$event ? selectCheckboxResult(student,'form-internal-behaviour',$event) : null"
Expand Down
59 changes: 37 additions & 22 deletions client/src/app/class/class-nav-bar/class-nav-bar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,33 @@
</button>
<mat-menu #classesMenu="matMenu">
<ng-template [ngIf]="enabledClasses.length > 0">
<button mat-menu-item>
{{'Select Class'|translate}}
</button>
<span *ngFor="let klass of enabledClasses; let classIndex=index"
class="class-dashboard-curr-button-spacer">
<button mat-menu-item [matMenuTriggerFor]="curriculumMenu">
<button mat-menu-item [matMenuTriggerFor]="curriculumMenu" *ngIf="!klass.ignoreCurriculumsForTracking; else noCurriculums">
<!-- <button mat-menu-item [routerLink]="['/attendance-dashboard/']"-->
<!-- [queryParams]={classIndex:classIndex}>-->
{{getClassTitle(klass.doc)}}
</button>
<mat-menu #curriculumMenu="matMenu">
<!-- <ng-container *ngFor="let curriculum of klass.doc.items[0].inputs[3].value;">-->
<!-- <ng-container *ngFor="let curriculum of curriculums[klass['_id']]">-->
<ng-container *ngFor="let curriculum of klass.doc.items[0].inputs[3].value;">
<button mat-menu-item *ngIf="curriculum.value ==='on'"
[routerLink]="['/attendance-dashboard/']"
[queryParams]={classIndex:classIndex,curriculumId:curriculum.name}>
{{curriculum.label}}
</button>
</ng-container>
</mat-menu>
<mat-menu #curriculumMenu="matMenu">
<ng-container *ngFor="let curriculum of klass.doc.items[0].inputs[3].value;">
<button mat-menu-item *ngIf="curriculum.value ==='on'"
[routerLink]="['/attendance-dashboard/']"
[queryParams]={classIndex:classIndex,curriculumId:curriculum.name}>
{{curriculum.label}}
</button>
</ng-container>
</mat-menu>
<ng-template #noCurriculums>
<button mat-menu-item [routerLink]="['/attendance-dashboard/']"
[queryParams]={classIndex:classIndex}>
{{getClassTitle(klass.doc)}}
</button>
</ng-template>
</span>

</ng-template>
<!-- <span dir="rtl" *ngFor="let klass of enabledClasses; let classIndex=index" class="class-dashboard-curr-button-spacer">-->
<!-- <button mat-menu-item [matMenuTriggerFor]="catMenu">-->
Expand Down Expand Up @@ -66,31 +74,38 @@
*ngIf="selectedClass">
<span>{{'Scores'|translate}}</span>
</button>
<mat-divider></mat-divider>
<button mat-menu-item routerLink="/reports/attendance/{{selectedClass?._id}}">{{'Report'|translate}}</button>
</mat-menu>
</span>

<span class="class-dashboard-button-spacer-right">
<button mat-button [matMenuTriggerFor]="reportsMenu" class="white-menu-item">
<mat-icon class="material-icons menu-tangy-location-list-icon white-menu-item">dashboard</mat-icon>
<span>{{'Reports'|translate}}</span>
</button>
<!--<span class="class-dashboard-button-spacer-right">-->
<!-- <button mat-button [matMenuTriggerFor]="reportsMenu" class="white-menu-item">-->
<!-- <mat-icon class="material-icons menu-tangy-location-list-icon white-menu-item">dashboard</mat-icon>-->
<!-- <span>{{'Reports'|translate}}</span>-->
<!-- </button>-->

<!-- <mat-menu #groupingMenu="matMenu">-->
<!-- <ng-template matMenuContent>-->
<!-- <button mat-menu-item *ngFor="let item of formList"-->
<!-- routerLink="/reports/grouping/{{item.id}}/{{item.classId}}/{{item.curriculumId}}">{{item.title}}</button>-->
<!-- </ng-template>-->
<!-- </mat-menu>-->
<mat-menu #reportsMenu="matMenu">

<!-- <mat-menu #reportsMenu="matMenu">-->

<!-- <ng-template matMenuContent>-->
<!-- <button mat-menu-item [matMenuTriggerFor]="groupingMenu">{{'Class grouping'|translate}}</button>-->
<!-- &lt;!&ndash;<button mat-menu-item [matMenuTriggerFor]="progressMenu">{{'Student Progress Table'|translate}}</button>&ndash;&gt;-->
<!-- <button mat-menu-item-->
<!-- routerLink="/reports/studentSubtestReport/{{selectedClass?._id}}">{{'Student Subtest Report'|translate}}</button>-->
<!-- <button mat-menu-item-->
<!-- routerLink="/reports/taskReport/{{selectedClass?._id}}">{{'Task Report'|translate}}</button>-->
<button mat-menu-item
routerLink="/reports/attendance/{{selectedClass?._id}}">{{'Attendance and Behaviour'|translate}}</button>

<!-- <button mat-menu-item-->
<!-- routerLink="/reports/attendance/{{selectedClass?._id}}">{{'Attendance and Behaviour'|translate}}</button>-->

<!-- <button mat-menu-item routerLink="/reports/grades/{{selectedClass.id}}">{{'Grades'|translate}}</button>-->
<!-- </ng-template>-->
</mat-menu>
</span>
<!-- </mat-menu>-->
<!-- </span>-->
4 changes: 4 additions & 0 deletions client/src/app/class/class-nav-bar/class-nav-bar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ export class ClassNavBarComponent implements OnInit {
// enabledClass.name = grade
// const curriculum = this.getCurriculumObject('curriculum', enabledClass.doc)
// this.curriculums[enabledClass.id] = curriculum
const ignoreCurriculumsForTracking = this.dashboardService.getValue('ignoreCurriculumsForTracking', enabledClass.doc)
if (ignoreCurriculumsForTracking) {
enabledClass['ignoreCurriculumsForTracking'] = true
}
await this.dashboardService.populateCurrentCurriculums(enabledClass.doc);
}
})
Expand Down
47 changes: 39 additions & 8 deletions client/src/app/class/reports/attendance/attendance.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,49 @@ td.progress-bar {
padding-left: 1em;
}

#most-recent-class-table {
width:600px;
/*#most-recent-class-table {*/
/* width:600px;*/
/*}*/

/*#past-30-days-table {*/
/* width:600px;*/
/*}*/

/*#last-n-report-table {*/
/* width:600px;*/
/*}*/

.number-cell {
width: 20px;
}

#past-30-days-table {
width:600px;
.selectedClassLabel {
font-size: larger;
font-weight: bold;
padding-bottom: 5px;
padding-left: 5px;
padding-right: 5px;
text-align: center;
}

#last-n-report-table {
width:600px;
.selectedClassLabel p {
text-align: center;
}

.number-cell {
width: 20px;
.dashboard-table {
border-collapse: collapse;
width: 100%;
}

.dashboard-table th {
border: 1px solid #ddd;
padding-top: 12px;
padding-bottom: 12px;
text-align: center;
background-color: #f29d38;
color: white;
}

.dashboard-table .checkbox-response {
text-align: center;
}
Loading

0 comments on commit 8e43f7d

Please sign in to comment.