Enlarge right column in video-edit on small screens
This commit is contained in:
parent
9f77adb8fe
commit
6f02515e2a
8 changed files with 80 additions and 22 deletions
|
@ -66,4 +66,4 @@ input[type=submit] {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
@include ng2-tags
|
@include ng2-tags;
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
<div class="root">
|
<div class="root">
|
||||||
<div class="preview-container">
|
<div class="preview-container">
|
||||||
<my-reactive-file
|
<my-reactive-file
|
||||||
[inputName]="inputName" [inputLabel]="inputLabel" [extensions]="videoImageExtensions" [maxFileSize]="maxVideoImageSize"
|
[inputName]="inputName" [inputLabel]="inputLabel" [extensions]="videoImageExtensions" [maxFileSize]="maxVideoImageSize" placement="right"
|
||||||
icon="edit" (fileChanged)="onFileChanged($event)"
|
icon="edit" (fileChanged)="onFileChanged($event)" [ngbTooltip]="'(extensions: '+ videoImageExtensions +', '+ maxSizeText +': '+ maxVideoImageSizeInBytes +')'"
|
||||||
></my-reactive-file>
|
></my-reactive-file>
|
||||||
|
|
||||||
<img *ngIf="imageSrc" [ngStyle]="{ width: previewWidth, height: previewHeight }" [src]="imageSrc" class="preview" />
|
<img *ngIf="imageSrc" [ngStyle]="{ width: previewWidth, height: previewHeight }" [src]="imageSrc" class="preview" />
|
||||||
<div *ngIf="!imageSrc" [ngStyle]="{ width: previewWidth, height: previewHeight }" class="preview no-image"></div>
|
<div *ngIf="!imageSrc" [ngStyle]="{ width: previewWidth, height: previewHeight }" class="preview no-image"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div i18n class="file-constraints">(extensions: {{ allowedExtensionsMessage }}, max size: {{ maxVideoImageSize | bytes }})</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -16,11 +16,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.preview {
|
.preview {
|
||||||
border: 2px solid grey;
|
object-fit: cover;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
|
max-width: 100%;
|
||||||
|
|
||||||
&.no-image {
|
&.no-image {
|
||||||
background-color: #ececec;
|
border: 2px solid grey;
|
||||||
|
background-color: var(--mainBackgroundColor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,8 @@ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'
|
||||||
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser'
|
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser'
|
||||||
import { ServerService } from '@app/core'
|
import { ServerService } from '@app/core'
|
||||||
import { ServerConfig } from '@shared/models'
|
import { ServerConfig } from '@shared/models'
|
||||||
|
import { BytesPipe } from 'ngx-pipes'
|
||||||
|
import { I18n } from '@ngx-translate/i18n-polyfill'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-preview-upload',
|
selector: 'my-preview-upload',
|
||||||
|
@ -24,14 +26,20 @@ export class PreviewUploadComponent implements OnInit, ControlValueAccessor {
|
||||||
|
|
||||||
imageSrc: SafeResourceUrl
|
imageSrc: SafeResourceUrl
|
||||||
allowedExtensionsMessage = ''
|
allowedExtensionsMessage = ''
|
||||||
|
maxSizeText: string
|
||||||
|
|
||||||
private serverConfig: ServerConfig
|
private serverConfig: ServerConfig
|
||||||
|
private bytesPipe: BytesPipe
|
||||||
private file: Blob
|
private file: Blob
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
private sanitizer: DomSanitizer,
|
private sanitizer: DomSanitizer,
|
||||||
private serverService: ServerService
|
private serverService: ServerService,
|
||||||
) {}
|
private i18n: I18n
|
||||||
|
) {
|
||||||
|
this.bytesPipe = new BytesPipe()
|
||||||
|
this.maxSizeText = this.i18n('max size')
|
||||||
|
}
|
||||||
|
|
||||||
get videoImageExtensions () {
|
get videoImageExtensions () {
|
||||||
return this.serverConfig.video.image.extensions
|
return this.serverConfig.video.image.extensions
|
||||||
|
@ -41,6 +49,10 @@ export class PreviewUploadComponent implements OnInit, ControlValueAccessor {
|
||||||
return this.serverConfig.video.image.size.max
|
return this.serverConfig.video.image.size.max
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get maxVideoImageSizeInBytes () {
|
||||||
|
return this.bytesPipe.transform(this.maxVideoImageSize)
|
||||||
|
}
|
||||||
|
|
||||||
ngOnInit () {
|
ngOnInit () {
|
||||||
this.serverConfig = this.serverService.getTmpConfig()
|
this.serverConfig = this.serverService.getTmpConfig()
|
||||||
this.serverService.getConfig()
|
this.serverService.getConfig()
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
<ng-template ngbNavContent>
|
<ng-template ngbNavContent>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-8">
|
<div class="col-video-edit">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label i18n for="name">Title</label>
|
<label i18n for="name">Title</label>
|
||||||
<input type="text" id="name" class="form-control" formControlName="name" />
|
<input type="text" id="name" class="form-control" formControlName="name" />
|
||||||
|
@ -54,7 +54,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-4">
|
<div class="col-video-edit">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label i18n>Channel</label>
|
<label i18n>Channel</label>
|
||||||
<div class="peertube-select-container">
|
<div class="peertube-select-container">
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
@import '_variables';
|
// Bootstrap grid utilities require functions, variables and mixins
|
||||||
@import '_mixins';
|
@import 'node_modules/bootstrap/scss/functions';
|
||||||
|
@import 'node_modules/bootstrap/scss/variables';
|
||||||
|
@import 'node_modules/bootstrap/scss/mixins';
|
||||||
|
@import 'node_modules/bootstrap/scss/grid';
|
||||||
|
|
||||||
|
@import 'variables';
|
||||||
|
@import 'mixins';
|
||||||
|
|
||||||
label {
|
label {
|
||||||
font-weight: $font-regular;
|
font-weight: $font-regular;
|
||||||
|
@ -54,6 +60,7 @@ my-peertube-checkbox {
|
||||||
|
|
||||||
.captions-header {
|
.captions-header {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
|
||||||
.create-caption {
|
.create-caption {
|
||||||
@include create-button;
|
@include create-button;
|
||||||
|
@ -68,6 +75,7 @@ my-peertube-checkbox {
|
||||||
a.caption-entry-label {
|
a.caption-entry-label {
|
||||||
@include disable-default-a-behaviour;
|
@include disable-default-a-behaviour;
|
||||||
|
|
||||||
|
flex-grow: 1;
|
||||||
color: #000;
|
color: #000;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
|
@ -153,4 +161,49 @@ p-calendar {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@include ng2-tags
|
::ng-deep my-markdown-textarea {
|
||||||
|
.root {
|
||||||
|
@include media-breakpoint-down(xl) {
|
||||||
|
flex-direction: column !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
textarea {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@include ng2-tags;
|
||||||
|
|
||||||
|
// columns for the video
|
||||||
|
.col-video-edit {
|
||||||
|
@include make-col-ready();
|
||||||
|
|
||||||
|
@include media-breakpoint-up(md) {
|
||||||
|
@include make-col(7);
|
||||||
|
|
||||||
|
& + .col-video-edit {
|
||||||
|
@include make-col(5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@include media-breakpoint-up(xl) {
|
||||||
|
@include make-col(8);
|
||||||
|
|
||||||
|
& + .col-video-edit {
|
||||||
|
@include make-col(4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
:host-context(.expanded) {
|
||||||
|
.col-video-edit {
|
||||||
|
@include media-breakpoint-up(md) {
|
||||||
|
@include make-col(8);
|
||||||
|
|
||||||
|
& + .col-video-edit {
|
||||||
|
@include make-col(4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -43,10 +43,4 @@ $width-size: 190px;
|
||||||
.button-file {
|
.button-file {
|
||||||
@include peertube-button-file(max-content);
|
@include peertube-button-file(max-content);
|
||||||
}
|
}
|
||||||
|
|
||||||
.button-file-extension {
|
|
||||||
display: block;
|
|
||||||
font-size: 12px;
|
|
||||||
margin-top: 5px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,11 +2,10 @@
|
||||||
<div class="first-step-block">
|
<div class="first-step-block">
|
||||||
<my-global-icon class="upload-icon" iconName="upload"></my-global-icon>
|
<my-global-icon class="upload-icon" iconName="upload"></my-global-icon>
|
||||||
|
|
||||||
<div class="button-file form-control">
|
<div class="button-file form-control" [ngbTooltip]="'(extensions: ' + videoExtensions + ')'" container="body">
|
||||||
<span i18n>Select the file to upload</span>
|
<span i18n>Select the file to upload</span>
|
||||||
<input #videofileInput type="file" name="videofile" id="videofile" [accept]="videoExtensions" (change)="fileChange()" autofocus />
|
<input #videofileInput type="file" name="videofile" id="videofile" [accept]="videoExtensions" (change)="fileChange()" autofocus />
|
||||||
</div>
|
</div>
|
||||||
<span class="button-file-extension">({{ videoExtensions }})</span>
|
|
||||||
|
|
||||||
<div class="form-group form-group-channel">
|
<div class="form-group form-group-channel">
|
||||||
<label i18n for="first-step-channel">Channel</label>
|
<label i18n for="first-step-channel">Channel</label>
|
||||||
|
|
Loading…
Reference in a new issue