diff options
Diffstat (limited to 'frontend/src/app/_pages/profile')
-rw-r--r-- | frontend/src/app/_pages/profile/profile.component.css | 20 | ||||
-rw-r--r-- | frontend/src/app/_pages/profile/profile.component.html | 19 | ||||
-rw-r--r-- | frontend/src/app/_pages/profile/profile.component.ts | 9 |
3 files changed, 29 insertions, 19 deletions
diff --git a/frontend/src/app/_pages/profile/profile.component.css b/frontend/src/app/_pages/profile/profile.component.css index 428870da..bbd4c9ba 100644 --- a/frontend/src/app/_pages/profile/profile.component.css +++ b/frontend/src/app/_pages/profile/profile.component.css @@ -1,21 +1,25 @@ -.card{ +.card { background-color: transparent; - color:var(--offwhite) + color: var(--offwhite) } -.card-header{ +.card-header { background-color: var(--ns-primary-50); - color:var(--offwhite) + color: var(--offwhite) } -.card-body{ + +.card-body { background-color: var(--ns-bg-dark-50); } -mat-form-field{ +mat-form-field { width: 100%; } -.danger-Text{ - color:var(--ns-warn) +.danger-Text { + color: var(--ns-warn) } +.selectedPicture { + background-color: var(--ns-accent); +}
\ No newline at end of file diff --git a/frontend/src/app/_pages/profile/profile.component.html b/frontend/src/app/_pages/profile/profile.component.html index 37df4f14..8d655513 100644 --- a/frontend/src/app/_pages/profile/profile.component.html +++ b/frontend/src/app/_pages/profile/profile.component.html @@ -12,7 +12,7 @@ <img class="img-account-profile rounded-circle mb-2" src="{{this.photoPath}}" alt="profilePicture"> <!-- User's info --> <span>@ {{this.user.username}}</span> - <span class="mt-3" style="font-weight: bold;">{{this.user.firstName}} {{this.user.lastName}}</span> + <span class="mt-3" style="font-weight: bold;">{{this.user.firstName}} {{this.user.lastName}}</span> </div> </div> </div> @@ -31,7 +31,7 @@ <mat-form-field appearance="fill"> <mat-label>Važeća lozinka</mat-label> <input matInput id="inputPassword" name="inputPassword" type="password" placeholder="" [(ngModel)]="this.oldPass"> - </mat-form-field> + </mat-form-field> <small *ngIf="wrongOldPassBool" class="form-text danger-Text">Pogrešan format.</small> </div> <!-- Form Group (new password)--> @@ -39,12 +39,12 @@ <mat-form-field appearance="fill"> <mat-label>Nova lozinka</mat-label> <input matInput id="inputNewPassword" name="inputNewPassword" type="password" placeholder="" [(ngModel)]="this.newPass1"> - </mat-form-field> + </mat-form-field> <small *ngIf="wrongNewPassBool" class="form-text danger-Text">Lozinke se ne podudaraju.</small> <small *ngIf="wrongNewPass1Bool" class="form-text danger-Text">Pogrešan format.</small> </div> </div> - + <!-- Form Row--> <div class="row gx-3 mb-3"> <div class="col-md-6"> @@ -118,24 +118,23 @@ <div> <label class="small mt-2 mb-3">Kliknite na sliku kako biste je odabrali za profilnu:</label> - + <div class="container"> <div class="card-group"> <!--bootstrap card with 3 horizontal images--> <div class="row overflow-auto" style="max-height: 200px;"> - <div class="card col-md-3" *ngFor="let picture of this.pictures" (click)="this.photoId = picture.photoId.toString()" - [ngClass]="{'selectedPicture': this.photoId == picture.photoId.toString()}"> + <div class="card col-md-3" *ngFor="let picture of this.pictures" (click)="this.photoId = picture.photoId.toString()" [ngClass]="{'selectedPicture': this.photoId == picture.photoId.toString()}"> <img src="{{picture.path}}"> </div> </div> </div> </div> </div> - + <div class="row mt-5"> <div class="col text-center"> <!-- Save changes button--> - <button mat-raised-button color="primary" (click)="saveInfoChanges()" >Sačuvaj izmene</button> + <button mat-raised-button color="primary" (click)="saveInfoChanges()">Sačuvaj izmene</button> </div> </div> </form> @@ -147,7 +146,7 @@ <div class="row"> <div class="col-xl-4"> - + </div> </div> diff --git a/frontend/src/app/_pages/profile/profile.component.ts b/frontend/src/app/_pages/profile/profile.component.ts index ae9fb12c..fdcd347c 100644 --- a/frontend/src/app/_pages/profile/profile.component.ts +++ b/frontend/src/app/_pages/profile/profile.component.ts @@ -28,6 +28,8 @@ export class ProfileComponent implements OnInit { newPass2: string = ''; photoId: string = ''; photoPath: string = ''; + isPermament:boolean=false; + dateCreated:Date=new Date(); wrongPassBool: boolean = false; wrongNewPassBool: boolean = false; @@ -60,6 +62,9 @@ export class ProfileComponent implements OnInit { this.firstName = this.user.firstName; this.lastName = this.user.lastName; this.photoId = this.user.photoId; + this.dateCreated=this.user.dateCreated; + this.isPermament=this.user.isPermament; + for (let i = 0; i < this.pictures.length; i++) { if (this.pictures[i].photoId.toString() === this.photoId) { @@ -81,7 +86,9 @@ export class ProfileComponent implements OnInit { password: this.user.password, firstName: this.firstName, lastName: this.lastName, - photoId: this.photoId + photoId: this.photoId, + isPermament:this.isPermament, + dateCreated:this.dateCreated } this.userInfoService.changeUserInfo(editedUser).subscribe((response: any) =>{ |