diff options
author | Chocobozzz <me@florianbigard.com> | 2018-08-09 14:55:06 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-09 14:55:06 +0200 |
commit | 63347a0ff966c7863e5b7431effa1cb0668df893 (patch) | |
tree | 8f89d9b4a73f7157103574c05832eff21e338272 /client/src/app/menu | |
parent | b34a444e291c8ec90b4c2c965f7d0d6904d1faa7 (diff) | |
download | PeerTube-63347a0ff966c7863e5b7431effa1cb0668df893.tar.gz PeerTube-63347a0ff966c7863e5b7431effa1cb0668df893.tar.zst PeerTube-63347a0ff966c7863e5b7431effa1cb0668df893.zip |
Migrate to bootstrap 4 and ng-bootstrap
Diffstat (limited to 'client/src/app/menu')
-rw-r--r-- | client/src/app/menu/language-chooser.component.html | 21 | ||||
-rw-r--r-- | client/src/app/menu/language-chooser.component.scss | 11 | ||||
-rw-r--r-- | client/src/app/menu/language-chooser.component.ts | 16 | ||||
-rw-r--r-- | client/src/app/menu/menu.component.html | 28 | ||||
-rw-r--r-- | client/src/app/menu/menu.component.scss | 4 |
5 files changed, 33 insertions, 47 deletions
diff --git a/client/src/app/menu/language-chooser.component.html b/client/src/app/menu/language-chooser.component.html index f941e32f8..c37bf2826 100644 --- a/client/src/app/menu/language-chooser.component.html +++ b/client/src/app/menu/language-chooser.component.html | |||
@@ -1,15 +1,10 @@ | |||
1 | <div bsModal #modal="bs-modal" class="modal" tabindex="-1"> | 1 | <ng-template #modal let-hide="close"> |
2 | <div class="modal-dialog"> | 2 | <div class="modal-header"> |
3 | <div class="modal-content"> | 3 | <h4 i18n class="modal-title">Change the language</h4> |
4 | 4 | <span class="close" aria-label="Close" role="button" (click)="hide()"></span> | |
5 | <div class="modal-header"> | 5 | </div> |
6 | <span class="close" aria-hidden="true" (click)="hide()"></span> | ||
7 | <h4 i18n class="modal-title">Change the language</h4> | ||
8 | </div> | ||
9 | 6 | ||
10 | <div class="modal-body" *ngFor="let lang of languages"> | 7 | <div class="modal-body"> |
11 | <a [href]="buildLanguageLink(lang)">{{ lang.label }}</a> | 8 | <a *ngFor="let lang of languages" [href]="buildLanguageLink(lang)">{{ lang.label }}</a> |
12 | </div> | ||
13 | </div> | ||
14 | </div> | 9 | </div> |
15 | </div> | 10 | </ng-template> |
diff --git a/client/src/app/menu/language-chooser.component.scss b/client/src/app/menu/language-chooser.component.scss index 30c70c6a2..944e86f46 100644 --- a/client/src/app/menu/language-chooser.component.scss +++ b/client/src/app/menu/language-chooser.component.scss | |||
@@ -1,19 +1,12 @@ | |||
1 | @import '_variables'; | 1 | @import '_variables'; |
2 | @import '_mixins'; | 2 | @import '_mixins'; |
3 | 3 | ||
4 | .modal { | ||
5 | z-index: 10005; | ||
6 | } | ||
7 | |||
8 | .modal-title { | ||
9 | text-align: center; | ||
10 | } | ||
11 | |||
12 | .modal-body { | 4 | .modal-body { |
13 | text-align: center; | 5 | text-align: center; |
14 | 6 | ||
15 | a { | 7 | a { |
8 | display: block; | ||
16 | font-size: 16px; | 9 | font-size: 16px; |
17 | margin-top: 10px; | 10 | margin: 15px; |
18 | } | 11 | } |
19 | } \ No newline at end of file | 12 | } \ No newline at end of file |
diff --git a/client/src/app/menu/language-chooser.component.ts b/client/src/app/menu/language-chooser.component.ts index 3de6a129d..45fa73e76 100644 --- a/client/src/app/menu/language-chooser.component.ts +++ b/client/src/app/menu/language-chooser.component.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { Component, ViewChild } from '@angular/core' | 1 | import { Component, ElementRef, ViewChild } from '@angular/core' |
2 | import { ModalDirective } from 'ngx-bootstrap/modal' | ||
3 | import { I18N_LOCALES } from '../../../../shared' | 2 | import { I18N_LOCALES } from '../../../../shared' |
3 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' | ||
4 | 4 | ||
5 | @Component({ | 5 | @Component({ |
6 | selector: 'my-language-chooser', | 6 | selector: 'my-language-chooser', |
@@ -8,21 +8,17 @@ import { I18N_LOCALES } from '../../../../shared' | |||
8 | styleUrls: [ './language-chooser.component.scss' ] | 8 | styleUrls: [ './language-chooser.component.scss' ] |
9 | }) | 9 | }) |
10 | export class LanguageChooserComponent { | 10 | export class LanguageChooserComponent { |
11 | @ViewChild('modal') modal: ModalDirective | 11 | @ViewChild('modal') modal: ElementRef |
12 | 12 | ||
13 | languages: { [ id: string ]: string }[] = [] | 13 | languages: { id: string, label: string }[] = [] |
14 | 14 | ||
15 | constructor () { | 15 | constructor (private modalService: NgbModal) { |
16 | this.languages = Object.keys(I18N_LOCALES) | 16 | this.languages = Object.keys(I18N_LOCALES) |
17 | .map(k => ({ id: k, label: I18N_LOCALES[k] })) | 17 | .map(k => ({ id: k, label: I18N_LOCALES[k] })) |
18 | } | 18 | } |
19 | 19 | ||
20 | show () { | 20 | show () { |
21 | this.modal.show() | 21 | this.modalService.open(this.modal) |
22 | } | ||
23 | |||
24 | hide () { | ||
25 | this.modal.hide() | ||
26 | } | 22 | } |
27 | 23 | ||
28 | buildLanguageLink (lang: { id: string }) { | 24 | buildLanguageLink (lang: { id: string }) { |
diff --git a/client/src/app/menu/menu.component.html b/client/src/app/menu/menu.component.html index c487a6fc1..9657e5269 100644 --- a/client/src/app/menu/menu.component.html +++ b/client/src/app/menu/menu.component.html | |||
@@ -11,24 +11,22 @@ | |||
11 | <div class="logged-in-email">{{ user.username }}</div> | 11 | <div class="logged-in-email">{{ user.username }}</div> |
12 | </div> | 12 | </div> |
13 | 13 | ||
14 | <div class="logged-in-more" dropdown placement="right" container="body"> | 14 | <div class="logged-in-more" ngbDropdown placement="bottom-right"> |
15 | <span class="glyphicon glyphicon-option-vertical" dropdownToggle></span> | 15 | <span class="glyphicon glyphicon-option-vertical" ngbDropdownToggle role="button"></span> |
16 | 16 | ||
17 | <ul *dropdownMenu class="dropdown-menu"> | 17 | <div ngbDropdownMenu> |
18 | <li> | 18 | <a *ngIf="user.account" i18n [routerLink]="[ '/accounts', user.account.nameWithHost ]" class="dropdown-item"> |
19 | <a i18n [routerLink]="[ '/accounts', user.account?.nameWithHost ]" class="dropdown-item" title="My public profile"> | 19 | My public profile |
20 | My public profile | 20 | </a> |
21 | </a> | ||
22 | 21 | ||
23 | <a i18n routerLink="/my-account" class="dropdown-item" title="My account"> | 22 | <a i18n routerLink="/my-account" class="dropdown-item"> |
24 | My account | 23 | My account |
25 | </a> | 24 | </a> |
26 | 25 | ||
27 | <a i18n (click)="logout($event)" class="dropdown-item" title="Log out" href="#"> | 26 | <a i18n (click)="logout($event)" class="dropdown-item" href="#"> |
28 | Log out | 27 | Log out |
29 | </a> | 28 | </a> |
30 | </li> | 29 | </div> |
31 | </ul> | ||
32 | </div> | 30 | </div> |
33 | </div> | 31 | </div> |
34 | 32 | ||
diff --git a/client/src/app/menu/menu.component.scss b/client/src/app/menu/menu.component.scss index e61f4acd3..39f1e9be0 100644 --- a/client/src/app/menu/menu.component.scss +++ b/client/src/app/menu/menu.component.scss | |||
@@ -69,6 +69,10 @@ menu { | |||
69 | .glyphicon { | 69 | .glyphicon { |
70 | cursor: pointer; | 70 | cursor: pointer; |
71 | font-size: 18px; | 71 | font-size: 18px; |
72 | |||
73 | &::after { | ||
74 | border: none; | ||
75 | } | ||
72 | } | 76 | } |
73 | } | 77 | } |
74 | } | 78 | } |