diff options
author | Chocobozzz <me@florianbigard.com> | 2018-06-15 16:52:15 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-15 18:20:56 +0200 |
commit | bbe0f0645ca958d33a3f409b15166609733b663f (patch) | |
tree | edcd5d702c73cda74a2177c4bdc08c616334337d /client/src/app/shared/forms | |
parent | 2baea0c77cc765f7cbca9c9a2f4272268892a35c (diff) | |
download | PeerTube-bbe0f0645ca958d33a3f409b15166609733b663f.tar.gz PeerTube-bbe0f0645ca958d33a3f409b15166609733b663f.tar.zst PeerTube-bbe0f0645ca958d33a3f409b15166609733b663f.zip |
Add ability to schedule video publication
Diffstat (limited to 'client/src/app/shared/forms')
-rw-r--r-- | client/src/app/shared/forms/form-validators/video-validators.service.ts | 8 | ||||
-rw-r--r-- | client/src/app/shared/forms/markdown-textarea.component.ts | 9 |
2 files changed, 14 insertions, 3 deletions
diff --git a/client/src/app/shared/forms/form-validators/video-validators.service.ts b/client/src/app/shared/forms/form-validators/video-validators.service.ts index 76fc5cf04..396be6f3b 100644 --- a/client/src/app/shared/forms/form-validators/video-validators.service.ts +++ b/client/src/app/shared/forms/form-validators/video-validators.service.ts | |||
@@ -15,6 +15,7 @@ export class VideoValidatorsService { | |||
15 | readonly VIDEO_DESCRIPTION: BuildFormValidator | 15 | readonly VIDEO_DESCRIPTION: BuildFormValidator |
16 | readonly VIDEO_TAGS: BuildFormValidator | 16 | readonly VIDEO_TAGS: BuildFormValidator |
17 | readonly VIDEO_SUPPORT: BuildFormValidator | 17 | readonly VIDEO_SUPPORT: BuildFormValidator |
18 | readonly VIDEO_SCHEDULE_PUBLICATION_AT: BuildFormValidator | ||
18 | 19 | ||
19 | constructor (private i18n: I18n) { | 20 | constructor (private i18n: I18n) { |
20 | 21 | ||
@@ -84,5 +85,12 @@ export class VideoValidatorsService { | |||
84 | 'maxlength': this.i18n('Video support cannot be more than 500 characters long.') | 85 | 'maxlength': this.i18n('Video support cannot be more than 500 characters long.') |
85 | } | 86 | } |
86 | } | 87 | } |
88 | |||
89 | this.VIDEO_SCHEDULE_PUBLICATION_AT = { | ||
90 | VALIDATORS: [ ], | ||
91 | MESSAGES: { | ||
92 | 'required': this.i18n('A date is required to schedule video update.') | ||
93 | } | ||
94 | } | ||
87 | } | 95 | } |
88 | } | 96 | } |
diff --git a/client/src/app/shared/forms/markdown-textarea.component.ts b/client/src/app/shared/forms/markdown-textarea.component.ts index 8b932cd15..db6f9e5c8 100644 --- a/client/src/app/shared/forms/markdown-textarea.component.ts +++ b/client/src/app/shared/forms/markdown-textarea.component.ts | |||
@@ -1,10 +1,10 @@ | |||
1 | import { debounceTime, distinctUntilChanged } from 'rxjs/operators' | 1 | import { debounceTime, distinctUntilChanged } from 'rxjs/operators' |
2 | import { Component, forwardRef, Input, OnInit } from '@angular/core' | 2 | import { Component, forwardRef, Input, OnInit } from '@angular/core' |
3 | import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms' | 3 | import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms' |
4 | import { isInSmallView } from '@app/shared/misc/utils' | ||
5 | import { MarkdownService } from '@app/videos/shared' | 4 | import { MarkdownService } from '@app/videos/shared' |
6 | import { Subject } from 'rxjs/Subject' | 5 | import { Subject } from 'rxjs/Subject' |
7 | import truncate from 'lodash-es/truncate' | 6 | import truncate from 'lodash-es/truncate' |
7 | import { ScreenService } from '@app/shared/misc/screen.service' | ||
8 | 8 | ||
9 | @Component({ | 9 | @Component({ |
10 | selector: 'my-markdown-textarea', | 10 | selector: 'my-markdown-textarea', |
@@ -35,7 +35,10 @@ export class MarkdownTextareaComponent implements ControlValueAccessor, OnInit { | |||
35 | 35 | ||
36 | private contentChanged = new Subject<string>() | 36 | private contentChanged = new Subject<string>() |
37 | 37 | ||
38 | constructor (private markdownService: MarkdownService) {} | 38 | constructor ( |
39 | private screenService: ScreenService, | ||
40 | private markdownService: MarkdownService | ||
41 | ) {} | ||
39 | 42 | ||
40 | ngOnInit () { | 43 | ngOnInit () { |
41 | this.contentChanged | 44 | this.contentChanged |
@@ -76,7 +79,7 @@ export class MarkdownTextareaComponent implements ControlValueAccessor, OnInit { | |||
76 | } | 79 | } |
77 | 80 | ||
78 | arePreviewsDisplayed () { | 81 | arePreviewsDisplayed () { |
79 | return isInSmallView() === false | 82 | return this.screenService.isInSmallView() === false |
80 | } | 83 | } |
81 | 84 | ||
82 | private updatePreviews () { | 85 | private updatePreviews () { |