1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00

updating random photo url settings

This commit is contained in:
Patrik J. Braun 2018-10-23 00:33:17 +02:00
parent 05f8a86cb3
commit 2d23dd37b9
5 changed files with 17 additions and 6 deletions

View File

@ -22,7 +22,8 @@
<li class="nav-item ml-2">
<app-language class="navbar-btn" isDark="true"></app-language>
</li>
<div class="btn-group" dropdown placement="bottom right" container="body" >
<div class="btn-group" dropdown placement="bottom right" container="body"
*ngIf="isAdmin() || authenticationRequired">
<button id="button-basic" dropdownToggle
type="button" class="btn btn-dark dropdown-toggle"
aria-controls="dropdown-basic">
@ -32,8 +33,8 @@
</button>
<ul id="dropdown-basic" *dropdownMenu
class="dropdown-menu dropdown-menu-right"
role="menu" aria-labelledby="button-basic" >
<ng-content select="[navbar-menu]"></ng-content>
role="menu" aria-labelledby="button-basic">
<ng-content select="[navbar-menu]"></ng-content>
<li role="menuitem" *ngIf="isAdmin()">
<a class="dropdown-item" href="#" [routerLink]="['/admin']">
<span class="oi oi-wrench"></span>

View File

@ -1,4 +1,4 @@
import {Component, ViewEncapsulation} from '@angular/core';
import {Component, ElementRef, ViewChild, ViewEncapsulation} from '@angular/core';
import {RouterLink} from '@angular/router';
import {AuthenticationService} from '../model/network/authentication.service';
import {UserDTO, UserRoles} from '../../../common/entities/UserDTO';

View File

@ -10,7 +10,7 @@ import {IPrivateConfig} from '../../../../common/config/private/IPrivateConfig';
import {I18n} from '@ngx-translate/i18n-polyfill';
export abstract class SettingsComponent<T, S extends AbstractSettingsService<T>= AbstractSettingsService<T>>
export abstract class SettingsComponent<T, S extends AbstractSettingsService<T> = AbstractSettingsService<T>>
implements OnInit, OnDestroy, OnChanges {
@Input()
@ -79,7 +79,9 @@ export abstract class SettingsComponent<T, S extends AbstractSettingsService<T>=
}
ngOnChanges(): void {
this.hasAvailableSettings = (this._settingsService.isSupported() || !this.simplifiedMode);
this.hasAvailableSettings = ((this._settingsService.isSupported() &&
this._settingsService.showInSimplifiedMode())
|| !this.simplifiedMode);
}

View File

@ -15,6 +15,10 @@ export abstract class AbstractSettingsService<T> {
return this._settingsService.getSettings();
}
public showInSimplifiedMode(): boolean {
return true;
}
isSupported() {
return true;
}

View File

@ -14,6 +14,10 @@ export class RandomPhotoSettingsService extends AbstractSettingsService<ClientCo
}
public showInSimplifiedMode(): boolean {
return false;
}
public isSupported(): boolean {
return this._settingsService.settings.value.Server.database.type !== DatabaseType.memory;
}