diff --git a/src/app/app.component.html b/src/app/app.component.html index c544113..63a77eb 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -8,7 +8,7 @@ HOME STUDENTS' LIST - REBATES + REBATES REBATES ADMIN GUEST ADMIN MESS STATS diff --git a/src/app/app.component.ts b/src/app/app.component.ts index daae789..d3ea7e4 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -123,4 +123,6 @@ export class AppComponent { this.router.navigate([place]) } - } \ No newline at end of file +} + + diff --git a/src/app/auth.service.ts b/src/app/auth.service.ts index 0a28d88..601d1af 100644 --- a/src/app/auth.service.ts +++ b/src/app/auth.service.ts @@ -159,6 +159,7 @@ export class AuthService { getRoll(){ return this.roll_no; } + forgetPassword(username:any) { let url = this.baseurl.concat("/api/change_password"); @@ -173,4 +174,5 @@ export class AuthService { }) ); } + } \ No newline at end of file diff --git a/src/app/home/devices/devices.component.css b/src/app/home/devices/devices.component.css index 3422501..cb16c95 100644 --- a/src/app/home/devices/devices.component.css +++ b/src/app/home/devices/devices.component.css @@ -7,6 +7,7 @@ .device-data{ display: flex; flex-direction: column; + } .device-info{ display: flex; @@ -20,4 +21,8 @@ img{ } p{ padding-right:15px; +} + +h3{ + font-weight: bold; } \ No newline at end of file diff --git a/src/app/home/devices/devices.component.ts b/src/app/home/devices/devices.component.ts index 0f67c71..455d761 100644 --- a/src/app/home/devices/devices.component.ts +++ b/src/app/home/devices/devices.component.ts @@ -7,7 +7,8 @@ import { Component, Input, OnInit } from '@angular/core'; }) export class DevicesComponent implements OnInit { - @Input() device:any; + @Input() device : any ; + constructor() { } ngOnInit(): void { diff --git a/src/app/home/home.component.ts b/src/app/home/home.component.ts index 2c0c3f4..8c9a86d 100644 --- a/src/app/home/home.component.ts +++ b/src/app/home/home.component.ts @@ -13,6 +13,29 @@ export class HomeComponent implements OnInit { public pending_rebates: RebateRequest[] = new Array(); devices:any; + // devices = [ + // { + // hostel: 'Hostel A', + // id: 123, + // sync: '2024-08-15 10:00 AM', + // version: '1.0.3', + // cards: ['Card1', 'Card2', 'Card3'] + // }, + // { + // hostel: 'Hostel B', + // id: 456, + // sync: '2024-08-15 10:05 AM', + // version: '1.0.4', + // cards: ['Card4', 'Card5', 'Card6'] + // }, + // { + // hostel: 'Hostel C', + // id: 789, + // sync: '2024-08-15 10:10 AM', + // version: '1.0.5', + // cards: ['Card7', 'Card8', 'Card9'] + // } + // ]; date:string; constructor(private data_service:StudentdataService, public auth_service: AuthService, private router: Router) { @@ -33,7 +56,8 @@ export class HomeComponent implements OnInit { //FIXME: Remove the console log, maybe log somewhere else console.log(e); }); - + + this.data_service.getDevices().then((res)=>{ this.devices = res; }).catch((e)=>{ diff --git a/src/app/rebate/rebate.component.ts b/src/app/rebate/rebate.component.ts index 1c4856a..ca05652 100644 --- a/src/app/rebate/rebate.component.ts +++ b/src/app/rebate/rebate.component.ts @@ -24,6 +24,10 @@ export class RebateComponent implements OnInit { this.router.navigate(['login']) } // console.log(this.rejected_rebates) + if(!this.auth.isStudent() ){ + this.router.navigate(['landing']) + } + } diff --git a/src/app/rebate/stu-reb-card/stu-reb-card.component.html b/src/app/rebate/stu-reb-card/stu-reb-card.component.html index f29b473..617e12e 100644 --- a/src/app/rebate/stu-reb-card/stu-reb-card.component.html +++ b/src/app/rebate/stu-reb-card/stu-reb-card.component.html @@ -61,14 +61,16 @@ @@ -82,7 +84,8 @@ diff --git a/src/app/rebate/stu-reb-card/stu-reb-card.component.ts b/src/app/rebate/stu-reb-card/stu-reb-card.component.ts index e80c98a..afbdc39 100644 --- a/src/app/rebate/stu-reb-card/stu-reb-card.component.ts +++ b/src/app/rebate/stu-reb-card/stu-reb-card.component.ts @@ -25,6 +25,8 @@ export class StuRebCardComponent implements OnInit { public p_rebate_comment: string; private numToMonth: string[] = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; // @Input() public isApproved: boolean = false; + public on_admin_page:boolean ; + private adminRoutes: string[] = ["/rebate-admin","/studentcard"]; @Input() public approval_state: string = "pending"; @Output() public updateList = new EventEmitter(); @@ -41,6 +43,8 @@ export class StuRebCardComponent implements OnInit { this.p_rebate_reason = ""; this.p_rebate_reason = this.rebate_request.reason; this.p_rebate_comment = this.rebate_request?.comment ?? ""; + this.on_admin_page = this.adminRoutes.some(sub => this.router.url.startsWith(sub)); + // console.log(this.rebate_request) } @@ -115,5 +119,9 @@ export class StuRebCardComponent implements OnInit { console.log(e); }) } + isStudentPage() { + return this.auth.isStudent() && !this.on_admin_page; + } + }