aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared')
-rw-r--r--client/src/app/shared/shared-actor-image-edit/actor-banner-edit.component.html14
-rw-r--r--client/src/app/shared/shared-actor-image-edit/actor-banner-edit.component.scss4
-rw-r--r--client/src/app/shared/shared-forms/markdown-textarea.component.scss1
-rw-r--r--client/src/app/shared/shared-main/buttons/button.component.html2
-rw-r--r--client/src/app/shared/shared-main/buttons/button.component.scss6
-rw-r--r--client/src/app/shared/shared-main/buttons/button.component.ts1
-rw-r--r--client/src/app/shared/shared-search/advanced-search.model.ts31
7 files changed, 34 insertions, 25 deletions
diff --git a/client/src/app/shared/shared-actor-image-edit/actor-banner-edit.component.html b/client/src/app/shared/shared-actor-image-edit/actor-banner-edit.component.html
index 266fc26c5..f675371d9 100644
--- a/client/src/app/shared/shared-actor-image-edit/actor-banner-edit.component.html
+++ b/client/src/app/shared/shared-actor-image-edit/actor-banner-edit.component.html
@@ -5,9 +5,7 @@
5 </div> 5 </div>
6 6
7 <div *ngIf="!hasBanner()" class="actor-img-edit-button" [ngbTooltip]="bannerFormat" placement="right" container="body"> 7 <div *ngIf="!hasBanner()" class="actor-img-edit-button" [ngbTooltip]="bannerFormat" placement="right" container="body">
8 <my-global-icon iconName="upload"></my-global-icon> 8 <ng-container *ngTemplateOutlet="uploadNewBanner"></ng-container>
9 <label for="bannerfile" i18n>Upload a new banner</label>
10 <input #bannerfileInput type="file" name="bannerfile" id="bannerfile" [accept]="bannerExtensions" (change)="onBannerChange(bannerfileInput)"/>
11 </div> 9 </div>
12 10
13 <div 11 <div
@@ -22,9 +20,7 @@
22 20
23<ng-template #bannerEditContent> 21<ng-template #bannerEditContent>
24 <div class="dropdown-item c-hand" [ngbTooltip]="bannerFormat" placement="right" container="body"> 22 <div class="dropdown-item c-hand" [ngbTooltip]="bannerFormat" placement="right" container="body">
25 <my-global-icon iconName="upload"></my-global-icon> 23 <ng-container *ngTemplateOutlet="uploadNewBanner"></ng-container>
26 <span for="bannerfile" i18n>Upload a new banner</span>
27 <input #bannerfileInput type="file" name="bannerfile" id="bannerfile" [accept]="bannerExtensions" (change)="onBannerChange(bannerfileInput)"/>
28 </div> 24 </div>
29 25
30 <div class="dropdown-item c-hand" (click)="deleteBanner()" (key.enter)="deleteBanner()"> 26 <div class="dropdown-item c-hand" (click)="deleteBanner()" (key.enter)="deleteBanner()">
@@ -32,3 +28,9 @@
32 <span i18n>Remove banner</span> 28 <span i18n>Remove banner</span>
33 </div> 29 </div>
34</ng-template> 30</ng-template>
31
32<ng-template #uploadNewBanner>
33 <my-global-icon iconName="upload"></my-global-icon>
34 <span for="bannerfile" i18n>Upload a new banner</span>
35 <input #bannerfileInput type="file" name="bannerfile" id="bannerfile" [accept]="bannerExtensions" (change)="onBannerChange(bannerfileInput)"/>
36</ng-template>
diff --git a/client/src/app/shared/shared-actor-image-edit/actor-banner-edit.component.scss b/client/src/app/shared/shared-actor-image-edit/actor-banner-edit.component.scss
index ec2de2528..90fcd81aa 100644
--- a/client/src/app/shared/shared-actor-image-edit/actor-banner-edit.component.scss
+++ b/client/src/app/shared/shared-actor-image-edit/actor-banner-edit.component.scss
@@ -25,3 +25,7 @@
25 margin-bottom: 0; 25 margin-bottom: 0;
26 } 26 }
27} 27}
28
29my-global-icon {
30 margin: 0 5px;
31}
diff --git a/client/src/app/shared/shared-forms/markdown-textarea.component.scss b/client/src/app/shared/shared-forms/markdown-textarea.component.scss
index 0b4872d46..5939bb999 100644
--- a/client/src/app/shared/shared-forms/markdown-textarea.component.scss
+++ b/client/src/app/shared/shared-forms/markdown-textarea.component.scss
@@ -4,7 +4,6 @@
4 4
5$nav-preview-tab-height: 30px; 5$nav-preview-tab-height: 30px;
6$base-padding: 15px; 6$base-padding: 15px;
7$input-border-color: #C6C6C6;
8$input-border-radius: 3px; 7$input-border-radius: 3px;
9 8
10@mixin in-small-view { 9@mixin in-small-view {
diff --git a/client/src/app/shared/shared-main/buttons/button.component.html b/client/src/app/shared/shared-main/buttons/button.component.html
index 11c8ffedd..d1a4215e6 100644
--- a/client/src/app/shared/shared-main/buttons/button.component.html
+++ b/client/src/app/shared/shared-main/buttons/button.component.html
@@ -1,6 +1,6 @@
1<span class="action-button" [ngClass]="getClasses()" [ngbTooltip]="title" tabindex="0"> 1<span class="action-button" [ngClass]="getClasses()" [ngbTooltip]="title" tabindex="0">
2 <my-global-icon *ngIf="icon && !loading" [iconName]="icon"></my-global-icon>
3 <my-small-loader [loading]="loading"></my-small-loader> 2 <my-small-loader [loading]="loading"></my-small-loader>
3 <my-global-icon *ngIf="icon && !loading" [iconName]="icon"></my-global-icon>
4 4
5 <span *ngIf="label" class="button-label">{{ label }}</span> 5 <span *ngIf="label" class="button-label">{{ label }}</span>
6 6
diff --git a/client/src/app/shared/shared-main/buttons/button.component.scss b/client/src/app/shared/shared-main/buttons/button.component.scss
index c782ac3ef..c53b8f2e5 100644
--- a/client/src/app/shared/shared-main/buttons/button.component.scss
+++ b/client/src/app/shared/shared-main/buttons/button.component.scss
@@ -34,6 +34,12 @@ span[class$=-button] {
34 @include button-with-icon(21px); 34 @include button-with-icon(21px);
35 35
36 width: 100%; // useful for ellipsis, allow to define a max-width on host component 36 width: 100%; // useful for ellipsis, allow to define a max-width on host component
37
38 &.icon-only {
39 my-global-icon {
40 margin: 0;
41 }
42 }
37} 43}
38 44
39.orange-button { 45.orange-button {
diff --git a/client/src/app/shared/shared-main/buttons/button.component.ts b/client/src/app/shared/shared-main/buttons/button.component.ts
index b97012d9a..52936a4d4 100644
--- a/client/src/app/shared/shared-main/buttons/button.component.ts
+++ b/client/src/app/shared/shared-main/buttons/button.component.ts
@@ -20,6 +20,7 @@ export class ButtonComponent {
20 return { 20 return {
21 [this.className]: true, 21 [this.className]: true,
22 disabled: this.disabled, 22 disabled: this.disabled,
23 'icon-only': !this.label,
23 'responsive-label': this.responsiveLabel 24 'responsive-label': this.responsiveLabel
24 } 25 }
25 } 26 }
diff --git a/client/src/app/shared/shared-search/advanced-search.model.ts b/client/src/app/shared/shared-search/advanced-search.model.ts
index e40fd2e66..1375820da 100644
--- a/client/src/app/shared/shared-search/advanced-search.model.ts
+++ b/client/src/app/shared/shared-search/advanced-search.model.ts
@@ -40,9 +40,6 @@ export class AdvancedSearch {
40 searchTarget: SearchTargetType 40 searchTarget: SearchTargetType
41 resultType: AdvancedSearchResultType 41 resultType: AdvancedSearchResultType
42 42
43 // Filters we don't want to count, because they are mandatory
44 private silentFilters = new Set([ 'sort', 'searchTarget' ])
45
46 constructor (options?: { 43 constructor (options?: {
47 startDate?: string 44 startDate?: string
48 endDate?: string 45 endDate?: string
@@ -101,14 +98,7 @@ export class AdvancedSearch {
101 } 98 }
102 99
103 containsValues () { 100 containsValues () {
104 const obj = this.toUrlObject() 101 return this.size() !== 0
105 for (const k of Object.keys(obj)) {
106 if (this.silentFilters.has(k)) continue
107
108 if (this.isValidValue(obj[k])) return true
109 }
110
111 return false
112 } 102 }
113 103
114 reset () { 104 reset () {
@@ -193,12 +183,19 @@ export class AdvancedSearch {
193 size () { 183 size () {
194 let acc = 0 184 let acc = 0
195 185
196 const obj = this.toUrlObject() 186 if (this.isValidValue(this.startDate) || this.isValidValue(this.endDate)) acc++
197 for (const k of Object.keys(obj)) { 187 if (this.isValidValue(this.originallyPublishedStartDate) || this.isValidValue(this.originallyPublishedEndDate)) acc++
198 if (this.silentFilters.has(k)) continue 188
199 189 if (this.isValidValue(this.nsfw)) acc++
200 if (this.isValidValue(obj[k])) acc++ 190 if (this.isValidValue(this.categoryOneOf)) acc++
201 } 191 if (this.isValidValue(this.licenceOneOf)) acc++
192 if (this.isValidValue(this.languageOneOf)) acc++
193 if (this.isValidValue(this.tagsOneOf)) acc++
194 if (this.isValidValue(this.tagsAllOf)) acc++
195 if (this.isValidValue(this.durationMin) || this.isValidValue(this.durationMax)) acc++
196 if (this.isValidValue(this.isLive)) acc++
197 if (this.isValidValue(this.host)) acc++
198 if (this.isValidValue(this.resultType)) acc++
202 199
203 return acc 200 return acc
204 } 201 }