diff options
author | Chocobozzz <chocobozzz@cpy.re> | 2021-05-27 15:59:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-27 15:59:55 +0200 |
commit | 2539932e16129992a2c0889b4ff527c265a8e2c7 (patch) | |
tree | fb5048e63e02a2485eb96d27455f43e4b22e8ae0 /shared/models | |
parent | eb34ec30e0b57286fc6f85160490d2e973a3b0b1 (diff) | |
download | PeerTube-2539932e16129992a2c0889b4ff527c265a8e2c7.tar.gz PeerTube-2539932e16129992a2c0889b4ff527c265a8e2c7.tar.zst PeerTube-2539932e16129992a2c0889b4ff527c265a8e2c7.zip |
Instance homepage support (#4007)
* Prepare homepage parsers
* Add ability to update instance hompage
* Add ability to set homepage as landing page
* Add homepage preview in admin
* Dynamically update left menu for homepage
* Inject home content in homepage
* Add videos list and channel miniature custom markup
* Remove unused elements in markup service
Diffstat (limited to 'shared/models')
-rw-r--r-- | shared/models/actors/custom-page.model.ts | 3 | ||||
-rw-r--r-- | shared/models/actors/index.ts | 1 | ||||
-rw-r--r-- | shared/models/custom-markup/custom-markup-data.model.ts | 28 | ||||
-rw-r--r-- | shared/models/custom-markup/index.ts | 1 | ||||
-rw-r--r-- | shared/models/index.ts | 1 | ||||
-rw-r--r-- | shared/models/server/server-config.model.ts | 4 | ||||
-rw-r--r-- | shared/models/users/user-right.enum.ts | 1 |
7 files changed, 39 insertions, 0 deletions
diff --git a/shared/models/actors/custom-page.model.ts b/shared/models/actors/custom-page.model.ts new file mode 100644 index 000000000..1e33584c1 --- /dev/null +++ b/shared/models/actors/custom-page.model.ts | |||
@@ -0,0 +1,3 @@ | |||
1 | export interface CustomPage { | ||
2 | content: string | ||
3 | } | ||
diff --git a/shared/models/actors/index.ts b/shared/models/actors/index.ts index 156f83248..e03f168cd 100644 --- a/shared/models/actors/index.ts +++ b/shared/models/actors/index.ts | |||
@@ -2,4 +2,5 @@ export * from './account.model' | |||
2 | export * from './actor-image.model' | 2 | export * from './actor-image.model' |
3 | export * from './actor-image.type' | 3 | export * from './actor-image.type' |
4 | export * from './actor.model' | 4 | export * from './actor.model' |
5 | export * from './custom-page.model' | ||
5 | export * from './follow.model' | 6 | export * from './follow.model' |
diff --git a/shared/models/custom-markup/custom-markup-data.model.ts b/shared/models/custom-markup/custom-markup-data.model.ts new file mode 100644 index 000000000..af697428e --- /dev/null +++ b/shared/models/custom-markup/custom-markup-data.model.ts | |||
@@ -0,0 +1,28 @@ | |||
1 | export type EmbedMarkupData = { | ||
2 | // Video or playlist uuid | ||
3 | uuid: string | ||
4 | } | ||
5 | |||
6 | export type VideoMiniatureMarkupData = { | ||
7 | // Video uuid | ||
8 | uuid: string | ||
9 | } | ||
10 | |||
11 | export type PlaylistMiniatureMarkupData = { | ||
12 | // Playlist uuid | ||
13 | uuid: string | ||
14 | } | ||
15 | |||
16 | export type ChannelMiniatureMarkupData = { | ||
17 | // Channel name (username) | ||
18 | name: string | ||
19 | } | ||
20 | |||
21 | export type VideosListMarkupData = { | ||
22 | title: string | ||
23 | description: string | ||
24 | sort: string | ||
25 | categoryOneOf: string // coma separated values | ||
26 | languageOneOf: string // coma separated values | ||
27 | count: string | ||
28 | } | ||
diff --git a/shared/models/custom-markup/index.ts b/shared/models/custom-markup/index.ts new file mode 100644 index 000000000..2898dfa90 --- /dev/null +++ b/shared/models/custom-markup/index.ts | |||
@@ -0,0 +1 @@ | |||
export * from './custom-markup-data.model' | |||
diff --git a/shared/models/index.ts b/shared/models/index.ts index dff5fdf0e..4db1f234e 100644 --- a/shared/models/index.ts +++ b/shared/models/index.ts | |||
@@ -1,6 +1,7 @@ | |||
1 | export * from './activitypub' | 1 | export * from './activitypub' |
2 | export * from './actors' | 2 | export * from './actors' |
3 | export * from './moderation' | 3 | export * from './moderation' |
4 | export * from './custom-markup' | ||
4 | export * from './bulk' | 5 | export * from './bulk' |
5 | export * from './redundancy' | 6 | export * from './redundancy' |
6 | export * from './users' | 7 | export * from './users' |
diff --git a/shared/models/server/server-config.model.ts b/shared/models/server/server-config.model.ts index 2c5026b30..1667bc0e2 100644 --- a/shared/models/server/server-config.model.ts +++ b/shared/models/server/server-config.model.ts | |||
@@ -214,6 +214,10 @@ export interface ServerConfig { | |||
214 | level: BroadcastMessageLevel | 214 | level: BroadcastMessageLevel |
215 | dismissable: boolean | 215 | dismissable: boolean |
216 | } | 216 | } |
217 | |||
218 | homepage: { | ||
219 | enabled: boolean | ||
220 | } | ||
217 | } | 221 | } |
218 | 222 | ||
219 | export type HTMLServerConfig = Omit<ServerConfig, 'signup'> | 223 | export type HTMLServerConfig = Omit<ServerConfig, 'signup'> |
diff --git a/shared/models/users/user-right.enum.ts b/shared/models/users/user-right.enum.ts index bbedc9f00..950b22bad 100644 --- a/shared/models/users/user-right.enum.ts +++ b/shared/models/users/user-right.enum.ts | |||
@@ -16,6 +16,7 @@ export const enum UserRight { | |||
16 | MANAGE_JOBS, | 16 | MANAGE_JOBS, |
17 | 17 | ||
18 | MANAGE_CONFIGURATION, | 18 | MANAGE_CONFIGURATION, |
19 | MANAGE_INSTANCE_CUSTOM_PAGE, | ||
19 | 20 | ||
20 | MANAGE_ACCOUNTS_BLOCKLIST, | 21 | MANAGE_ACCOUNTS_BLOCKLIST, |
21 | MANAGE_SERVERS_BLOCKLIST, | 22 | MANAGE_SERVERS_BLOCKLIST, |