Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config for editor return label #1232

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions backend/src/config/opencast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ use crate::{
config::HttpHost,
};

use super::TranslatedString;


#[derive(Debug, confique::Config)]
pub(crate) struct OpencastConfig {
Expand Down Expand Up @@ -49,6 +51,21 @@ pub(crate) struct OpencastConfig {
/// be trusted.
#[config(default = [])]
pub(crate) other_hosts: Vec<HttpHost>,

/// Set the return label for Editor.
/// This is for text on a button that will take you back to Tobira
/// after editing is done.
/// Part of that text ("Return to" / "Zurück zu") is fixed in Editor and
/// cannot be configured here.
/// The label can be configured in english and german.
///
/// Example:
/// editor_return_label.en = "Tobira"
/// editor_return_label.de = "Aribot"
///
/// Results in "Return to Tobira" / "Zurück zu Aribot".
/// If not set, "Video" is used for both languages.
pub(crate) editor_return_label: Option<TranslatedString>,
}

impl OpencastConfig {
Expand Down
1 change: 1 addition & 0 deletions backend/src/http/assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ fn frontend_config(config: &Config) -> serde_json::Value {
"uploadNode": config.opencast.upload_node().to_string(),
"studioUrl": config.opencast.studio_url().to_string(),
"editorUrl": config.opencast.editor_url().to_string(),
"editorReturnLabel": config.opencast.editor_return_label,
},
"logo": {
"large": logo_obj(&config.theme.logo.large),
Expand Down
15 changes: 15 additions & 0 deletions docs/docs/setup/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,21 @@
# Default value: []
#other_hosts = []

# Set the return label for Editor.
# This is for text on a button that will take you back to Tobira
# after editing is done.
# Part of that text ("Return to" / "Zurück zu") is fixed in Editor and
# cannot be configured here.
# The label can be configured in english and german.
#
# Example:
# editor_return_label.en = "Tobira"
# editor_return_label.de = "Aribot"
#
# Results in "Return to Tobira" / "Zurück zu Aribot".
# If not set, "Video" is used for both languages.
#editor_return_label =


[sync]
# Username of the user used to communicate with Opencast for data syncing.
Expand Down
1 change: 1 addition & 0 deletions frontend/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ type OpencastConfig = {
uploadNode: string;
studioUrl: string;
editorUrl: string;
editorReturnLabel: TranslatedString | null;
};

type VersionInfo = {
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/routes/manage/Video/Details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ const Page: React.FC<Props> = ({ event }) => {
params={{
id: event.opencastId,
callbackUrl: document.location.href,
callbackSystem: translatedConfig(CONFIG.siteTitle, i18n),
callbackSystem: CONFIG.opencast.editorReturnLabel
? translatedConfig(CONFIG.opencast.editorReturnLabel, i18n)
: t("video.video"),
}}
fallback="button"
css={buttonStyle(config, "normal", isHighContrast)}
Expand Down
2 changes: 2 additions & 0 deletions util/dev-config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ secret_key = "jwt-key.pem"

[opencast]
host = "http://localhost:8081"
editor_return_label.en = "Video"
editor_return_label.de = "dem Video"

[sync]
user = "admin"
Expand Down
Loading