1
0
Fork 0

Merge branch 'release/4.2.0' into develop

This commit is contained in:
Chocobozzz 2022-06-10 10:20:55 +02:00
commit 0164fc112a
No known key found for this signature in database
GPG key ID: 583A612D890159BE
16 changed files with 70 additions and 45 deletions

View file

@ -24,7 +24,7 @@
<ng-template pTemplate="body" let-expanded="expanded" let-videoImport> <ng-template pTemplate="body" let-expanded="expanded" let-videoImport>
<tr> <tr>
<td class="expand-cell" [pRowToggler]="videoImport"> <td class="expand-cell" [pRowToggler]="videoImport">
<my-table-expander-icon [expanded]="expanded"></my-table-expander-icon> <my-table-expander-icon *ngIf="videoImport.error" [expanded]="expanded"></my-table-expander-icon>
</td> </td>
<td class="action-cell"> <td class="action-cell">

View file

@ -20,6 +20,11 @@ input[type=text] {
@include peertube-select-container(340px); @include peertube-select-container(340px);
} }
my-select-channel {
display: block;
max-width: 340px;
}
input[type=submit] { input[type=submit] {
@include peertube-button; @include peertube-button;
@include orange-button; @include orange-button;

View file

@ -67,7 +67,7 @@ export class MyVideosComponent implements OnInit, DisableForReuseHook {
user: User user: User
inputFilters: AdvancedInputFilter[] inputFilters: AdvancedInputFilter[] = []
disabled = false disabled = false

View file

@ -138,11 +138,11 @@ export class SearchFiltersComponent implements OnInit {
private loadOriginallyPublishedAtYears () { private loadOriginallyPublishedAtYears () {
this.originallyPublishedStartYear = this.advancedSearch.originallyPublishedStartDate this.originallyPublishedStartYear = this.advancedSearch.originallyPublishedStartDate
? new Date(this.advancedSearch.originallyPublishedStartDate).getFullYear().toString() ? new Date(this.advancedSearch.originallyPublishedStartDate).getFullYear().toString()
: null : undefined
this.originallyPublishedEndYear = this.advancedSearch.originallyPublishedEndDate this.originallyPublishedEndYear = this.advancedSearch.originallyPublishedEndDate
? new Date(this.advancedSearch.originallyPublishedEndDate).getFullYear().toString() ? new Date(this.advancedSearch.originallyPublishedEndDate).getFullYear().toString()
: null : undefined
} }
private loadFromDurationRange () { private loadFromDurationRange () {
@ -189,7 +189,7 @@ export class SearchFiltersComponent implements OnInit {
this.advancedSearch.originallyPublishedStartDate = start.toISOString() this.advancedSearch.originallyPublishedStartDate = start.toISOString()
} else { } else {
this.advancedSearch.originallyPublishedStartDate = null this.advancedSearch.originallyPublishedStartDate = undefined
} }
if (this.originallyPublishedEndYear) { if (this.originallyPublishedEndYear) {
@ -199,7 +199,7 @@ export class SearchFiltersComponent implements OnInit {
this.advancedSearch.originallyPublishedEndDate = end.toISOString() this.advancedSearch.originallyPublishedEndDate = end.toISOString()
} else { } else {
this.advancedSearch.originallyPublishedEndDate = null this.advancedSearch.originallyPublishedEndDate = undefined
} }
} }

View file

@ -17,7 +17,7 @@ $width-size: 250px;
align-items: center; align-items: center;
.upload-icon { .upload-icon {
@include apply-svg-color(#C6C6C6); @include apply-svg-color($input-border-color);
width: 90px; width: 90px;
margin-bottom: 25px; margin-bottom: 25px;

View file

@ -56,8 +56,8 @@ form {
width: $markdown-icon-width; width: $markdown-icon-width;
svg { svg {
color: #C6C6C6; color: $input-border-color;
fill: #C6C6C6; fill: $input-border-color;
border-radius: 3px; border-radius: 3px;
} }
} }
@ -66,7 +66,7 @@ form {
&:active, &:active,
&:hover { &:hover {
my-global-icon svg { my-global-icon svg {
background-color: #C6C6C6; background-color: $input-border-color;
color: pvar(--mainBackgroundColor); color: pvar(--mainBackgroundColor);
fill: pvar(--mainBackgroundColor); fill: pvar(--mainBackgroundColor);
} }

View file

@ -5,9 +5,7 @@
</div> </div>
<div *ngIf="!hasBanner()" class="actor-img-edit-button" [ngbTooltip]="bannerFormat" placement="right" container="body"> <div *ngIf="!hasBanner()" class="actor-img-edit-button" [ngbTooltip]="bannerFormat" placement="right" container="body">
<my-global-icon iconName="upload"></my-global-icon> <ng-container *ngTemplateOutlet="uploadNewBanner"></ng-container>
<label for="bannerfile" i18n>Upload a new banner</label>
<input #bannerfileInput type="file" name="bannerfile" id="bannerfile" [accept]="bannerExtensions" (change)="onBannerChange(bannerfileInput)"/>
</div> </div>
<div <div
@ -22,9 +20,7 @@
<ng-template #bannerEditContent> <ng-template #bannerEditContent>
<div class="dropdown-item c-hand" [ngbTooltip]="bannerFormat" placement="right" container="body"> <div class="dropdown-item c-hand" [ngbTooltip]="bannerFormat" placement="right" container="body">
<my-global-icon iconName="upload"></my-global-icon> <ng-container *ngTemplateOutlet="uploadNewBanner"></ng-container>
<span for="bannerfile" i18n>Upload a new banner</span>
<input #bannerfileInput type="file" name="bannerfile" id="bannerfile" [accept]="bannerExtensions" (change)="onBannerChange(bannerfileInput)"/>
</div> </div>
<div class="dropdown-item c-hand" (click)="deleteBanner()" (key.enter)="deleteBanner()"> <div class="dropdown-item c-hand" (click)="deleteBanner()" (key.enter)="deleteBanner()">
@ -32,3 +28,9 @@
<span i18n>Remove banner</span> <span i18n>Remove banner</span>
</div> </div>
</ng-template> </ng-template>
<ng-template #uploadNewBanner>
<my-global-icon iconName="upload"></my-global-icon>
<span for="bannerfile" i18n>Upload a new banner</span>
<input #bannerfileInput type="file" name="bannerfile" id="bannerfile" [accept]="bannerExtensions" (change)="onBannerChange(bannerfileInput)"/>
</ng-template>

View file

@ -25,3 +25,7 @@
margin-bottom: 0; margin-bottom: 0;
} }
} }
my-global-icon {
margin: 0 5px;
}

View file

@ -4,7 +4,6 @@
$nav-preview-tab-height: 30px; $nav-preview-tab-height: 30px;
$base-padding: 15px; $base-padding: 15px;
$input-border-color: #C6C6C6;
$input-border-radius: 3px; $input-border-radius: 3px;
@mixin in-small-view { @mixin in-small-view {

View file

@ -1,6 +1,6 @@
<span class="action-button" [ngClass]="getClasses()" [ngbTooltip]="title" tabindex="0"> <span class="action-button" [ngClass]="getClasses()" [ngbTooltip]="title" tabindex="0">
<my-global-icon *ngIf="icon && !loading" [iconName]="icon"></my-global-icon>
<my-small-loader [loading]="loading"></my-small-loader> <my-small-loader [loading]="loading"></my-small-loader>
<my-global-icon *ngIf="icon && !loading" [iconName]="icon"></my-global-icon>
<span *ngIf="label" class="button-label">{{ label }}</span> <span *ngIf="label" class="button-label">{{ label }}</span>

View file

@ -34,6 +34,12 @@ span[class$=-button] {
@include button-with-icon(21px); @include button-with-icon(21px);
width: 100%; // useful for ellipsis, allow to define a max-width on host component width: 100%; // useful for ellipsis, allow to define a max-width on host component
&.icon-only {
my-global-icon {
margin: 0;
}
}
} }
.orange-button { .orange-button {

View file

@ -20,6 +20,7 @@ export class ButtonComponent {
return { return {
[this.className]: true, [this.className]: true,
disabled: this.disabled, disabled: this.disabled,
'icon-only': !this.label,
'responsive-label': this.responsiveLabel 'responsive-label': this.responsiveLabel
} }
} }

View file

@ -40,9 +40,6 @@ export class AdvancedSearch {
searchTarget: SearchTargetType searchTarget: SearchTargetType
resultType: AdvancedSearchResultType resultType: AdvancedSearchResultType
// Filters we don't want to count, because they are mandatory
private silentFilters = new Set([ 'sort', 'searchTarget' ])
constructor (options?: { constructor (options?: {
startDate?: string startDate?: string
endDate?: string endDate?: string
@ -101,14 +98,7 @@ export class AdvancedSearch {
} }
containsValues () { containsValues () {
const obj = this.toUrlObject() return this.size() !== 0
for (const k of Object.keys(obj)) {
if (this.silentFilters.has(k)) continue
if (this.isValidValue(obj[k])) return true
}
return false
} }
reset () { reset () {
@ -193,12 +183,19 @@ export class AdvancedSearch {
size () { size () {
let acc = 0 let acc = 0
const obj = this.toUrlObject() if (this.isValidValue(this.startDate) || this.isValidValue(this.endDate)) acc++
for (const k of Object.keys(obj)) { if (this.isValidValue(this.originallyPublishedStartDate) || this.isValidValue(this.originallyPublishedEndDate)) acc++
if (this.silentFilters.has(k)) continue
if (this.isValidValue(obj[k])) acc++ if (this.isValidValue(this.nsfw)) acc++
} if (this.isValidValue(this.categoryOneOf)) acc++
if (this.isValidValue(this.licenceOneOf)) acc++
if (this.isValidValue(this.languageOneOf)) acc++
if (this.isValidValue(this.tagsOneOf)) acc++
if (this.isValidValue(this.tagsAllOf)) acc++
if (this.isValidValue(this.durationMin) || this.isValidValue(this.durationMax)) acc++
if (this.isValidValue(this.isLive)) acc++
if (this.isValidValue(this.host)) acc++
if (this.isValidValue(this.resultType)) acc++
return acc return acc
} }

View file

@ -92,7 +92,7 @@
max-width: $width; max-width: $width;
color: pvar(--inputForegroundColor); color: pvar(--inputForegroundColor);
background-color: pvar(--inputBackgroundColor); background-color: pvar(--inputBackgroundColor);
border: 1px solid #C6C6C6; border: 1px solid $input-border-color;
border-radius: 3px; border-radius: 3px;
font-size: 15px; font-size: 15px;
@ -138,7 +138,7 @@
&.disabled { &.disabled {
cursor: default; cursor: default;
color: #fff; color: #fff;
background-color: #C6C6C6; background-color: $input-border-color;
} }
my-global-icon { my-global-icon {
@ -168,7 +168,7 @@
&.disabled { &.disabled {
cursor: default; cursor: default;
color: pvar(--mainColor); color: pvar(--mainColor);
background-color: #C6C6C6; background-color: $input-border-color;
} }
my-global-icon { my-global-icon {
@ -385,10 +385,9 @@
select { select {
padding: 0 35px 0 12px; padding: 0 35px 0 12px;
position: relative; position: relative;
border: 1px solid #C6C6C6; border: 1px solid $input-border-color;
background: transparent none; background: transparent none;
appearance: none; appearance: none;
cursor: pointer;
height: $button-height; height: $button-height;
text-overflow: ellipsis; text-overflow: ellipsis;
color: pvar(--mainForegroundColor); color: pvar(--mainForegroundColor);
@ -404,14 +403,17 @@
option { option {
color: #000; color: #000;
&[value=undefined] {
font-weight: $font-semibold;
}
} }
} }
&.peertube-select-button { &.peertube-select-button {
@include grey-button; @include grey-button;
select, select {
option {
font-weight: $font-semibold; font-weight: $font-semibold;
color: pvar(--greyForegroundColor); color: pvar(--greyForegroundColor);
border: 0; border: 0;
@ -446,7 +448,7 @@
top: 0; top: 0;
width: 18px; width: 18px;
height: 18px; height: 18px;
border: 1px solid #C6C6C6; border: 1px solid $input-border-color;
border-radius: 100%; border-radius: 100%;
background: #fff; background: #fff;
} }
@ -493,7 +495,7 @@
width: 18px; width: 18px;
min-width: 18px; min-width: 18px;
height: 18px; height: 18px;
border: $border-width solid #C6C6C6; border: $border-width solid $input-border-color;
border-radius: 3px; border-radius: 3px;
vertical-align: middle; vertical-align: middle;
cursor: pointer; cursor: pointer;
@ -612,7 +614,7 @@
margin-bottom: 20px; margin-bottom: 20px;
@if $separator { @if $separator {
border-bottom: 1px solid #C6C6C6; border-bottom: 1px solid $input-border-color;
} }
@media screen and (max-width: $small-view) { @media screen and (max-width: $small-view) {

View file

@ -85,6 +85,7 @@ $theater-bottom-space: 115px;
$input-foreground-color: $fg-color; $input-foreground-color: $fg-color;
$input-background-color: $bg-color; $input-background-color: $bg-color;
$input-placeholder-color: #898989; $input-placeholder-color: #898989;
$input-border-color: #C6C6C6;
$textarea-foreground-color: $fg-color; $textarea-foreground-color: $fg-color;
$textarea-background-color: $bg-color; $textarea-background-color: $bg-color;

View file

@ -4,7 +4,7 @@
$ng-select-highlight: #f2690d; $ng-select-highlight: #f2690d;
// $ng-select-primary-text: #333 !default; // $ng-select-primary-text: #333 !default;
// $ng-select-disabled-text: #f9f9f9 !default; // $ng-select-disabled-text: #f9f9f9 !default;
// $ng-select-border: #ccc !default; $ng-select-border: $input-border-color;
// $ng-select-border-radius: 4px !default; // $ng-select-border-radius: 4px !default;
// $ng-select-bg: #ffffff !default; // $ng-select-bg: #ffffff !default;
// $ng-select-selected: lighten($ng-select-highlight, 46) !default; // $ng-select-selected: lighten($ng-select-highlight, 46) !default;
@ -46,6 +46,14 @@ $ng-select-value-font-size: 15px;
@include padding-right(12px); @include padding-right(12px);
} }
.ng-arrow {
border-color: #000 transparent transparent !important;
}
&.ng-select-opened .ng-arrow {
border-color: transparent transparent #000 !important;
}
&.ng-select-single .ng-value-container .ng-value { &.ng-select-single .ng-value-container .ng-value {
color: pvar(--inputForegroundColor); color: pvar(--inputForegroundColor);