2023-07-31 07:34:36 -05:00
|
|
|
import { DEFAULT_THEME_NAME, DEFAULT_USER_THEME_NAME } from '../../initializers/constants.js'
|
|
|
|
import { PluginManager } from './plugin-manager.js'
|
|
|
|
import { CONFIG } from '../../initializers/config.js'
|
Global client redesign
* Split "my library" into "video space (channels, videos...)" and "my library (playlists, history...)"
* Split "admin" into "overview (users, videos...)", "moderation (abuses, blocks, registrations...)" and "settings (configuration, runners...)"
* Reorganize the header and the left menu: account settings/notifications are now in the header
* Add instance information context in the left menu
* Merge dedicated videos pages for "recently added", "trending", "local videos" into a "browse videos" page that includes quick filters
* Clean up entire CSS
* Clean CSS variables so it's easier to theme PeerTube (some new variables fallback to old variables to limit currnet themes breakages)
* Replace the current light theme into a new one (beige)
* Add a dark (brown) theme (included in PeerTube core)
* Fix accessibility issues with old light theme colors (white on orange button for example)
* Redesign the left menu, the horizontal menu, form controls and buttons, "Discover videos" page and common video filters panel
* Replace/remove/add some global icon
2024-11-05 03:03:40 -06:00
|
|
|
import { ServerConfigManager } from '../server-config-manager.js'
|
2019-07-09 04:45:19 -05:00
|
|
|
|
Global client redesign
* Split "my library" into "video space (channels, videos...)" and "my library (playlists, history...)"
* Split "admin" into "overview (users, videos...)", "moderation (abuses, blocks, registrations...)" and "settings (configuration, runners...)"
* Reorganize the header and the left menu: account settings/notifications are now in the header
* Add instance information context in the left menu
* Merge dedicated videos pages for "recently added", "trending", "local videos" into a "browse videos" page that includes quick filters
* Clean up entire CSS
* Clean CSS variables so it's easier to theme PeerTube (some new variables fallback to old variables to limit currnet themes breakages)
* Replace the current light theme into a new one (beige)
* Add a dark (brown) theme (included in PeerTube core)
* Fix accessibility issues with old light theme colors (white on orange button for example)
* Redesign the left menu, the horizontal menu, form controls and buttons, "Discover videos" page and common video filters panel
* Replace/remove/add some global icon
2024-11-05 03:03:40 -06:00
|
|
|
export function getThemeOrDefault (name: string, defaultTheme: string) {
|
2019-07-09 04:45:19 -05:00
|
|
|
if (isThemeRegistered(name)) return name
|
|
|
|
|
|
|
|
// Fallback to admin default theme
|
2019-07-10 07:06:19 -05:00
|
|
|
if (name !== CONFIG.THEME.DEFAULT) return getThemeOrDefault(CONFIG.THEME.DEFAULT, DEFAULT_THEME_NAME)
|
2019-07-09 04:45:19 -05:00
|
|
|
|
2019-07-10 07:06:19 -05:00
|
|
|
return defaultTheme
|
2019-07-09 04:45:19 -05:00
|
|
|
}
|
|
|
|
|
Global client redesign
* Split "my library" into "video space (channels, videos...)" and "my library (playlists, history...)"
* Split "admin" into "overview (users, videos...)", "moderation (abuses, blocks, registrations...)" and "settings (configuration, runners...)"
* Reorganize the header and the left menu: account settings/notifications are now in the header
* Add instance information context in the left menu
* Merge dedicated videos pages for "recently added", "trending", "local videos" into a "browse videos" page that includes quick filters
* Clean up entire CSS
* Clean CSS variables so it's easier to theme PeerTube (some new variables fallback to old variables to limit currnet themes breakages)
* Replace the current light theme into a new one (beige)
* Add a dark (brown) theme (included in PeerTube core)
* Fix accessibility issues with old light theme colors (white on orange button for example)
* Redesign the left menu, the horizontal menu, form controls and buttons, "Discover videos" page and common video filters panel
* Replace/remove/add some global icon
2024-11-05 03:03:40 -06:00
|
|
|
export function isThemeRegistered (name: string) {
|
2019-07-10 07:06:19 -05:00
|
|
|
if (name === DEFAULT_THEME_NAME || name === DEFAULT_USER_THEME_NAME) return true
|
2019-07-09 04:45:19 -05:00
|
|
|
|
Global client redesign
* Split "my library" into "video space (channels, videos...)" and "my library (playlists, history...)"
* Split "admin" into "overview (users, videos...)", "moderation (abuses, blocks, registrations...)" and "settings (configuration, runners...)"
* Reorganize the header and the left menu: account settings/notifications are now in the header
* Add instance information context in the left menu
* Merge dedicated videos pages for "recently added", "trending", "local videos" into a "browse videos" page that includes quick filters
* Clean up entire CSS
* Clean CSS variables so it's easier to theme PeerTube (some new variables fallback to old variables to limit currnet themes breakages)
* Replace the current light theme into a new one (beige)
* Add a dark (brown) theme (included in PeerTube core)
* Fix accessibility issues with old light theme colors (white on orange button for example)
* Redesign the left menu, the horizontal menu, form controls and buttons, "Discover videos" page and common video filters panel
* Replace/remove/add some global icon
2024-11-05 03:03:40 -06:00
|
|
|
return PluginManager.Instance.getRegisteredThemes().some(r => r.name === name) ||
|
|
|
|
ServerConfigManager.Instance.getBuiltInThemes().some(r => r.name === name)
|
2019-07-09 04:45:19 -05:00
|
|
|
}
|