aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-12-14 17:17:01 +0100
committerChocobozzz <me@florianbigard.com>2021-12-14 17:17:01 +0100
commit3cf68b869decf07ff7435fe1436d4f3134df1bf4 (patch)
tree836efe5ddc626fef3ba4c96269efbca305f46256 /client/src/app/+videos
parenta6f919e455f2c6ae8f2194da4aa66824a6bfd09e (diff)
downloadPeerTube-3cf68b869decf07ff7435fe1436d4f3134df1bf4.tar.gz
PeerTube-3cf68b869decf07ff7435fe1436d4f3134df1bf4.tar.zst
PeerTube-3cf68b869decf07ff7435fe1436d4f3134df1bf4.zip
Ability for admins to set default upload values
Diffstat (limited to 'client/src/app/+videos')
-rw-r--r--client/src/app/+videos/+video-edit/shared/video-edit.component.ts9
-rw-r--r--client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts2
-rw-r--r--client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts2
-rw-r--r--client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts2
-rw-r--r--client/src/app/+videos/+video-edit/video-add-components/video-send.ts4
-rw-r--r--client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts2
-rw-r--r--client/src/app/+videos/+video-watch/shared/action-buttons/action-buttons.component.html2
-rw-r--r--client/src/app/+videos/+video-watch/shared/action-buttons/action-buttons.component.scss3
-rw-r--r--client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.html14
9 files changed, 18 insertions, 22 deletions
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 39767f258..2bec933e9 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
@@ -110,9 +110,10 @@ export class VideoEditComponent implements OnInit, OnDestroy {
110 updateForm () { 110 updateForm () {
111 const defaultValues: any = { 111 const defaultValues: any = {
112 nsfw: 'false', 112 nsfw: 'false',
113 commentsEnabled: 'true', 113 commentsEnabled: this.serverConfig.defaults.publish.commentsEnabled,
114 downloadEnabled: 'true', 114 downloadEnabled: this.serverConfig.defaults.publish.downloadEnabled,
115 waitTranscoding: 'true', 115 waitTranscoding: 'true',
116 licence: this.serverConfig.defaults.publish.licence,
116 tags: [] 117 tags: []
117 } 118 }
118 const obj: any = { 119 const obj: any = {
@@ -160,6 +161,8 @@ export class VideoEditComponent implements OnInit, OnDestroy {
160 } 161 }
161 162
162 ngOnInit () { 163 ngOnInit () {
164 this.serverConfig = this.serverService.getHTMLConfig()
165
163 this.updateForm() 166 this.updateForm()
164 167
165 this.pluginService.ensurePluginsAreLoaded('video-edit') 168 this.pluginService.ensurePluginsAreLoaded('video-edit')
@@ -200,8 +203,6 @@ export class VideoEditComponent implements OnInit, OnDestroy {
200 } 203 }
201 }) 204 })
202 205
203 this.serverConfig = this.serverService.getHTMLConfig()
204
205 this.initialVideoCaptions = this.videoCaptions.map(c => c.language.id) 206 this.initialVideoCaptions = this.videoCaptions.map(c => c.language.id)
206 207
207 this.ngZone.runOutsideAngular(() => { 208 this.ngZone.runOutsideAngular(() => {
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts
index 01eabb0d7..46a7ebb0b 100644
--- a/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts
+++ b/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts
@@ -70,8 +70,6 @@ export class VideoGoLiveComponent extends VideoSend implements OnInit, AfterView
70 privacy: this.highestPrivacy, 70 privacy: this.highestPrivacy,
71 nsfw: this.serverConfig.instance.isNSFW, 71 nsfw: this.serverConfig.instance.isNSFW,
72 waitTranscoding: true, 72 waitTranscoding: true,
73 commentsEnabled: true,
74 downloadEnabled: true,
75 permanentLive: this.firstStepPermanentLive, 73 permanentLive: this.firstStepPermanentLive,
76 saveReplay: this.firstStepPermanentLive === false && this.isReplayAllowed(), 74 saveReplay: this.firstStepPermanentLive === false && this.isReplayAllowed(),
77 channelId: this.firstStepChannelId 75 channelId: this.firstStepChannelId
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts
index 87e47683f..5e758910e 100644
--- a/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts
+++ b/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts
@@ -81,8 +81,6 @@ export class VideoImportTorrentComponent extends VideoSend implements OnInit, Af
81 const videoUpdate: VideoUpdate = { 81 const videoUpdate: VideoUpdate = {
82 privacy: this.highestPrivacy, 82 privacy: this.highestPrivacy,
83 waitTranscoding: false, 83 waitTranscoding: false,
84 commentsEnabled: true,
85 downloadEnabled: true,
86 channelId: this.firstStepChannelId 84 channelId: this.firstStepChannelId
87 } 85 }
88 86
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts
index 3487c1adf..2ea70ed55 100644
--- a/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts
+++ b/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts
@@ -68,8 +68,6 @@ export class VideoImportUrlComponent extends VideoSend implements OnInit, AfterV
68 const videoUpdate: VideoUpdate = { 68 const videoUpdate: VideoUpdate = {
69 privacy: this.highestPrivacy, 69 privacy: this.highestPrivacy,
70 waitTranscoding: false, 70 waitTranscoding: false,
71 commentsEnabled: true,
72 downloadEnabled: true,
73 channelId: this.firstStepChannelId 71 channelId: this.firstStepChannelId
74 } 72 }
75 73
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-send.ts b/client/src/app/+videos/+video-edit/video-add-components/video-send.ts
index efa8c85a3..5e086ef42 100644
--- a/client/src/app/+videos/+video-edit/video-add-components/video-send.ts
+++ b/client/src/app/+videos/+video-edit/video-add-components/video-send.ts
@@ -49,7 +49,9 @@ export abstract class VideoSend extends FormReactive implements OnInit {
49 this.serverService.getVideoPrivacies() 49 this.serverService.getVideoPrivacies()
50 .subscribe( 50 .subscribe(
51 privacies => { 51 privacies => {
52 const { videoPrivacies, defaultPrivacyId } = this.videoService.explainedPrivacyLabels(privacies) 52 const defaultPrivacy = this.serverConfig.defaults.publish.privacy
53
54 const { videoPrivacies, defaultPrivacyId } = this.videoService.explainedPrivacyLabels(privacies, defaultPrivacy)
53 55
54 this.videoPrivacies = videoPrivacies 56 this.videoPrivacies = videoPrivacies
55 this.firstStepPrivacyId = defaultPrivacyId 57 this.firstStepPrivacyId = defaultPrivacyId
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts
index 28d7ec458..76f154249 100644
--- a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts
+++ b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts
@@ -277,8 +277,6 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy
277 private uploadFile (file: File, previewfile?: File) { 277 private uploadFile (file: File, previewfile?: File) {
278 const metadata = { 278 const metadata = {
279 waitTranscoding: true, 279 waitTranscoding: true,
280 commentsEnabled: true,
281 downloadEnabled: true,
282 channelId: this.firstStepChannelId, 280 channelId: this.firstStepChannelId,
283 nsfw: this.serverConfig.instance.isNSFW, 281 nsfw: this.serverConfig.instance.isNSFW,
284 privacy: this.highestPrivacy.toString(), 282 privacy: this.highestPrivacy.toString(),
diff --git a/client/src/app/+videos/+video-watch/shared/action-buttons/action-buttons.component.html b/client/src/app/+videos/+video-watch/shared/action-buttons/action-buttons.component.html
index 8fb244cc4..f23efca98 100644
--- a/client/src/app/+videos/+video-watch/shared/action-buttons/action-buttons.component.html
+++ b/client/src/app/+videos/+video-watch/shared/action-buttons/action-buttons.component.html
@@ -36,7 +36,7 @@
36 36
37 <ng-container *ngIf="!isUserLoggedIn && !video.isLive"> 37 <ng-container *ngIf="!isUserLoggedIn && !video.isLive">
38 <button 38 <button
39 *ngIf="isVideoDownloadable()" class="action-button action-button-save" 39 *ngIf="isVideoDownloadable()" class="action-button action-button-download"
40 (click)="showDownloadModal()" (keydown.enter)="showDownloadModal()" 40 (click)="showDownloadModal()" (keydown.enter)="showDownloadModal()"
41 > 41 >
42 <my-global-icon iconName="download" aria-hidden="true"></my-global-icon> 42 <my-global-icon iconName="download" aria-hidden="true"></my-global-icon>
diff --git a/client/src/app/+videos/+video-watch/shared/action-buttons/action-buttons.component.scss b/client/src/app/+videos/+video-watch/shared/action-buttons/action-buttons.component.scss
index 967d515e6..fdf4e3edb 100644
--- a/client/src/app/+videos/+video-watch/shared/action-buttons/action-buttons.component.scss
+++ b/client/src/app/+videos/+video-watch/shared/action-buttons/action-buttons.component.scss
@@ -49,7 +49,8 @@
49 } 49 }
50 } 50 }
51 51
52 &.action-button-save { 52 &.action-button-save,
53 &.action-button-download {
53 my-global-icon { 54 my-global-icon {
54 top: 0 !important; 55 top: 0 !important;
55 right: -1px; 56 right: -1px;
diff --git a/client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.html b/client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.html
index d65c9356a..10ff46595 100644
--- a/client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.html
+++ b/client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.html
@@ -1,9 +1,9 @@
1<div class="attribute"> 1<div class="attribute attribute-privacy">
2 <span i18n class="attribute-label">Privacy</span> 2 <span i18n class="attribute-label">Privacy</span>
3 <span class="attribute-value">{{ video.privacy.label }}</span> 3 <span class="attribute-value">{{ video.privacy.label }}</span>
4</div> 4</div>
5 5
6<div *ngIf="video.isLocal === false" class="attribute"> 6<div *ngIf="video.isLocal === false" class="attribute attribute-origin">
7 <span i18n class="attribute-label">Origin</span> 7 <span i18n class="attribute-label">Origin</span>
8 <a 8 <a
9 class="attribute-value" target="_blank" rel="noopener noreferrer" 9 class="attribute-value" target="_blank" rel="noopener noreferrer"
@@ -16,12 +16,12 @@
16 ></a> 16 ></a>
17</div> 17</div>
18 18
19<div *ngIf="!!video.originallyPublishedAt" class="attribute"> 19<div *ngIf="!!video.originallyPublishedAt" class="attribute attribute-originally-published-at">
20 <span i18n class="attribute-label">Originally published</span> 20 <span i18n class="attribute-label">Originally published</span>
21 <span class="attribute-value">{{ video.originallyPublishedAt | date: 'dd MMMM yyyy' }}</span> 21 <span class="attribute-value">{{ video.originallyPublishedAt | date: 'dd MMMM yyyy' }}</span>
22</div> 22</div>
23 23
24<div class="attribute"> 24<div class="attribute attribute-category">
25 <span i18n class="attribute-label">Category</span> 25 <span i18n class="attribute-label">Category</span>
26 <span *ngIf="!video.category.id" class="attribute-value">{{ video.category.label }}</span> 26 <span *ngIf="!video.category.id" class="attribute-value">{{ video.category.label }}</span>
27 <a 27 <a
@@ -30,7 +30,7 @@
30 >{{ video.category.label }}</a> 30 >{{ video.category.label }}</a>
31</div> 31</div>
32 32
33<div class="attribute"> 33<div class="attribute attribute-licence">
34 <span i18n class="attribute-label">Licence</span> 34 <span i18n class="attribute-label">Licence</span>
35 <span *ngIf="!video.licence.id" class="attribute-value">{{ video.licence.label }}</span> 35 <span *ngIf="!video.licence.id" class="attribute-value">{{ video.licence.label }}</span>
36 <a 36 <a
@@ -39,7 +39,7 @@
39 >{{ video.licence.label }}</a> 39 >{{ video.licence.label }}</a>
40</div> 40</div>
41 41
42<div class="attribute"> 42<div class="attribute attribute-language">
43 <span i18n class="attribute-label">Language</span> 43 <span i18n class="attribute-label">Language</span>
44 <span *ngIf="!video.language.id" class="attribute-value">{{ video.language.label }}</span> 44 <span *ngIf="!video.language.id" class="attribute-value">{{ video.language.label }}</span>
45 <a 45 <a
@@ -56,7 +56,7 @@
56 >{{ tag }}</a> 56 >{{ tag }}</a>
57</div> 57</div>
58 58
59<div class="attribute" *ngIf="!video.isLive"> 59<div class="attribute attribute-duration" *ngIf="!video.isLive">
60 <span i18n class="attribute-label">Duration</span> 60 <span i18n class="attribute-label">Duration</span>
61 <span class="attribute-value">{{ video.duration | myDurationFormatter }}</span> 61 <span class="attribute-value">{{ video.duration | myDurationFormatter }}</span>
62</div> 62</div>