From 63347a0ff966c7863e5b7431effa1cb0668df893 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 9 Aug 2018 14:55:06 +0200 Subject: Migrate to bootstrap 4 and ng-bootstrap --- client/package.json | 2 +- client/src/app/+admin/admin.module.ts | 2 - .../edit-custom-config.component.html | 513 +++++++++++---------- .../following-add/following-add.component.html | 2 +- .../src/app/+admin/follows/follows.component.html | 12 +- .../src/app/+admin/follows/follows.component.scss | 6 - client/src/app/+admin/follows/follows.component.ts | 8 +- client/src/app/core/confirm/confirm.component.html | 44 +- client/src/app/core/confirm/confirm.component.ts | 37 +- client/src/app/core/core.module.ts | 2 - client/src/app/login/login.component.html | 50 +- client/src/app/login/login.component.ts | 11 +- .../src/app/menu/language-chooser.component.html | 21 +- .../src/app/menu/language-chooser.component.scss | 11 +- client/src/app/menu/language-chooser.component.ts | 16 +- client/src/app/menu/menu.component.html | 28 +- client/src/app/menu/menu.component.scss | 4 + client/src/app/search/search.component.html | 2 +- client/src/app/search/search.module.ts | 4 +- .../shared/forms/markdown-textarea.component.html | 13 +- client/src/app/shared/misc/help.component.html | 3 +- client/src/app/shared/shared.module.ts | 27 +- .../src/app/shared/video/video-feed.component.html | 13 +- .../src/app/shared/video/video-feed.component.scss | 1 + .../shared/video-caption-add-modal.component.html | 76 ++- .../shared/video-caption-add-modal.component.ts | 13 +- .../+video-edit/shared/video-edit.component.html | 380 +++++++-------- .../+video-edit/shared/video-edit.component.scss | 10 +- .../videos/+video-edit/shared/video-edit.module.ts | 2 - .../modal/video-download.component.html | 75 ++- .../+video-watch/modal/video-download.component.ts | 14 +- .../+video-watch/modal/video-report.component.html | 55 +-- .../+video-watch/modal/video-report.component.ts | 13 +- .../+video-watch/modal/video-share.component.html | 82 ++-- .../+video-watch/modal/video-share.component.scss | 7 + .../+video-watch/modal/video-share.component.ts | 15 +- .../modal/video-support.component.html | 28 +- .../+video-watch/modal/video-support.component.ts | 16 +- .../videos/+video-watch/video-watch.component.html | 58 +-- .../videos/+video-watch/video-watch.component.scss | 4 + .../app/videos/+video-watch/video-watch.module.ts | 6 +- client/src/sass/application.scss | 60 ++- client/src/sass/include/_bootstrap.scss | 86 ++-- client/yarn.lock | 8 +- 44 files changed, 890 insertions(+), 950 deletions(-) diff --git a/client/package.json b/client/package.json index e6b6e3b05..0360502f9 100644 --- a/client/package.json +++ b/client/package.json @@ -46,6 +46,7 @@ "@angular/service-worker": "~6.1.0", "@angularclass/hmr": "^2.1.3", "@neos21/bootstrap3-glyphicons": "^1.0.1", + "@ng-bootstrap/ng-bootstrap": "^2.2.2", "@ngx-loading-bar/core": "^2.0.0", "@ngx-loading-bar/http-client": "^2.0.0", "@ngx-loading-bar/router": "^2.0.0", @@ -86,7 +87,6 @@ "linkifyjs": "^2.1.5", "lodash-es": "^4.17.4", "markdown-it": "^8.4.0", - "ngx-bootstrap": "3.0.1", "ngx-chips": "1.9.3", "ngx-clipboard": "11.1.1", "ngx-pipes": "^2.1.7", diff --git a/client/src/app/+admin/admin.module.ts b/client/src/app/+admin/admin.module.ts index 8d50b8715..d7ae2f7f0 100644 --- a/client/src/app/+admin/admin.module.ts +++ b/client/src/app/+admin/admin.module.ts @@ -1,7 +1,6 @@ import { NgModule } from '@angular/core' import { ConfigComponent, EditCustomConfigComponent } from '@app/+admin/config' import { ConfigService } from '@app/+admin/config/shared/config.service' -import { TabsModule } from 'ngx-bootstrap/tabs' import { TableModule } from 'primeng/table' import { SharedModule } from '../shared' import { AdminRoutingModule } from './admin-routing.module' @@ -18,7 +17,6 @@ import { VideoBlacklistComponent, VideoBlacklistListComponent } from './video-bl @NgModule({ imports: [ AdminRoutingModule, - TabsModule.forRoot(), TableModule, SharedModule ], diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html index 0a032df12..49b89cef4 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html @@ -1,290 +1,295 @@
- + - + + -
Instance
+
Instance
-
- - -
- {{ formErrors.instanceName }} -
-
- -
- - -
- {{ formErrors.instanceShortDescription }} -
-
- -
- - -
- {{ formErrors.instanceDescription }} -
-
- -
- - -
- {{ formErrors.instanceTerms }} -
-
- -
- -
- -
-
- {{ formErrors.instanceDefaultClientRoute }} -
-
- -
- - - -
- +
+ + +
+ {{ formErrors.instanceName }} +
-
- {{ formErrors.instanceDefaultNSFWPolicy }} + +
+ + +
+ {{ formErrors.instanceShortDescription }} +
-
- -
Signup
- - - -
- - -
- {{ formErrors.signupLimit }} + +
+ + +
+ {{ formErrors.instanceDescription }} +
-
- -
Import
- - - - - -
Administrator
- -
- - -
- {{ formErrors.adminEmail }} + +
+ + +
+ {{ formErrors.instanceTerms }} +
-
- -
Users
- -
- -
- + +
+ +
+ +
+
+ {{ formErrors.instanceDefaultClientRoute }} +
-
- {{ formErrors.userVideoQuota }} + +
+ + + +
+ +
+
+ {{ formErrors.instanceDefaultNSFWPolicy }} +
-
- - - - -
Twitter
- -
- - - -
- {{ formErrors.servicesTwitterUsername }} + +
Signup
+ + + +
+ + +
+ {{ formErrors.signupLimit }} +
-
- - +
Import
+ + - + -
Transcoding
+
Administrator
- +
+ + +
+ {{ formErrors.adminEmail }} +
+
- +
Users
- +
- +
-
- {{ formErrors.transcodingThreads }} +
+ {{ formErrors.userVideoQuota }}
+ + -
- + + +
Twitter
+
+ + + +
+ {{ formErrors.servicesTwitterUsername }} +
-
-
- Cache - - -
- -
- - -
- {{ formErrors.cachePreviewsSize }} + + + + + + + +
Transcoding
+ + + + + +
+ +
+ +
+
+ {{ formErrors.transcodingThreads }} +
+
+ +
+ + +
+
+ +
+ Cache + +
-
- -
- - -
- {{ formErrors.cacheCaptionsSize }} + +
+ + +
+ {{ formErrors.cachePreviewsSize }} +
-
- -
Customizations
- -
- - - -
- {{ formErrors.customizationJavascript }} + +
+ + +
+ {{ formErrors.cacheCaptionsSize }} +
-
- -
- - - -
- {{ formErrors.customizationCSS }} + +
Customizations
+ +
+ + + +
+ {{ formErrors.customizationJavascript }} +
-
- - + +
+ + + +
+ {{ formErrors.customizationCSS }} +
+
+ + + It seems the configuration is invalid. Please search potential errors in the different tabs. diff --git a/client/src/app/+admin/follows/following-add/following-add.component.html b/client/src/app/+admin/follows/following-add/following-add.component.html index 72635048c..e08decb3f 100644 --- a/client/src/app/+admin/follows/following-add/following-add.component.html +++ b/client/src/app/+admin/follows/following-add/following-add.component.html @@ -18,5 +18,5 @@ It seems that you are not on a HTTPS server. Your webserver needs to have TLS activated in order to follow servers.
- + diff --git a/client/src/app/+admin/follows/follows.component.html b/client/src/app/+admin/follows/follows.component.html index a8258bf70..8eabb3392 100644 --- a/client/src/app/+admin/follows/follows.component.html +++ b/client/src/app/+admin/follows/follows.component.html @@ -1,13 +1,15 @@
Manage follows
- - - + + + + {{ link.title }} - - + + +
diff --git a/client/src/app/+admin/follows/follows.component.scss b/client/src/app/+admin/follows/follows.component.scss index 08b3737f8..766d7853b 100644 --- a/client/src/app/+admin/follows/follows.component.scss +++ b/client/src/app/+admin/follows/follows.component.scss @@ -2,9 +2,3 @@ flex-grow: 0; margin-right: 30px; } - -/deep/ .tab-content { - height: 0; - min-height: 0; - padding: 0; -} diff --git a/client/src/app/+admin/follows/follows.component.ts b/client/src/app/+admin/follows/follows.component.ts index f7af9826c..b6f7715b3 100644 --- a/client/src/app/+admin/follows/follows.component.ts +++ b/client/src/app/+admin/follows/follows.component.ts @@ -1,14 +1,14 @@ import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core' import { NavigationEnd, Router } from '@angular/router' -import { TabsetComponent } from 'ngx-bootstrap/tabs' import { I18n } from '@ngx-translate/i18n-polyfill' +import { NgbTabset } from '@ng-bootstrap/ng-bootstrap' @Component({ templateUrl: './follows.component.html', styleUrls: [ './follows.component.scss' ] }) export class FollowsComponent implements OnInit, AfterViewInit { - @ViewChild('followsMenuTabs') followsMenuTabs: TabsetComponent + @ViewChild('followsMenuTabs') followsMenuTabs: NgbTabset links: { path: string, title: string }[] = [] @@ -53,8 +53,8 @@ export class FollowsComponent implements OnInit, AfterViewInit { for (let i = 0; i < this.links.length; i++) { const path = this.links[i].path - if (url.endsWith(path) === true && this.followsMenuTabs.tabs[i]) { - this.followsMenuTabs.tabs[i].active = true + if (url.endsWith(path) === true) { + this.followsMenuTabs.select(path) return } } diff --git a/client/src/app/core/confirm/confirm.component.html b/client/src/app/core/confirm/confirm.component.html index 0bb64cf00..43f0c6190 100644 --- a/client/src/app/core/confirm/confirm.component.html +++ b/client/src/app/core/confirm/confirm.component.html @@ -1,31 +1,25 @@ - - 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 { .glyphicon { cursor: pointer; font-size: 18px; + + &::after { + border: none; + } } } } diff --git a/client/src/app/search/search.component.html b/client/src/app/search/search.component.html index 7fb2d4f7d..bbc70f772 100644 --- a/client/src/app/search/search.component.html +++ b/client/src/app/search/search.component.html @@ -17,7 +17,7 @@
-
+
diff --git a/client/src/app/search/search.module.ts b/client/src/app/search/search.module.ts index 488046cf1..5a715fb8e 100644 --- a/client/src/app/search/search.module.ts +++ b/client/src/app/search/search.module.ts @@ -4,14 +4,14 @@ import { SearchComponent } from '@app/search/search.component' import { SearchService } from '@app/search/search.service' import { SearchRoutingModule } from '@app/search/search-routing.module' import { SearchFiltersComponent } from '@app/search/search-filters.component' -import { CollapseModule } from 'ngx-bootstrap/collapse' +import { NgbCollapseModule } from '@ng-bootstrap/ng-bootstrap' @NgModule({ imports: [ SearchRoutingModule, SharedModule, - CollapseModule.forRoot() + NgbCollapseModule.forRoot() ], declarations: [ diff --git a/client/src/app/shared/forms/markdown-textarea.component.html b/client/src/app/shared/forms/markdown-textarea.component.html index 802562dd7..3de3b6fcd 100644 --- a/client/src/app/shared/forms/markdown-textarea.component.html +++ b/client/src/app/shared/forms/markdown-textarea.component.html @@ -5,8 +5,13 @@ id="description" name="description"> - - - - + + +
+
+ + +
+
+
diff --git a/client/src/app/shared/misc/help.component.html b/client/src/app/shared/misc/help.component.html index 1c3863e52..42a92d7f0 100644 --- a/client/src/app/shared/misc/help.component.html +++ b/client/src/app/shared/misc/help.component.html @@ -18,9 +18,8 @@ title="Get help" i18n-title [attr.aria-pressed]="isPopoverOpened" - [popover]="tooltipTemplate" + [ngbPopover]="tooltipTemplate" [placement]="tooltipPlacement" - [outsideClick]="true" (onHidden)="onPopoverHidden()" (onShown)="onPopoverShown()" > diff --git a/client/src/app/shared/shared.module.ts b/client/src/app/shared/shared.module.ts index 94de3af9f..ea7f2c887 100644 --- a/client/src/app/shared/shared.module.ts +++ b/client/src/app/shared/shared.module.ts @@ -8,11 +8,6 @@ import { HelpComponent } from '@app/shared/misc/help.component' import { InfiniteScrollerDirective } from '@app/shared/video/infinite-scroller.directive' import { MarkdownService } from '@app/videos/shared' -import { BsDropdownModule } from 'ngx-bootstrap/dropdown' -import { ModalModule } from 'ngx-bootstrap/modal' -import { PopoverModule } from 'ngx-bootstrap/popover' -import { TabsModule } from 'ngx-bootstrap/tabs' -import { TooltipModule } from 'ngx-bootstrap/tooltip' import { BytesPipe, KeysPipe, NgPipesModule } from 'ngx-pipes' import { SharedModule as PrimeSharedModule } from 'primeng/components/common/shared' @@ -53,6 +48,7 @@ import { VideoCaptionService } from '@app/shared/video-caption' import { PeertubeCheckboxComponent } from '@app/shared/forms/peertube-checkbox.component' import { VideoImportService } from '@app/shared/video-import/video-import.service' import { ActionDropdownComponent } from '@app/shared/buttons/action-dropdown.component' +import { NgbDropdownModule, NgbModalModule, NgbPopoverModule, NgbTabsetModule, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap' @NgModule({ imports: [ @@ -62,11 +58,11 @@ import { ActionDropdownComponent } from '@app/shared/buttons/action-dropdown.com RouterModule, HttpClientModule, - BsDropdownModule.forRoot(), - ModalModule.forRoot(), - PopoverModule.forRoot(), - TabsModule.forRoot(), - TooltipModule.forRoot(), + NgbDropdownModule.forRoot(), + NgbModalModule.forRoot(), + NgbPopoverModule.forRoot(), + NgbTabsetModule.forRoot(), + NgbTooltipModule.forRoot(), PrimeSharedModule, NgPipesModule @@ -97,11 +93,12 @@ import { ActionDropdownComponent } from '@app/shared/buttons/action-dropdown.com RouterModule, HttpClientModule, - BsDropdownModule, - ModalModule, - PopoverModule, - TabsModule, - TooltipModule, + NgbDropdownModule, + NgbModalModule, + NgbPopoverModule, + NgbTabsetModule, + NgbTooltipModule, + PrimeSharedModule, BytesPipe, KeysPipe, diff --git a/client/src/app/shared/video/video-feed.component.html b/client/src/app/shared/video/video-feed.component.html index 5ef13e1ed..2e687a7b9 100644 --- a/client/src/app/shared/video/video-feed.component.html +++ b/client/src/app/shared/video/video-feed.component.html @@ -1,13 +1,10 @@ \ No newline at end of file diff --git a/client/src/app/shared/video/video-feed.component.scss b/client/src/app/shared/video/video-feed.component.scss index 2efeb405e..a5d1aabf7 100644 --- a/client/src/app/shared/video/video-feed.component.scss +++ b/client/src/app/shared/video/video-feed.component.scss @@ -5,6 +5,7 @@ @include disable-default-a-behaviour; color: black; + display: block; } .icon { diff --git a/client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.html b/client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.html index 9cd303b29..30aefdbfc 100644 --- a/client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.html +++ b/client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.html @@ -1,47 +1,45 @@ -