diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-04-07 14:57:05 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-04-07 14:57:05 +0200 |
commit | db216afd980846c418a4ebab8190c3ead561dfc1 (patch) | |
tree | 4542ab1e5c9b4d750f5877e22b1de627892564d2 /client/src/app/videos/video-add | |
parent | 3092476e64d09b449b4ad4f5198024afec1b22ca (diff) | |
download | PeerTube-db216afd980846c418a4ebab8190c3ead561dfc1.tar.gz PeerTube-db216afd980846c418a4ebab8190c3ead561dfc1.tar.zst PeerTube-db216afd980846c418a4ebab8190c3ead561dfc1.zip |
Client: support video language
Diffstat (limited to 'client/src/app/videos/video-add')
-rw-r--r-- | client/src/app/videos/video-add/video-add.component.html | 12 | ||||
-rw-r--r-- | client/src/app/videos/video-add/video-add.component.ts | 13 |
2 files changed, 25 insertions, 0 deletions
diff --git a/client/src/app/videos/video-add/video-add.component.html b/client/src/app/videos/video-add/video-add.component.html index a3c25c14b..104747a8c 100644 --- a/client/src/app/videos/video-add/video-add.component.html +++ b/client/src/app/videos/video-add/video-add.component.html | |||
@@ -47,6 +47,18 @@ | |||
47 | </div> | 47 | </div> |
48 | 48 | ||
49 | <div class="form-group"> | 49 | <div class="form-group"> |
50 | <label for="language">Language</label> | ||
51 | <select class="form-control" id="language" formControlName="language"> | ||
52 | <option></option> | ||
53 | <option *ngFor="let language of videoLanguages" [value]="language.id">{{ language.label }}</option> | ||
54 | </select> | ||
55 | |||
56 | <div *ngIf="formErrors.language" class="alert alert-danger"> | ||
57 | {{ formErrors.language }} | ||
58 | </div> | ||
59 | </div> | ||
60 | |||
61 | <div class="form-group"> | ||
50 | <label for="tags">Tags</label> <span class="little-information">(press enter to add the tag)</span> | 62 | <label for="tags">Tags</label> <span class="little-information">(press enter to add the tag)</span> |
51 | <input | 63 | <input |
52 | type="text" class="form-control" id="currentTag" | 64 | type="text" class="form-control" id="currentTag" |
diff --git a/client/src/app/videos/video-add/video-add.component.ts b/client/src/app/videos/video-add/video-add.component.ts index ea7ad2e5c..da556f48d 100644 --- a/client/src/app/videos/video-add/video-add.component.ts +++ b/client/src/app/videos/video-add/video-add.component.ts | |||
@@ -11,6 +11,7 @@ import { | |||
11 | VIDEO_NAME, | 11 | VIDEO_NAME, |
12 | VIDEO_CATEGORY, | 12 | VIDEO_CATEGORY, |
13 | VIDEO_LICENCE, | 13 | VIDEO_LICENCE, |
14 | VIDEO_LANGUAGE, | ||
14 | VIDEO_DESCRIPTION, | 15 | VIDEO_DESCRIPTION, |
15 | VIDEO_TAGS | 16 | VIDEO_TAGS |
16 | } from '../../shared'; | 17 | } from '../../shared'; |
@@ -27,6 +28,7 @@ export class VideoAddComponent extends FormReactive implements OnInit { | |||
27 | uploader: FileUploader; | 28 | uploader: FileUploader; |
28 | videoCategories = []; | 29 | videoCategories = []; |
29 | videoLicences = []; | 30 | videoLicences = []; |
31 | videoLanguages = []; | ||
30 | 32 | ||
31 | error: string = null; | 33 | error: string = null; |
32 | form: FormGroup; | 34 | form: FormGroup; |
@@ -34,6 +36,7 @@ export class VideoAddComponent extends FormReactive implements OnInit { | |||
34 | name: '', | 36 | name: '', |
35 | category: '', | 37 | category: '', |
36 | licence: '', | 38 | licence: '', |
39 | language: '', | ||
37 | description: '', | 40 | description: '', |
38 | currentTag: '' | 41 | currentTag: '' |
39 | }; | 42 | }; |
@@ -41,6 +44,7 @@ export class VideoAddComponent extends FormReactive implements OnInit { | |||
41 | name: VIDEO_NAME.MESSAGES, | 44 | name: VIDEO_NAME.MESSAGES, |
42 | category: VIDEO_CATEGORY.MESSAGES, | 45 | category: VIDEO_CATEGORY.MESSAGES, |
43 | licence: VIDEO_LICENCE.MESSAGES, | 46 | licence: VIDEO_LICENCE.MESSAGES, |
47 | language: VIDEO_LANGUAGE.MESSAGES, | ||
44 | description: VIDEO_DESCRIPTION.MESSAGES, | 48 | description: VIDEO_DESCRIPTION.MESSAGES, |
45 | currentTag: VIDEO_TAGS.MESSAGES | 49 | currentTag: VIDEO_TAGS.MESSAGES |
46 | }; | 50 | }; |
@@ -74,6 +78,7 @@ export class VideoAddComponent extends FormReactive implements OnInit { | |||
74 | nsfw: [ false ], | 78 | nsfw: [ false ], |
75 | category: [ '', VIDEO_CATEGORY.VALIDATORS ], | 79 | category: [ '', VIDEO_CATEGORY.VALIDATORS ], |
76 | licence: [ '', VIDEO_LICENCE.VALIDATORS ], | 80 | licence: [ '', VIDEO_LICENCE.VALIDATORS ], |
81 | language: [ '', VIDEO_LANGUAGE.VALIDATORS ], | ||
77 | description: [ '', VIDEO_DESCRIPTION.VALIDATORS ], | 82 | description: [ '', VIDEO_DESCRIPTION.VALIDATORS ], |
78 | currentTag: [ '', VIDEO_TAGS.VALIDATORS ] | 83 | currentTag: [ '', VIDEO_TAGS.VALIDATORS ] |
79 | }); | 84 | }); |
@@ -84,6 +89,7 @@ export class VideoAddComponent extends FormReactive implements OnInit { | |||
84 | ngOnInit() { | 89 | ngOnInit() { |
85 | this.videoCategories = this.videoService.videoCategories; | 90 | this.videoCategories = this.videoService.videoCategories; |
86 | this.videoLicences = this.videoService.videoLicences; | 91 | this.videoLicences = this.videoService.videoLicences; |
92 | this.videoLanguages = this.videoService.videoLanguages; | ||
87 | 93 | ||
88 | this.uploader = new FileUploader({ | 94 | this.uploader = new FileUploader({ |
89 | authToken: this.authService.getRequestHeaderValue(), | 95 | authToken: this.authService.getRequestHeaderValue(), |
@@ -97,12 +103,19 @@ export class VideoAddComponent extends FormReactive implements OnInit { | |||
97 | const nsfw = this.form.value['nsfw']; | 103 | const nsfw = this.form.value['nsfw']; |
98 | const category = this.form.value['category']; | 104 | const category = this.form.value['category']; |
99 | const licence = this.form.value['licence']; | 105 | const licence = this.form.value['licence']; |
106 | const language = this.form.value['language']; | ||
100 | const description = this.form.value['description']; | 107 | const description = this.form.value['description']; |
101 | 108 | ||
102 | form.append('name', name); | 109 | form.append('name', name); |
103 | form.append('category', category); | 110 | form.append('category', category); |
104 | form.append('nsfw', nsfw); | 111 | form.append('nsfw', nsfw); |
105 | form.append('licence', licence); | 112 | form.append('licence', licence); |
113 | |||
114 | // Language is optional | ||
115 | if (language) { | ||
116 | form.append('language', language); | ||
117 | } | ||
118 | |||
106 | form.append('description', description); | 119 | form.append('description', description); |
107 | 120 | ||
108 | for (let i = 0; i < this.tags.length; i++) { | 121 | for (let i = 0; i < this.tags.length; i++) { |