+import { HotkeysService } from 'angular2-hotkeys'
import { Component, OnInit, ViewChild } from '@angular/core'
-import { UserRight } from '../../../../shared/models/users/user-right.enum'
-import { AuthService, AuthStatus, RedirectService, ServerService } from '../core'
-import { User } from '@app/shared/users/user.model'
-import { UserService } from '@app/shared/users/user.service'
+import { AuthService, AuthStatus, RedirectService, ScreenService, ServerService, User, UserService } from '@app/core'
import { LanguageChooserComponent } from '@app/menu/language-chooser.component'
-import { HotkeysService } from 'angular2-hotkeys'
-import { ServerConfig, VideoConstant } from '@shared/models'
import { QuickSettingsModalComponent } from '@app/modal/quick-settings-modal.component'
import { I18n } from '@ngx-translate/i18n-polyfill'
+import { ServerConfig, UserRight, VideoConstant } from '@shared/models'
@Component({
selector: 'my-menu',
[UserRight.MANAGE_USERS]: '/admin/users',
[UserRight.MANAGE_SERVER_FOLLOW]: '/admin/friends',
[UserRight.MANAGE_VIDEO_ABUSES]: '/admin/moderation/video-abuses',
- [UserRight.MANAGE_VIDEO_BLACKLIST]: '/admin/moderation/video-blacklist',
+ [UserRight.MANAGE_VIDEO_BLACKLIST]: '/admin/moderation/video-blocks',
[UserRight.MANAGE_JOBS]: '/admin/jobs',
[UserRight.MANAGE_CONFIGURATION]: '/admin/config'
}
private serverService: ServerService,
private redirectService: RedirectService,
private hotkeysService: HotkeysService,
+ private screenService: ScreenService,
private i18n: I18n
- ) {}
+ ) { }
+
+ get isInMobileView () {
+ return this.screenService.isInMobileView()
+ }
+
+ get placement () {
+ if (this.isInMobileView) {
+ return 'left-top auto'
+ } else {
+ return 'right-top auto'
+ }
+ }
ngOnInit () {
this.serverConfig = this.serverService.getTmpConfig()
}
langForLocale (localeId: string) {
+ if (localeId === '_unknown') return this.i18n('Unknown')
+
return this.languages.find(lang => lang.id === localeId).label
}