mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
d6de6fee6c
commit
d7f1d37e41
@@ -7,7 +7,7 @@
|
||||
|
||||
<nav role="navigation" [attr.aria-label]="'nav.user.description' | translate" class="navbar navbar-light navbar-expand-md flex-shrink-0 px-0">
|
||||
<ds-themed-search-navbar></ds-themed-search-navbar>
|
||||
<ds-lang-switch></ds-lang-switch>
|
||||
<ds-themed-lang-switch></ds-themed-lang-switch>
|
||||
<ds-context-help-toggle></ds-context-help-toggle>
|
||||
<ds-themed-auth-nav-menu></ds-themed-auth-nav-menu>
|
||||
<ds-impersonate-navbar></ds-impersonate-navbar>
|
||||
|
@@ -33,7 +33,7 @@ export class LangSwitchComponent implements OnInit {
|
||||
this.activeLangs = environment.languages.filter((MyLangConfig) => MyLangConfig.active === true);
|
||||
this.moreThanOneLanguage = (this.activeLangs.length > 1);
|
||||
if (!this.moreThanOneLanguage) {
|
||||
this.el.nativeElement.style.display = 'none';
|
||||
this.el.nativeElement.parentElement.classList.add('d-none');
|
||||
}
|
||||
}
|
||||
|
||||
|
27
src/app/shared/lang-switch/themed-lang-switch.component.ts
Normal file
27
src/app/shared/lang-switch/themed-lang-switch.component.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { ThemedComponent } from '../theme-support/themed.component';
|
||||
import { LangSwitchComponent } from './lang-switch.component';
|
||||
|
||||
/**
|
||||
* Themed wrapper for {@link LangSwitchComponent}
|
||||
*/
|
||||
@Component({
|
||||
selector: 'ds-themed-lang-switch',
|
||||
styleUrls: [],
|
||||
templateUrl: '../theme-support/themed.component.html',
|
||||
})
|
||||
export class ThemedLangSwitchComponent extends ThemedComponent<LangSwitchComponent> {
|
||||
|
||||
protected getComponentName(): string {
|
||||
return 'LangSwitchComponent';
|
||||
}
|
||||
|
||||
protected importThemedComponent(themeName: string): Promise<any> {
|
||||
return import(`../../../themes/${themeName}/app/shared/lang-switch/lang-switch.component`);
|
||||
}
|
||||
|
||||
protected importUnthemedComponent(): Promise<any> {
|
||||
return import(`./lang-switch.component`);
|
||||
}
|
||||
|
||||
}
|
@@ -281,6 +281,7 @@ import {
|
||||
} from '../item-page/simple/field-components/specific-field/title/themed-item-page-field.component';
|
||||
import { BitstreamListItemComponent } from './object-list/bitstream-list-item/bitstream-list-item.component';
|
||||
import { NgxPaginationModule } from 'ngx-pagination';
|
||||
import { ThemedLangSwitchComponent } from './lang-switch/themed-lang-switch.component';
|
||||
|
||||
const MODULES = [
|
||||
CommonModule,
|
||||
@@ -332,6 +333,7 @@ const COMPONENTS = [
|
||||
DsSelectComponent,
|
||||
ErrorComponent,
|
||||
LangSwitchComponent,
|
||||
ThemedLangSwitchComponent,
|
||||
LoadingComponent,
|
||||
ThemedLoadingComponent,
|
||||
LogInComponent,
|
||||
|
@@ -0,0 +1,12 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { LangSwitchComponent as BaseComponent } from '../../../../../app/shared/lang-switch/lang-switch.component';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-lang-switch',
|
||||
// styleUrls: ['./lang-switch.component.scss'],
|
||||
styleUrls: ['../../../../../app/shared/lang-switch/lang-switch.component.scss'],
|
||||
// templateUrl: './lang-switch.component.html',
|
||||
templateUrl: '../../../../../app/shared/lang-switch/lang-switch.component.html',
|
||||
})
|
||||
export class LangSwitchComponent extends BaseComponent {
|
||||
}
|
@@ -54,6 +54,7 @@ import {
|
||||
ItemSearchResultListElementComponent
|
||||
} from './app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component';
|
||||
import { TopLevelCommunityListComponent } from './app/home-page/top-level-community-list/top-level-community-list.component';
|
||||
import { LangSwitchComponent } from './app/shared/lang-switch/lang-switch.component';
|
||||
|
||||
|
||||
/**
|
||||
@@ -91,6 +92,7 @@ const DECLARATIONS = [
|
||||
EditCollectionSelectorComponent,
|
||||
EditCommunitySelectorComponent,
|
||||
EditItemSelectorComponent,
|
||||
LangSwitchComponent,
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
|
@@ -7,7 +7,7 @@
|
||||
</div>
|
||||
<div class="d-flex flex-grow-1 ml-auto justify-content-end align-items-center">
|
||||
<ds-themed-search-navbar></ds-themed-search-navbar>
|
||||
<ds-lang-switch></ds-lang-switch>
|
||||
<ds-themed-lang-switch></ds-themed-lang-switch>
|
||||
<ds-context-help-toggle></ds-context-help-toggle>
|
||||
<ds-themed-auth-nav-menu></ds-themed-auth-nav-menu>
|
||||
<ds-impersonate-navbar></ds-impersonate-navbar>
|
||||
|
@@ -16,7 +16,7 @@
|
||||
</ul>
|
||||
</div>
|
||||
<ds-search-navbar class="navbar-collapsed"></ds-search-navbar>
|
||||
<ds-lang-switch class="navbar-collapsed"></ds-lang-switch>
|
||||
<ds-themed-lang-switch class="navbar-collapsed"></ds-themed-lang-switch>
|
||||
<ds-context-help-toggle class="navbar-collapsed"></ds-context-help-toggle>
|
||||
<ds-themed-auth-nav-menu class="navbar-collapsed"></ds-themed-auth-nav-menu>
|
||||
<ds-impersonate-navbar class="navbar-collapsed"></ds-impersonate-navbar>
|
||||
|
Reference in New Issue
Block a user