mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 02:26:55 -07:00
Moved around the user preferences
This commit is contained in:
parent
caf8c16a4f
commit
612fbb213f
3 changed files with 15 additions and 32 deletions
|
@ -5,18 +5,6 @@
|
|||
|
||||
<mat-toolbar class="application-name" id="nav-applicationName">{{applicationName}}</mat-toolbar>
|
||||
|
||||
<div class="outer-profile">
|
||||
<div class="profile-img-container">
|
||||
<div class="profile-img">
|
||||
<img id="profile-image"
|
||||
src="https://www.gravatar.com/avatar/{{emailHash}}?d={{applicationLogo ? applicationLogo : 'https://raw.githubusercontent.com/Ombi-app/Ombi/gh-pages/img/android-chrome-512x512.png'}}" />
|
||||
</div>
|
||||
<div class="profile-info">
|
||||
<h3 id="profile-username">{{username}}</h3>
|
||||
<p>{{welcomeText | translate}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<mat-nav-list>
|
||||
<span *ngFor="let nav of navItems">
|
||||
|
||||
|
@ -73,7 +61,7 @@
|
|||
</div>
|
||||
</span>
|
||||
</div>
|
||||
<div class="col-2 top-filter">
|
||||
<div class="col-1 top-filter">
|
||||
<button id="search-filter" mat-icon-button [matMenuTriggerFor]="filterMenu">
|
||||
<i class="fa-lg fas fa-filter"></i>
|
||||
</button>
|
||||
|
@ -92,6 +80,11 @@
|
|||
{{ 'NavigationBar.Filter.People' | translate}}</mat-slide-toggle> -->
|
||||
</mat-menu>
|
||||
</div>
|
||||
<div class="col-1">
|
||||
<a routerLink="/user-preferences">
|
||||
<img [matTooltip]="username" class="profile-img" [src]="getUserImage()" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</mat-toolbar>
|
||||
|
||||
|
|
|
@ -69,10 +69,11 @@
|
|||
text-align: center;
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.profile-img {
|
||||
float: left;
|
||||
height: 40px;
|
||||
margin-right: 15px;
|
||||
width: 45px;
|
||||
border-radius: 100%;
|
||||
}
|
||||
.profile-info {
|
||||
overflow: hidden;
|
||||
|
|
|
@ -8,8 +8,9 @@ import { SettingsService, SettingsStateService } from '../services';
|
|||
import { MatSlideToggleChange } from '@angular/material/slide-toggle';
|
||||
import { SearchFilter } from './SearchFilter';
|
||||
import { Md5 } from 'ts-md5/dist/md5';
|
||||
import { RequestType } from '../interfaces';
|
||||
import { IUser, RequestType, UserType } from '../interfaces';
|
||||
import { FilterService } from '../discover/services/filter-service';
|
||||
import { ILocalUser } from '../auth/IUserLogin';
|
||||
|
||||
export enum SearchFilterType {
|
||||
Movie = 1,
|
||||
|
@ -62,7 +63,6 @@ export class MyNavComponent implements OnInit {
|
|||
tvShows: true
|
||||
}
|
||||
|
||||
this.setWelcomeText();
|
||||
if (this.email) {
|
||||
const md5 = new Md5();
|
||||
this.emailHash = md5.appendStr(this.email).end();
|
||||
|
@ -92,8 +92,7 @@ export class MyNavComponent implements OnInit {
|
|||
{ id: "nav-userDonate", name: "NavigationBar.Donate", icon: "fas fa-dollar-sign", link: customizationSettings.customDonationUrl, externalLink: true, requiresAdmin: false, enabled: customizationSettings.enableCustomDonations, toolTip: true, toolTipMessage: customizationSettings.customDonationMessage },
|
||||
{ id: "nav-featureSuggestion", name: "NavigationBar.FeatureSuggestion", icon: "far fa-lightbulb", link: "https://features.ombi.io/", externalLink: true, requiresAdmin: true, enabled: true, toolTip: true, toolTipMessage: 'NavigationBar.FeatureSuggestionTooltip'},
|
||||
{ id: "nav-settings", name: "NavigationBar.Settings", icon: "fas fa-cogs", link: "/Settings/About", requiresAdmin: true, enabled: true },
|
||||
{ id: "nav-userPreferences", name: "NavigationBar.UserPreferences", icon: "fas fa-user", link: "/user-preferences", requiresAdmin: false, enabled: true },
|
||||
];
|
||||
];
|
||||
}
|
||||
|
||||
public logOut() {
|
||||
|
@ -119,18 +118,8 @@ export class MyNavComponent implements OnInit {
|
|||
this.store.save("searchFilter", JSON.stringify(this.searchFilter));
|
||||
}
|
||||
|
||||
private setWelcomeText() {
|
||||
var d = new Date();
|
||||
var hour = d.getHours();
|
||||
|
||||
if (hour >= 0 && hour < 12) {
|
||||
this.welcomeText = 'NavigationBar.MorningWelcome';
|
||||
}
|
||||
if (hour >= 12 && hour < 18) {
|
||||
this.welcomeText = 'NavigationBar.AfternoonWelcome';
|
||||
}
|
||||
if (hour >= 18 && hour < 24) {
|
||||
this.welcomeText = 'NavigationBar.EveningWelcome';
|
||||
}
|
||||
public getUserImage(): string {
|
||||
var fallback = this.applicationLogo ? this.applicationLogo : 'https://raw.githubusercontent.com/Ombi-app/Ombi/gh-pages/img/android-chrome-512x512.png';
|
||||
return `https://www.gravatar.com/avatar/${this.emailHash}?d=${fallback}`;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue