diff options
Diffstat (limited to 'client/src/app/search')
-rw-r--r-- | client/src/app/search/search-filters.component.html | 18 | ||||
-rw-r--r-- | client/src/app/search/search-filters.component.scss | 63 | ||||
-rw-r--r-- | client/src/app/search/search.component.scss | 48 | ||||
-rw-r--r-- | client/src/app/search/search.component.ts | 3 | ||||
-rw-r--r-- | client/src/app/search/search.service.ts | 7 |
5 files changed, 47 insertions, 92 deletions
diff --git a/client/src/app/search/search-filters.component.html b/client/src/app/search/search-filters.component.html index 07fb2c048..54fc7338f 100644 --- a/client/src/app/search/search-filters.component.html +++ b/client/src/app/search/search-filters.component.html | |||
@@ -46,6 +46,7 @@ | |||
46 | type="text" id="original-publication-after" name="original-publication-after" | 46 | type="text" id="original-publication-after" name="original-publication-after" |
47 | i18n-placeholder placeholder="After..." | 47 | i18n-placeholder placeholder="After..." |
48 | [(ngModel)]="originallyPublishedStartYear" | 48 | [(ngModel)]="originallyPublishedStartYear" |
49 | class="form-control" | ||
49 | > | 50 | > |
50 | </div> | 51 | </div> |
51 | <div class="col-sm-6"> | 52 | <div class="col-sm-6"> |
@@ -55,6 +56,7 @@ | |||
55 | type="text" id="original-publication-before" name="original-publication-before" | 56 | type="text" id="original-publication-before" name="original-publication-before" |
56 | i18n-placeholder placeholder="Before..." | 57 | i18n-placeholder placeholder="Before..." |
57 | [(ngModel)]="originallyPublishedEndYear" | 58 | [(ngModel)]="originallyPublishedEndYear" |
59 | class="form-control" | ||
58 | > | 60 | > |
59 | </div> | 61 | </div> |
60 | </div> | 62 | </div> |
@@ -102,8 +104,8 @@ | |||
102 | Reset | 104 | Reset |
103 | </button> | 105 | </button> |
104 | <div class="peertube-select-container"> | 106 | <div class="peertube-select-container"> |
105 | <select id="category" name="category" [(ngModel)]="advancedSearch.categoryOneOf"> | 107 | <select id="category" name="category" [(ngModel)]="advancedSearch.categoryOneOf" class="form-control"> |
106 | <option [value]="undefined" i18n>Any or no category set</option> | 108 | <option [value]="undefined" i18n>Display all categories</option> |
107 | <option *ngFor="let category of videoCategories" [value]="category.id">{{ category.label }}</option> | 109 | <option *ngFor="let category of videoCategories" [value]="category.id">{{ category.label }}</option> |
108 | </select> | 110 | </select> |
109 | </div> | 111 | </div> |
@@ -115,8 +117,8 @@ | |||
115 | Reset | 117 | Reset |
116 | </button> | 118 | </button> |
117 | <div class="peertube-select-container"> | 119 | <div class="peertube-select-container"> |
118 | <select id="licence" name="licence" [(ngModel)]="advancedSearch.licenceOneOf"> | 120 | <select id="licence" name="licence" [(ngModel)]="advancedSearch.licenceOneOf" class="form-control"> |
119 | <option [value]="undefined" i18n>Any or no license set</option> | 121 | <option [value]="undefined" i18n>Display all licenses</option> |
120 | <option *ngFor="let licence of videoLicences" [value]="licence.id">{{ licence.label }}</option> | 122 | <option *ngFor="let licence of videoLicences" [value]="licence.id">{{ licence.label }}</option> |
121 | </select> | 123 | </select> |
122 | </div> | 124 | </div> |
@@ -128,8 +130,8 @@ | |||
128 | Reset | 130 | Reset |
129 | </button> | 131 | </button> |
130 | <div class="peertube-select-container"> | 132 | <div class="peertube-select-container"> |
131 | <select id="language" name="language" [(ngModel)]="advancedSearch.languageOneOf"> | 133 | <select id="language" name="language" [(ngModel)]="advancedSearch.languageOneOf" class="form-control"> |
132 | <option [value]="undefined" i18n>Any or no language set</option> | 134 | <option [value]="undefined" i18n>Display all languages</option> |
133 | <option *ngFor="let language of videoLanguages" [value]="language.id">{{ language.label }}</option> | 135 | <option *ngFor="let language of videoLanguages" [value]="language.id">{{ language.label }}</option> |
134 | </select> | 136 | </select> |
135 | </div> | 137 | </div> |
@@ -146,7 +148,7 @@ | |||
146 | [(ngModel)]="advancedSearch.tagsAllOf" name="tagsAllOf" id="tagsAllOf" | 148 | [(ngModel)]="advancedSearch.tagsAllOf" name="tagsAllOf" id="tagsAllOf" |
147 | [validators]="tagValidators" [errorMessages]="tagValidatorsMessages" | 149 | [validators]="tagValidators" [errorMessages]="tagValidatorsMessages" |
148 | i18n-placeholder placeholder="+ Tag" i18n-secondaryPlaceholder secondaryPlaceholder="Enter a tag" | 150 | i18n-placeholder placeholder="+ Tag" i18n-secondaryPlaceholder secondaryPlaceholder="Enter a tag" |
149 | maxItems="5" modelAsStrings="true" | 151 | [maxItems]="5" [modelAsStrings]="true" |
150 | ></tag-input> | 152 | ></tag-input> |
151 | </div> | 153 | </div> |
152 | 154 | ||
@@ -159,7 +161,7 @@ | |||
159 | [(ngModel)]="advancedSearch.tagsOneOf" name="tagsOneOf" id="tagsOneOf" | 161 | [(ngModel)]="advancedSearch.tagsOneOf" name="tagsOneOf" id="tagsOneOf" |
160 | [validators]="tagValidators" [errorMessages]="tagValidatorsMessages" | 162 | [validators]="tagValidators" [errorMessages]="tagValidatorsMessages" |
161 | i18n-placeholder placeholder="+ Tag" i18n-secondaryPlaceholder secondaryPlaceholder="Enter a tag" | 163 | i18n-placeholder placeholder="+ Tag" i18n-secondaryPlaceholder secondaryPlaceholder="Enter a tag" |
162 | maxItems="5" modelAsStrings="true" | 164 | [maxItems]="5" [modelAsStrings]="true" |
163 | ></tag-input> | 165 | ></tag-input> |
164 | </div> | 166 | </div> |
165 | </div> | 167 | </div> |
diff --git a/client/src/app/search/search-filters.component.scss b/client/src/app/search/search-filters.component.scss index 99af2e4c5..a88a1c0b0 100644 --- a/client/src/app/search/search-filters.component.scss +++ b/client/src/app/search/search-filters.component.scss | |||
@@ -66,65 +66,4 @@ input[type=submit] { | |||
66 | white-space: nowrap; | 66 | white-space: nowrap; |
67 | } | 67 | } |
68 | 68 | ||
69 | ::ng-deep { | 69 | @include ng2-tags; |
70 | .ng2-tag-input { | ||
71 | border: none !important; | ||
72 | } | ||
73 | |||
74 | .ng2-tags-container { | ||
75 | display: flex; | ||
76 | align-items: center; | ||
77 | border: 1px solid #C6C6C6; | ||
78 | border-radius: 3px; | ||
79 | padding: 5px !important; | ||
80 | height: max-content; | ||
81 | } | ||
82 | |||
83 | tag-input-form { | ||
84 | input { | ||
85 | height: 30px !important; | ||
86 | font-size: 12px !important; | ||
87 | |||
88 | background-color: var(--mainBackgroundColor) !important; | ||
89 | color: var(--mainForegroundColor) !important; | ||
90 | } | ||
91 | } | ||
92 | |||
93 | tag { | ||
94 | background-color: $grey-background-color !important; | ||
95 | color: #000 !important; | ||
96 | border-radius: 3px !important; | ||
97 | font-size: 12px !important; | ||
98 | height: 30px !important; | ||
99 | line-height: 30px !important; | ||
100 | margin: 0 5px 0 0 !important; | ||
101 | cursor: default !important; | ||
102 | padding: 0 8px 0 10px !important; | ||
103 | |||
104 | div { | ||
105 | height: 100% !important; | ||
106 | } | ||
107 | } | ||
108 | |||
109 | delete-icon { | ||
110 | cursor: pointer !important; | ||
111 | height: auto !important; | ||
112 | vertical-align: middle !important; | ||
113 | padding-left: 6px !important; | ||
114 | |||
115 | svg { | ||
116 | position: relative; | ||
117 | top: -1px; | ||
118 | height: auto !important; | ||
119 | vertical-align: middle !important; | ||
120 | |||
121 | path { | ||
122 | fill: $grey-foreground-color !important; | ||
123 | } | ||
124 | } | ||
125 | |||
126 | &:hover { | ||
127 | transform: none !important; | ||
128 | } | ||
129 | } | ||
130 | } | ||
diff --git a/client/src/app/search/search.component.scss b/client/src/app/search/search.component.scss index d4d8bbcf7..641647e2e 100644 --- a/client/src/app/search/search.component.scss +++ b/client/src/app/search/search.component.scss | |||
@@ -82,11 +82,35 @@ | |||
82 | } | 82 | } |
83 | 83 | ||
84 | @media screen and (max-width: $small-view) { | 84 | @media screen and (max-width: $small-view) { |
85 | .video-channel-names { | 85 | .search-result { |
86 | flex-direction: column !important; | 86 | .entry.video-channel, |
87 | .entry.video { | ||
88 | flex-direction: column; | ||
89 | height: auto; | ||
90 | justify-content: center; | ||
91 | align-items: center; | ||
92 | text-align: center; | ||
93 | |||
94 | img { | ||
95 | margin: 0; | ||
96 | } | ||
97 | |||
98 | img { | ||
99 | margin: 0; | ||
100 | } | ||
87 | 101 | ||
88 | .video-channel-name { | 102 | .video-channel-info .video-channel-names { |
89 | margin-left: 0 !important; | 103 | align-items: center; |
104 | flex-direction: column !important; | ||
105 | |||
106 | .video-channel-name { | ||
107 | margin-left: 0 !important; | ||
108 | } | ||
109 | } | ||
110 | |||
111 | my-subscribe-button { | ||
112 | margin-top: 5px; | ||
113 | } | ||
90 | } | 114 | } |
91 | } | 115 | } |
92 | } | 116 | } |
@@ -100,12 +124,6 @@ | |||
100 | } | 124 | } |
101 | 125 | ||
102 | .entry { | 126 | .entry { |
103 | flex-direction: column; | ||
104 | height: auto; | ||
105 | justify-content: center; | ||
106 | align-items: center; | ||
107 | text-align: center; | ||
108 | |||
109 | &.video { | 127 | &.video { |
110 | .video-info-name, | 128 | .video-info-name, |
111 | .video-info-account { | 129 | .video-info-account { |
@@ -126,16 +144,6 @@ | |||
126 | } | 144 | } |
127 | } | 145 | } |
128 | } | 146 | } |
129 | |||
130 | &.video-channel { | ||
131 | .video-channel-info .video-channel-names { | ||
132 | align-items: center; | ||
133 | } | ||
134 | |||
135 | my-subscribe-button { | ||
136 | margin-top: 5px; | ||
137 | } | ||
138 | } | ||
139 | } | 147 | } |
140 | } | 148 | } |
141 | } | 149 | } |
diff --git a/client/src/app/search/search.component.ts b/client/src/app/search/search.component.ts index dfd8d8823..075994dd3 100644 --- a/client/src/app/search/search.component.ts +++ b/client/src/app/search/search.component.ts | |||
@@ -141,7 +141,8 @@ export class SearchComponent implements OnInit, OnDestroy { | |||
141 | return this.advancedSearch.size() | 141 | return this.advancedSearch.size() |
142 | } | 142 | } |
143 | 143 | ||
144 | removeVideoFromArray (video: Video) { | 144 | // Add VideoChannel for typings, but the template already checks "video" argument is a video |
145 | removeVideoFromArray (video: Video | VideoChannel) { | ||
145 | this.results = this.results.filter(r => !this.isVideo(r) || r.id !== video.id) | 146 | this.results = this.results.filter(r => !this.isVideo(r) || r.id !== video.id) |
146 | } | 147 | } |
147 | 148 | ||
diff --git a/client/src/app/search/search.service.ts b/client/src/app/search/search.service.ts index 7610fee8c..3cad5aaa7 100644 --- a/client/src/app/search/search.service.ts +++ b/client/src/app/search/search.service.ts | |||
@@ -11,6 +11,7 @@ import { Video } from '@app/shared/video/video.model' | |||
11 | import { AdvancedSearch } from '@app/search/advanced-search.model' | 11 | import { AdvancedSearch } from '@app/search/advanced-search.model' |
12 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | 12 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' |
13 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' | 13 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' |
14 | import { peertubeLocalStorage } from '@app/shared/misc/peertube-web-storage' | ||
14 | 15 | ||
15 | @Injectable() | 16 | @Injectable() |
16 | export class SearchService { | 17 | export class SearchService { |
@@ -21,7 +22,11 @@ export class SearchService { | |||
21 | private restExtractor: RestExtractor, | 22 | private restExtractor: RestExtractor, |
22 | private restService: RestService, | 23 | private restService: RestService, |
23 | private videoService: VideoService | 24 | private videoService: VideoService |
24 | ) {} | 25 | ) { |
26 | // Add ability to override search endpoint if the user updated this local storage key | ||
27 | const searchUrl = peertubeLocalStorage.getItem('search-url') | ||
28 | if (searchUrl) SearchService.BASE_SEARCH_URL = searchUrl | ||
29 | } | ||
25 | 30 | ||
26 | searchVideos (parameters: { | 31 | searchVideos (parameters: { |
27 | search: string, | 32 | search: string, |