Fixes: Login avatar size, Adds: Login button on sidebar wrapper
This commit is contained in:
parent
65567fc421
commit
2d428dea9b
|
@ -2,7 +2,7 @@
|
|||
<div mat-dialog-title>
|
||||
<div class="row">
|
||||
<div class="col-auto">
|
||||
<img mat-card-avatar *ngIf="this.principalHasAvatar()" [src]="this.getPrincipalAvatar()">
|
||||
<img mat-card-avatar class="my-mat-card-avatar" *ngIf="this.principalHasAvatar()" [src]="this.getPrincipalAvatar()">
|
||||
</div>
|
||||
<span class="user-label col">{{this.getPrincipalName()}}</span>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
$mat-card-header-size: 40px !default;
|
||||
.my-mat-card-avatar {
|
||||
height: $mat-card-header-size;
|
||||
width: $mat-card-header-size;
|
||||
border-radius: 50%;
|
||||
flex-shrink: 0;
|
||||
}
|
|
@ -8,6 +8,7 @@ import { AuthService } from '../../../../core/services/auth/auth.service';
|
|||
@Component({
|
||||
selector: 'app-user-dialog-component',
|
||||
templateUrl: 'user-dialog.component.html',
|
||||
styleUrls: ['user-dialog.component.scss']
|
||||
})
|
||||
export class UserDialogComponent implements OnInit {
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
border: 1px solid rgb(218, 218, 218);
|
||||
border-radius: 6px;
|
||||
padding-left: 10px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.input-search input {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</a>
|
||||
<a class="navbar-brand" routerLink="/home">{{ 'NAV-BAR.BREADCRUMB-ROOT' | translate }}</a>
|
||||
</div>
|
||||
<button mat-raised-button class="navbar-toggler" type="button" (click)="sidebarToggle()">
|
||||
<button class="navbar-toggler" type="button" (click)="sidebarToggle()">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="navbar-toggler-icon icon-bar"></span>
|
||||
<span class="navbar-toggler-icon icon-bar"></span>
|
||||
|
@ -42,11 +42,6 @@
|
|||
</div>
|
||||
</li> -->
|
||||
|
||||
<!-- Login -->
|
||||
<!-- <div *ngIf="isAuthenticated();else loginoption" class="col-auto">
|
||||
<img mat-card-avatar *ngIf="this.principalHasAvatar()" [src]="this.getPrincipalAvatar()" (click)="openProfile()">
|
||||
</div> -->
|
||||
|
||||
<!-- Admin -->
|
||||
<!-- <a *ngIf="isAdmin()" mat-button class="buttonNav navbar-button"
|
||||
routerLink="/users">{{'NAV-BAR.USERS' | translate}}</a>
|
||||
|
@ -55,10 +50,10 @@
|
|||
<a *ngIf="isAdmin()" mat-button class="buttonNav navbar-button" routerLink="/dataset-profiles">{{'NAV-BAR.DATASETS-ADMIN'
|
||||
| translate}}</a> -->
|
||||
|
||||
|
||||
<!-- Login -->
|
||||
<li class="nav-item" *ngIf="isAuthenticated();else loginoption">
|
||||
<a class="nav-link" (click)="openProfile()">
|
||||
<i class="material-icons md-32">person</i>
|
||||
</a>
|
||||
<img mat-card-avatar class="my-mat-card-avatar" *ngIf="this.principalHasAvatar()" [src]="this.getPrincipalAvatar()" (click)="openProfile()">
|
||||
</li>
|
||||
<ng-template #loginoption>
|
||||
<button mat-button [routerLink]=" ['/login'] ">
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
$mat-card-header-size: 40px !default;
|
||||
.my-mat-card-avatar {
|
||||
height: $mat-card-header-size;
|
||||
width: $mat-card-header-size;
|
||||
border-radius: 50%;
|
||||
flex-shrink: 0;
|
||||
}
|
|
@ -11,7 +11,7 @@ import { AppRole } from '../../core/common/enum/app-role';
|
|||
@Component({
|
||||
selector: 'app-navbar',
|
||||
templateUrl: './navbar.component.html',
|
||||
styleUrls: ['./navbar.component.css']
|
||||
styleUrls: ['./navbar.component.css', './navbar.component.scss']
|
||||
})
|
||||
export class NavbarComponent implements OnInit {
|
||||
private listTitles: any[];
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div class="logo">
|
||||
<a href="/home">
|
||||
<div class="logo-img">
|
||||
<img src="/assets/images/OpenDMP.png"/>
|
||||
<img src="/assets/images/OpenDMP.png" />
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
@ -9,8 +9,10 @@
|
|||
|
||||
<!-- MOBILE MENU -->
|
||||
|
||||
<!-- <div *ngIf="isMobileMenu()">
|
||||
<form class="navbar-form">
|
||||
<!-- <div *ngIf="isMobileMenu()"> -->
|
||||
<div>
|
||||
<!-- Search -->
|
||||
<!-- <form class="navbar-form">
|
||||
<span class="bmd-form-group">
|
||||
<div class="input-group no-border">
|
||||
<input type="text" value="" class="form-control" placeholder="Search...">
|
||||
|
@ -20,48 +22,35 @@
|
|||
</button>
|
||||
</div>
|
||||
</span>
|
||||
</form>
|
||||
</form> -->
|
||||
|
||||
<!-- Login -->
|
||||
<ul class="nav navbar-nav nav-mobile-menu">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#pablo">
|
||||
<i class="material-icons">dashboard</i>
|
||||
<p>
|
||||
<span class="d-lg-none d-md-block">Stats</span>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link" href="#pablo" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="material-icons">notifications</i>
|
||||
<span class="notification">5</span>
|
||||
<p>
|
||||
<span class="d-lg-none d-md-block">Some Actions</span>
|
||||
</p>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownMenuLink">
|
||||
<a class="dropdown-item" href="#">Mike John responded to your email</a>
|
||||
<a class="dropdown-item" href="#">You have 5 new tasks</a>
|
||||
<a class="dropdown-item" href="#">You're now friend with Andrew</a>
|
||||
<a class="dropdown-item" href="#">Another Notification</a>
|
||||
<a class="dropdown-item" href="#">Another One</a>
|
||||
</div>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#pablo">
|
||||
<i class="material-icons">person</i>
|
||||
<p>
|
||||
<span class="d-lg-none d-md-block">Account</span>
|
||||
<a class="nav-link" *ngIf="isAuthenticated();else loginoption">
|
||||
<p style="display: flex; align-items: center;" [routerLink]=" ['/profile']">
|
||||
<img mat-card-avatar class="my-mat-card-avatar" *ngIf="this.principalHasAvatar()"
|
||||
[src]="this.getPrincipalAvatar()">
|
||||
<span class="d-lg-none d-md-block">{{ 'SIDE-BAR.ACCOUNT' | translate }}</span>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
<ng-template #loginoption>
|
||||
<button mat-button [routerLink]=" ['/login'] ">
|
||||
<span class="login-label">{{ 'GENERAL.ACTIONS.LOG-IN' | translate }}</span>
|
||||
</button>
|
||||
</ng-template>
|
||||
</ul>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<!-- END OF MOBILE MENU -->
|
||||
|
||||
<ul class="nav" *ngFor="let groupMenuItem of groupMenuItems; last as isLast; first as isFirst">
|
||||
<div class="sidebarSubtitle"><p>{{ groupMenuItem.title }}</p></div>
|
||||
<li routerLinkActive="active" *ngFor="let groupMenuRoute of groupMenuItem.routes" class="{{groupMenuRoute.class}} nav-item">
|
||||
<div class="sidebarSubtitle">
|
||||
<p>{{ groupMenuItem.title }}</p>
|
||||
</div>
|
||||
<li routerLinkActive="active" *ngFor="let groupMenuRoute of groupMenuItem.routes"
|
||||
class="{{groupMenuRoute.class}} nav-item">
|
||||
<a class="nav-link" [routerLink]="[groupMenuRoute.path]">
|
||||
<i *ngIf="isFirst" class="material-icons">{{ groupMenuRoute.icon }}</i>
|
||||
<i *ngIf="!isFirst" class="material-icons-outlined">{{ groupMenuRoute.icon }}</i>
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
$mat-card-header-size: 40px !default;
|
||||
.my-mat-card-avatar {
|
||||
height: $mat-card-header-size;
|
||||
width: $mat-card-header-size;
|
||||
border-radius: 50%;
|
||||
flex-shrink: 0;
|
||||
margin-right: 7px;
|
||||
}
|
|
@ -1,6 +1,8 @@
|
|||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { MatGridTileHeaderCssMatStyler } from '@angular/material';
|
||||
import { MatDialog } from '@angular/material';
|
||||
import { AuthService } from '../../core/services/auth/auth.service';
|
||||
import { UserDialogComponent } from '../misc/navigation/user-dialog/user-dialog.component';
|
||||
|
||||
declare interface RouteInfo {
|
||||
path: string;
|
||||
|
@ -33,7 +35,7 @@ export const PUBLIC_ROUTES: RouteInfo[] = [
|
|||
@Component({
|
||||
selector: 'app-sidebar',
|
||||
templateUrl: './sidebar.component.html',
|
||||
styleUrls: ['./sidebar.component.css']
|
||||
styleUrls: ['./sidebar.component.css', './sidebar.component.scss']
|
||||
})
|
||||
export class SidebarComponent implements OnInit {
|
||||
generalItems: GroupMenuItem;
|
||||
|
@ -42,7 +44,7 @@ export class SidebarComponent implements OnInit {
|
|||
publicItems: GroupMenuItem;
|
||||
groupMenuItems: GroupMenuItem[] = [];
|
||||
|
||||
constructor(public translate: TranslateService) { }
|
||||
constructor(public translate: TranslateService, private authentication: AuthService, private dialog: MatDialog) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.translate.get('SIDE-BAR.DASHBOARD').subscribe((res: string) => {GENERAL_ROUTES[0].title = res});
|
||||
|
@ -81,11 +83,26 @@ export class SidebarComponent implements OnInit {
|
|||
this.translate.get('SIDE-BAR.PUBLIC').subscribe((res: string) => {this.publicItems.title = res});
|
||||
this.groupMenuItems.push(this.publicItems);
|
||||
}
|
||||
// isMobileMenu() {
|
||||
// if ($(window).width() > 991) {
|
||||
// return false;
|
||||
// }
|
||||
// return true;
|
||||
// };
|
||||
|
||||
public principalHasAvatar(): boolean {
|
||||
return this.authentication.current().avatarUrl != null;
|
||||
}
|
||||
|
||||
public getPrincipalAvatar(): string {
|
||||
return this.authentication.current().avatarUrl;
|
||||
}
|
||||
|
||||
public isAuthenticated(): boolean {
|
||||
return !(!this.authentication.current());
|
||||
}
|
||||
|
||||
openProfile() {
|
||||
const dialogRef = this.dialog.open(UserDialogComponent, {
|
||||
hasBackdrop: true,
|
||||
autoFocus: false,
|
||||
closeOnNavigation: true,
|
||||
disableClose: false,
|
||||
position: { top: '64px', right: '1em' }
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
outline: none !important;
|
||||
}
|
||||
|
||||
|
||||
a {
|
||||
color: rgb(106, 164, 217);
|
||||
}
|
||||
|
@ -69,10 +68,8 @@ h4 {
|
|||
|
||||
.sidebar[data-color="danger"] li.active > a {
|
||||
background-color: #ffffff;
|
||||
-webkit-box-shadow: 0 4px 20px 0px rgba(0, 0, 0, 0.14),
|
||||
0 7px 10px -5px rgba(255, 255, 255, 0.4);
|
||||
box-shadow: 0 4px 20px 0px rgba(0, 0, 0, 0.14),
|
||||
0 7px 10px -5px rgba(255, 255, 255, 0.4);
|
||||
-webkit-box-shadow: 0 4px 20px 0px rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(255, 255, 255, 0.4);
|
||||
box-shadow: 0 4px 20px 0px rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(255, 255, 255, 0.4);
|
||||
}
|
||||
|
||||
.sidebar .nav li.active > a i {
|
||||
|
@ -145,10 +142,8 @@ h4 {
|
|||
.card .card-header-default .card-icon,
|
||||
.card .card-header-default:not(.card-header-icon):not(.card-header-text),
|
||||
.card .card-header-default .card-text {
|
||||
-webkit-box-shadow: 0 4px 20px 0px rgba(0, 0, 0, 0.14),
|
||||
0 7px 10px -5px rgba(0, 0, 0, 0.14);
|
||||
box-shadow: 0 4px 20px 0px rgba(0, 0, 0, 0.14),
|
||||
0 7px 10px -5px rgba(0, 0, 0, 0.14);
|
||||
-webkit-box-shadow: 0 4px 20px 0px rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(0, 0, 0, 0.14);
|
||||
box-shadow: 0 4px 20px 0px rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(0, 0, 0, 0.14);
|
||||
}
|
||||
|
||||
.card .card-header-plain .card-icon,
|
||||
|
@ -179,10 +174,8 @@ h4 {
|
|||
.card .card-header-blue .card-icon,
|
||||
.card .card-header-blue:not(.card-header-icon):not(.card-header-text),
|
||||
.card .card-header-blue .card-text {
|
||||
-webkit-box-shadow: 0 4px 20px 0px rgba(0, 0, 0, 0.14),
|
||||
0 7px 10px -5px rgba(0, 0, 0, 0.14);
|
||||
box-shadow: 0 4px 20px 0px rgba(0, 0, 0, 0.14),
|
||||
0 7px 10px -5px rgba(0, 0, 0, 0.14);
|
||||
-webkit-box-shadow: 0 4px 20px 0px rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(0, 0, 0, 0.14);
|
||||
box-shadow: 0 4px 20px 0px rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(0, 0, 0, 0.14);
|
||||
}
|
||||
|
||||
.card-stats .card-header.card-header-icon i {
|
||||
|
@ -233,16 +226,14 @@ h4 {
|
|||
/* font-weight: 500; */
|
||||
}
|
||||
|
||||
.card
|
||||
[class*="card-header-"]:not(.card-header-icon):not(.card-header-text):not(.card-header-image) {
|
||||
.card [class*="card-header-"]:not(.card-header-icon):not(.card-header-text):not(.card-header-image) {
|
||||
border-radius: 5px;
|
||||
margin-top: -20px;
|
||||
padding: 15px;
|
||||
/* border: 1px solid rgb(231, 230, 230); */
|
||||
}
|
||||
|
||||
.card
|
||||
[class*="card-header-plain"]:not(.card-header-icon):not(.card-header-text):not(.card-header-image) {
|
||||
.card [class*="card-header-plain"]:not(.card-header-icon):not(.card-header-text):not(.card-header-image) {
|
||||
border-radius: 5px;
|
||||
margin-top: -20px;
|
||||
padding: 15px;
|
||||
|
|
|
@ -68,7 +68,8 @@
|
|||
"HISTORY-EDITED": "LAST EDITED",
|
||||
"PUBLIC": "PUBLIC",
|
||||
"PUBLIC-DMPS": "PUBLIC DMPs",
|
||||
"PUBLIC-DESC": "PUBLIC DATASET DESCRIPTIONS"
|
||||
"PUBLIC-DESC": "PUBLIC DATASET DESCRIPTIONS",
|
||||
"ACCOUNT": "ACCOUNT"
|
||||
},
|
||||
"DATASET-PROFILE-EDITOR": {
|
||||
"TITLE": {
|
||||
|
|
Loading…
Reference in New Issue