nav dropdown menu styling
This commit is contained in:
parent
0b779dfd3d
commit
b8921713eb
|
@ -1,6 +1,6 @@
|
|||
<nav class="navbar navbar-expand navbar-dark bg-primary" [ngClass]="{'bg-secondary-alt': selfHosted}">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" routerLink="/">
|
||||
<a class="navbar-brand" routerLink="/" title="{{'pageTitle' | i18n : 'Bitwarden'}}">
|
||||
<i class="fa fa-shield"></i>
|
||||
</a>
|
||||
<div class="collapse navbar-collapse">
|
||||
|
@ -22,11 +22,28 @@
|
|||
<i class="fa fa-user fa-lg"></i>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="nav-profile">
|
||||
<a class="dropdown-item" href="#">Help</a>
|
||||
<a class="dropdown-item" href="#">Get the Apps</a>
|
||||
<span class="dropdown-item-text">
|
||||
{{'loggedInAs' | i18n}}
|
||||
<small class="text-muted">{{email}}</small>
|
||||
</span>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="#" appStopClick (click)="lock()">{{'lockNow' | i18n}}</a>
|
||||
<a class="dropdown-item" href="#" appStopClick (click)="logOut()">{{'logOut' | i18n}}</a>
|
||||
<a class="dropdown-item" href="https://help.bitwarden.com" target="_blank" rel="noopener">
|
||||
<i class="fa fa-fw fa-question-circle"></i>
|
||||
{{'getHelp' | i18n}}
|
||||
</a>
|
||||
<a class="dropdown-item" href="https://bitwarden.com#download" target="_blank" rel="noopener">
|
||||
<i class="fa fa-fw fa-download"></i>
|
||||
{{'getApps' | i18n}}
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<button type="button" class="dropdown-item" (click)="lock()">
|
||||
<i class="fa fa-fw fa-lock"></i>
|
||||
{{'lockNow' | i18n}}
|
||||
</button>
|
||||
<button type="button" class="dropdown-item" (click)="logOut()">
|
||||
<i class="fa fa-fw fa-sign-out"></i>
|
||||
{{'logOut' | i18n}}
|
||||
</button>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -1,21 +1,29 @@
|
|||
import {
|
||||
Component,
|
||||
OnInit,
|
||||
} from '@angular/core';
|
||||
|
||||
import { MessagingService } from 'jslib/abstractions/messaging.service';
|
||||
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
|
||||
import { UserService } from 'jslib/abstractions/user.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-navbar',
|
||||
templateUrl: 'navbar.component.html',
|
||||
})
|
||||
export class NavbarComponent {
|
||||
export class NavbarComponent implements OnInit {
|
||||
selfHosted = false;
|
||||
email: string;
|
||||
|
||||
constructor(private messagingService: MessagingService, private platformUtilsService: PlatformUtilsService) {
|
||||
constructor(private messagingService: MessagingService, private platformUtilsService: PlatformUtilsService,
|
||||
private userService: UserService) {
|
||||
this.selfHosted = this.platformUtilsService.isSelfHost();
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
this.email = await this.userService.getEmail();
|
||||
}
|
||||
|
||||
lock() {
|
||||
this.messagingService.send('lockVault');
|
||||
}
|
||||
|
|
|
@ -1681,5 +1681,14 @@
|
|||
},
|
||||
"defaultCollection": {
|
||||
"message": "Default Collection"
|
||||
},
|
||||
"getHelp": {
|
||||
"message": "Get Help"
|
||||
},
|
||||
"getApps": {
|
||||
"message": "Get the Apps"
|
||||
},
|
||||
"loggedInAs": {
|
||||
"message": "Logged in as"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -105,6 +105,22 @@ input, select, textarea {
|
|||
.navbar {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
|
||||
.dropdown-menu {
|
||||
min-width: 200px;
|
||||
max-width: 250px;
|
||||
|
||||
.dropdown-item-text {
|
||||
line-height: 1.3;
|
||||
|
||||
small {
|
||||
display: block;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.navbar-brand {
|
||||
|
@ -112,6 +128,12 @@ input, select, textarea {
|
|||
margin-bottom: -20px;
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
button {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.container {
|
||||
width: 980px;
|
||||
max-width: none !important;
|
||||
|
|
Loading…
Reference in New Issue