diff options
author | Chocobozzz <me@florianbigard.com> | 2017-12-20 14:29:55 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2017-12-20 14:29:55 +0100 |
commit | 15a7387da888492068e2ce3d1e39639d142f6c6e (patch) | |
tree | 8eaec71d11c19a97dc99e4d9812dfc0c646dd9e7 /client/src/app/videos/+video-edit/shared | |
parent | a4b8a4ddccc926e0670d3687cccd52496f6f8a8f (diff) | |
download | PeerTube-15a7387da888492068e2ce3d1e39639d142f6c6e.tar.gz PeerTube-15a7387da888492068e2ce3d1e39639d142f6c6e.tar.zst PeerTube-15a7387da888492068e2ce3d1e39639d142f6c6e.zip |
Customize select
Diffstat (limited to 'client/src/app/videos/+video-edit/shared')
3 files changed, 46 insertions, 21 deletions
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 8c071ce12..e728d8ea2 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 | |||
@@ -29,11 +29,22 @@ | |||
29 | 29 | ||
30 | <div class="col-md-4"> | 30 | <div class="col-md-4"> |
31 | <div class="form-group"> | 31 | <div class="form-group"> |
32 | <label>Channel</label> | ||
33 | <div class="peertube-select-disabled-container"> | ||
34 | <select formControlName="channelId"> | ||
35 | <option *ngFor="let channel of userVideoChannels" [value]="channel.id">{{ channel.label }}</option> | ||
36 | </select> | ||
37 | </div> | ||
38 | </div> | ||
39 | |||
40 | <div class="form-group"> | ||
32 | <label for="category">Category</label> | 41 | <label for="category">Category</label> |
33 | <select id="category" formControlName="category"> | 42 | <div class="peertube-select-container"> |
34 | <option></option> | 43 | <select id="category" formControlName="category"> |
35 | <option *ngFor="let category of videoCategories" [value]="category.id">{{ category.label }}</option> | 44 | <option></option> |
36 | </select> | 45 | <option *ngFor="let category of videoCategories" [value]="category.id">{{ category.label }}</option> |
46 | </select> | ||
47 | </div> | ||
37 | 48 | ||
38 | <div *ngIf="formErrors.category" class="form-error"> | 49 | <div *ngIf="formErrors.category" class="form-error"> |
39 | {{ formErrors.category }} | 50 | {{ formErrors.category }} |
@@ -42,10 +53,12 @@ | |||
42 | 53 | ||
43 | <div class="form-group"> | 54 | <div class="form-group"> |
44 | <label for="licence">Licence</label> | 55 | <label for="licence">Licence</label> |
45 | <select id="licence" formControlName="licence"> | 56 | <div class="peertube-select-container"> |
46 | <option></option> | 57 | <select id="licence" formControlName="licence"> |
47 | <option *ngFor="let licence of videoLicences" [value]="licence.id">{{ licence.label }}</option> | 58 | <option></option> |
48 | </select> | 59 | <option *ngFor="let licence of videoLicences" [value]="licence.id">{{ licence.label }}</option> |
60 | </select> | ||
61 | </div> | ||
49 | 62 | ||
50 | <div *ngIf="formErrors.licence" class="form-error"> | 63 | <div *ngIf="formErrors.licence" class="form-error"> |
51 | {{ formErrors.licence }} | 64 | {{ formErrors.licence }} |
@@ -54,10 +67,12 @@ | |||
54 | 67 | ||
55 | <div class="form-group"> | 68 | <div class="form-group"> |
56 | <label for="language">Language</label> | 69 | <label for="language">Language</label> |
57 | <select id="language" formControlName="language"> | 70 | <div class="peertube-select-container"> |
58 | <option></option> | 71 | <select id="language" formControlName="language"> |
59 | <option *ngFor="let language of videoLanguages" [value]="language.id">{{ language.label }}</option> | 72 | <option></option> |
60 | </select> | 73 | <option *ngFor="let language of videoLanguages" [value]="language.id">{{ language.label }}</option> |
74 | </select> | ||
75 | </div> | ||
61 | 76 | ||
62 | <div *ngIf="formErrors.language" class="form-error"> | 77 | <div *ngIf="formErrors.language" class="form-error"> |
63 | {{ formErrors.language }} | 78 | {{ formErrors.language }} |
@@ -66,11 +81,12 @@ | |||
66 | 81 | ||
67 | <div class="form-group"> | 82 | <div class="form-group"> |
68 | <label for="privacy">Privacy</label> | 83 | <label for="privacy">Privacy</label> |
69 | <select id="privacy" formControlName="privacy"> | 84 | <div class="peertube-select-container"> |
70 | 85 | <select id="privacy" formControlName="privacy"> | |
71 | <option></option> | 86 | <option></option> |
72 | <option *ngFor="let privacy of videoPrivacies" [value]="privacy.id">{{ privacy.label }}</option> | 87 | <option *ngFor="let privacy of videoPrivacies" [value]="privacy.id">{{ privacy.label }}</option> |
73 | </select> | 88 | </select> |
89 | </div> | ||
74 | 90 | ||
75 | <div *ngIf="formErrors.privacy" class="form-error"> | 91 | <div *ngIf="formErrors.privacy" class="form-error"> |
76 | {{ formErrors.privacy }} | 92 | {{ formErrors.privacy }} |
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 f4466bdde..ba0ca1e21 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,6 +1,14 @@ | |||
1 | @import '_variables'; | 1 | @import '_variables'; |
2 | @import '_mixins'; | 2 | @import '_mixins'; |
3 | 3 | ||
4 | .peertube-select-container { | ||
5 | @include peertube-select-container(auto); | ||
6 | } | ||
7 | |||
8 | .peertube-select-disabled-container { | ||
9 | @include peertube-select-disabled-container(auto); | ||
10 | } | ||
11 | |||
4 | .video-edit { | 12 | .video-edit { |
5 | height: 100%; | 13 | height: 100%; |
6 | 14 | ||
@@ -17,10 +25,6 @@ | |||
17 | } | 25 | } |
18 | } | 26 | } |
19 | 27 | ||
20 | select { | ||
21 | @include peertube-select(100%); | ||
22 | } | ||
23 | |||
24 | input, select { | 28 | input, select { |
25 | font-size: 15px | 29 | font-size: 15px |
26 | } | 30 | } |
diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.ts b/client/src/app/videos/+video-edit/shared/video-edit.component.ts index 28c9134a7..7fe265284 100644 --- a/client/src/app/videos/+video-edit/shared/video-edit.component.ts +++ b/client/src/app/videos/+video-edit/shared/video-edit.component.ts | |||
@@ -4,6 +4,7 @@ import { ActivatedRoute, Router } from '@angular/router' | |||
4 | import { NotificationsService } from 'angular2-notifications' | 4 | import { NotificationsService } from 'angular2-notifications' |
5 | import 'rxjs/add/observable/forkJoin' | 5 | import 'rxjs/add/observable/forkJoin' |
6 | import { ServerService } from '../../../core/server' | 6 | import { ServerService } from '../../../core/server' |
7 | import { VIDEO_CHANNEL } from '../../../shared/forms/form-validators' | ||
7 | import { ValidatorMessage } from '../../../shared/forms/form-validators/validator-message' | 8 | import { ValidatorMessage } from '../../../shared/forms/form-validators/validator-message' |
8 | import { | 9 | import { |
9 | VIDEO_CATEGORY, | 10 | VIDEO_CATEGORY, |
@@ -27,6 +28,7 @@ export class VideoEditComponent implements OnInit { | |||
27 | @Input() formErrors: { [ id: string ]: string } = {} | 28 | @Input() formErrors: { [ id: string ]: string } = {} |
28 | @Input() validationMessages: ValidatorMessage = {} | 29 | @Input() validationMessages: ValidatorMessage = {} |
29 | @Input() videoPrivacies = [] | 30 | @Input() videoPrivacies = [] |
31 | @Input() userVideoChannels = [] | ||
30 | 32 | ||
31 | tags: string[] = [] | 33 | tags: string[] = [] |
32 | videoCategories = [] | 34 | videoCategories = [] |
@@ -50,6 +52,7 @@ export class VideoEditComponent implements OnInit { | |||
50 | updateForm () { | 52 | updateForm () { |
51 | this.formErrors['name'] = '' | 53 | this.formErrors['name'] = '' |
52 | this.formErrors['privacy'] = '' | 54 | this.formErrors['privacy'] = '' |
55 | this.formErrors['channelId'] = '' | ||
53 | this.formErrors['category'] = '' | 56 | this.formErrors['category'] = '' |
54 | this.formErrors['licence'] = '' | 57 | this.formErrors['licence'] = '' |
55 | this.formErrors['language'] = '' | 58 | this.formErrors['language'] = '' |
@@ -57,6 +60,7 @@ export class VideoEditComponent implements OnInit { | |||
57 | 60 | ||
58 | this.validationMessages['name'] = VIDEO_NAME.MESSAGES | 61 | this.validationMessages['name'] = VIDEO_NAME.MESSAGES |
59 | this.validationMessages['privacy'] = VIDEO_PRIVACY.MESSAGES | 62 | this.validationMessages['privacy'] = VIDEO_PRIVACY.MESSAGES |
63 | this.validationMessages['channelId'] = VIDEO_CHANNEL.MESSAGES | ||
60 | this.validationMessages['category'] = VIDEO_CATEGORY.MESSAGES | 64 | this.validationMessages['category'] = VIDEO_CATEGORY.MESSAGES |
61 | this.validationMessages['licence'] = VIDEO_LICENCE.MESSAGES | 65 | this.validationMessages['licence'] = VIDEO_LICENCE.MESSAGES |
62 | this.validationMessages['language'] = VIDEO_LANGUAGE.MESSAGES | 66 | this.validationMessages['language'] = VIDEO_LANGUAGE.MESSAGES |
@@ -64,6 +68,7 @@ export class VideoEditComponent implements OnInit { | |||
64 | 68 | ||
65 | this.form.addControl('name', new FormControl('', VIDEO_NAME.VALIDATORS)) | 69 | this.form.addControl('name', new FormControl('', VIDEO_NAME.VALIDATORS)) |
66 | this.form.addControl('privacy', new FormControl('', VIDEO_PRIVACY.VALIDATORS)) | 70 | this.form.addControl('privacy', new FormControl('', VIDEO_PRIVACY.VALIDATORS)) |
71 | this.form.addControl('channelId', new FormControl({ value: '', disabled: true })) | ||
67 | this.form.addControl('nsfw', new FormControl(false)) | 72 | this.form.addControl('nsfw', new FormControl(false)) |
68 | this.form.addControl('category', new FormControl('', VIDEO_CATEGORY.VALIDATORS)) | 73 | this.form.addControl('category', new FormControl('', VIDEO_CATEGORY.VALIDATORS)) |
69 | this.form.addControl('licence', new FormControl('', VIDEO_LICENCE.VALIDATORS)) | 74 | this.form.addControl('licence', new FormControl('', VIDEO_LICENCE.VALIDATORS)) |