aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app')
-rw-r--r--client/src/app/search/search-filters.component.scss2
-rw-r--r--client/src/app/shared/images/preview-upload.component.html6
-rw-r--r--client/src/app/shared/images/preview-upload.component.scss6
-rw-r--r--client/src/app/shared/images/preview-upload.component.ts16
-rw-r--r--client/src/app/videos/+video-edit/shared/video-edit.component.html4
-rw-r--r--client/src/app/videos/+video-edit/shared/video-edit.component.scss59
-rw-r--r--client/src/app/videos/+video-edit/video-add-components/video-send.scss6
-rw-r--r--client/src/app/videos/+video-edit/video-add-components/video-upload.component.html3
8 files changed, 80 insertions, 22 deletions
diff --git a/client/src/app/search/search-filters.component.scss b/client/src/app/search/search-filters.component.scss
index edd85bc70..a88a1c0b0 100644
--- a/client/src/app/search/search-filters.component.scss
+++ b/client/src/app/search/search-filters.component.scss
@@ -66,4 +66,4 @@ input[type=submit] {
66 white-space: nowrap; 66 white-space: nowrap;
67} 67}
68 68
69@include ng2-tags 69@include ng2-tags;
diff --git a/client/src/app/shared/images/preview-upload.component.html b/client/src/app/shared/images/preview-upload.component.html
index 5e1d5211b..7c3a2b588 100644
--- a/client/src/app/shared/images/preview-upload.component.html
+++ b/client/src/app/shared/images/preview-upload.component.html
@@ -1,13 +1,11 @@
1<div class="root"> 1<div class="root">
2 <div class="preview-container"> 2 <div class="preview-container">
3 <my-reactive-file 3 <my-reactive-file
4 [inputName]="inputName" [inputLabel]="inputLabel" [extensions]="videoImageExtensions" [maxFileSize]="maxVideoImageSize" 4 [inputName]="inputName" [inputLabel]="inputLabel" [extensions]="videoImageExtensions" [maxFileSize]="maxVideoImageSize" placement="right"
5 icon="edit" (fileChanged)="onFileChanged($event)" 5 icon="edit" (fileChanged)="onFileChanged($event)" [ngbTooltip]="'(extensions: '+ videoImageExtensions +', '+ maxSizeText +': '+ maxVideoImageSizeInBytes +')'"
6 ></my-reactive-file> 6 ></my-reactive-file>
7 7
8 <img *ngIf="imageSrc" [ngStyle]="{ width: previewWidth, height: previewHeight }" [src]="imageSrc" class="preview" /> 8 <img *ngIf="imageSrc" [ngStyle]="{ width: previewWidth, height: previewHeight }" [src]="imageSrc" class="preview" />
9 <div *ngIf="!imageSrc" [ngStyle]="{ width: previewWidth, height: previewHeight }" class="preview no-image"></div> 9 <div *ngIf="!imageSrc" [ngStyle]="{ width: previewWidth, height: previewHeight }" class="preview no-image"></div>
10 </div> 10 </div>
11
12 <div i18n class="file-constraints">(extensions: {{ allowedExtensionsMessage }}, max size: {{ maxVideoImageSize | bytes }})</div>
13</div> 11</div>
diff --git a/client/src/app/shared/images/preview-upload.component.scss b/client/src/app/shared/images/preview-upload.component.scss
index 257060239..8f3522115 100644
--- a/client/src/app/shared/images/preview-upload.component.scss
+++ b/client/src/app/shared/images/preview-upload.component.scss
@@ -16,11 +16,13 @@
16 } 16 }
17 17
18 .preview { 18 .preview {
19 border: 2px solid grey; 19 object-fit: cover;
20 border-radius: 4px; 20 border-radius: 4px;
21 max-width: 100%;
21 22
22 &.no-image { 23 &.no-image {
23 background-color: #ececec; 24 border: 2px solid grey;
25 background-color: var(--mainBackgroundColor);
24 } 26 }
25 } 27 }
26 } 28 }
diff --git a/client/src/app/shared/images/preview-upload.component.ts b/client/src/app/shared/images/preview-upload.component.ts
index 85a2173e9..7519734ba 100644
--- a/client/src/app/shared/images/preview-upload.component.ts
+++ b/client/src/app/shared/images/preview-upload.component.ts
@@ -3,6 +3,8 @@ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'
3import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser' 3import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser'
4import { ServerService } from '@app/core' 4import { ServerService } from '@app/core'
5import { ServerConfig } from '@shared/models' 5import { ServerConfig } from '@shared/models'
6import { BytesPipe } from 'ngx-pipes'
7import { I18n } from '@ngx-translate/i18n-polyfill'
6 8
7@Component({ 9@Component({
8 selector: 'my-preview-upload', 10 selector: 'my-preview-upload',
@@ -24,14 +26,20 @@ export class PreviewUploadComponent implements OnInit, ControlValueAccessor {
24 26
25 imageSrc: SafeResourceUrl 27 imageSrc: SafeResourceUrl
26 allowedExtensionsMessage = '' 28 allowedExtensionsMessage = ''
29 maxSizeText: string
27 30
28 private serverConfig: ServerConfig 31 private serverConfig: ServerConfig
32 private bytesPipe: BytesPipe
29 private file: Blob 33 private file: Blob
30 34
31 constructor ( 35 constructor (
32 private sanitizer: DomSanitizer, 36 private sanitizer: DomSanitizer,
33 private serverService: ServerService 37 private serverService: ServerService,
34 ) {} 38 private i18n: I18n
39 ) {
40 this.bytesPipe = new BytesPipe()
41 this.maxSizeText = this.i18n('max size')
42 }
35 43
36 get videoImageExtensions () { 44 get videoImageExtensions () {
37 return this.serverConfig.video.image.extensions 45 return this.serverConfig.video.image.extensions
@@ -41,6 +49,10 @@ export class PreviewUploadComponent implements OnInit, ControlValueAccessor {
41 return this.serverConfig.video.image.size.max 49 return this.serverConfig.video.image.size.max
42 } 50 }
43 51
52 get maxVideoImageSizeInBytes () {
53 return this.bytesPipe.transform(this.maxVideoImageSize)
54 }
55
44 ngOnInit () { 56 ngOnInit () {
45 this.serverConfig = this.serverService.getTmpConfig() 57 this.serverConfig = this.serverService.getTmpConfig()
46 this.serverService.getConfig() 58 this.serverService.getConfig()
diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.html b/client/src/app/videos/+video-edit/shared/video-edit.component.html
index 152b069d2..d59394538 100644
--- a/client/src/app/videos/+video-edit/shared/video-edit.component.html
+++ b/client/src/app/videos/+video-edit/shared/video-edit.component.html
@@ -6,7 +6,7 @@
6 6
7 <ng-template ngbNavContent> 7 <ng-template ngbNavContent>
8 <div class="row"> 8 <div class="row">
9 <div class="col-md-8"> 9 <div class="col-video-edit">
10 <div class="form-group"> 10 <div class="form-group">
11 <label i18n for="name">Title</label> 11 <label i18n for="name">Title</label>
12 <input type="text" id="name" class="form-control" formControlName="name" /> 12 <input type="text" id="name" class="form-control" formControlName="name" />
@@ -54,7 +54,7 @@
54 </div> 54 </div>
55 </div> 55 </div>
56 56
57 <div class="col-md-4"> 57 <div class="col-video-edit">
58 <div class="form-group"> 58 <div class="form-group">
59 <label i18n>Channel</label> 59 <label i18n>Channel</label>
60 <div class="peertube-select-container"> 60 <div class="peertube-select-container">
diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.scss b/client/src/app/videos/+video-edit/shared/video-edit.component.scss
index 1b7bc56b4..de800b03f 100644
--- a/client/src/app/videos/+video-edit/shared/video-edit.component.scss
+++ b/client/src/app/videos/+video-edit/shared/video-edit.component.scss
@@ -1,5 +1,11 @@
1@import '_variables'; 1// Bootstrap grid utilities require functions, variables and mixins
2@import '_mixins'; 2@import 'node_modules/bootstrap/scss/functions';
3@import 'node_modules/bootstrap/scss/variables';
4@import 'node_modules/bootstrap/scss/mixins';
5@import 'node_modules/bootstrap/scss/grid';
6
7@import 'variables';
8@import 'mixins';
3 9
4label { 10label {
5 font-weight: $font-regular; 11 font-weight: $font-regular;
@@ -54,6 +60,7 @@ my-peertube-checkbox {
54 60
55 .captions-header { 61 .captions-header {
56 text-align: right; 62 text-align: right;
63 margin-bottom: 1rem;
57 64
58 .create-caption { 65 .create-caption {
59 @include create-button; 66 @include create-button;
@@ -68,6 +75,7 @@ my-peertube-checkbox {
68 a.caption-entry-label { 75 a.caption-entry-label {
69 @include disable-default-a-behaviour; 76 @include disable-default-a-behaviour;
70 77
78 flex-grow: 1;
71 color: #000; 79 color: #000;
72 80
73 &:hover { 81 &:hover {
@@ -153,4 +161,49 @@ p-calendar {
153 } 161 }
154} 162}
155 163
156@include ng2-tags 164::ng-deep my-markdown-textarea {
165 .root {
166 @include media-breakpoint-down(xl) {
167 flex-direction: column !important;
168 }
169
170 textarea {
171 max-width: 100%;
172 }
173 }
174}
175
176@include ng2-tags;
177
178// columns for the video
179.col-video-edit {
180 @include make-col-ready();
181
182 @include media-breakpoint-up(md) {
183 @include make-col(7);
184
185 & + .col-video-edit {
186 @include make-col(5);
187 }
188 }
189
190 @include media-breakpoint-up(xl) {
191 @include make-col(8);
192
193 & + .col-video-edit {
194 @include make-col(4);
195 }
196 }
197}
198
199:host-context(.expanded) {
200 .col-video-edit {
201 @include media-breakpoint-up(md) {
202 @include make-col(8);
203
204 & + .col-video-edit {
205 @include make-col(4);
206 }
207 }
208 }
209}
diff --git a/client/src/app/videos/+video-edit/video-add-components/video-send.scss b/client/src/app/videos/+video-edit/video-add-components/video-send.scss
index 1979d0061..ebe14c59e 100644
--- a/client/src/app/videos/+video-edit/video-add-components/video-send.scss
+++ b/client/src/app/videos/+video-edit/video-add-components/video-send.scss
@@ -43,10 +43,4 @@ $width-size: 190px;
43 .button-file { 43 .button-file {
44 @include peertube-button-file(max-content); 44 @include peertube-button-file(max-content);
45 } 45 }
46
47 .button-file-extension {
48 display: block;
49 font-size: 12px;
50 margin-top: 5px;
51 }
52} 46}
diff --git a/client/src/app/videos/+video-edit/video-add-components/video-upload.component.html b/client/src/app/videos/+video-edit/video-add-components/video-upload.component.html
index be3a9662b..b4e1ceeca 100644
--- a/client/src/app/videos/+video-edit/video-add-components/video-upload.component.html
+++ b/client/src/app/videos/+video-edit/video-add-components/video-upload.component.html
@@ -2,11 +2,10 @@
2 <div class="first-step-block"> 2 <div class="first-step-block">
3 <my-global-icon class="upload-icon" iconName="upload"></my-global-icon> 3 <my-global-icon class="upload-icon" iconName="upload"></my-global-icon>
4 4
5 <div class="button-file form-control"> 5 <div class="button-file form-control" [ngbTooltip]="'(extensions: ' + videoExtensions + ')'" container="body">
6 <span i18n>Select the file to upload</span> 6 <span i18n>Select the file to upload</span>
7 <input #videofileInput type="file" name="videofile" id="videofile" [accept]="videoExtensions" (change)="fileChange()" autofocus /> 7 <input #videofileInput type="file" name="videofile" id="videofile" [accept]="videoExtensions" (change)="fileChange()" autofocus />
8 </div> 8 </div>
9 <span class="button-file-extension">({{ videoExtensions }})</span>
10 9
11 <div class="form-group form-group-channel"> 10 <div class="form-group form-group-channel">
12 <label i18n for="first-step-channel">Channel</label> 11 <label i18n for="first-step-channel">Channel</label>